PR/60021: USB-only boot: uhub0 attaches but uhub1 never appears...
Update the dwc2 intial reset sequence to more closely match the upstream
driver - it's changed a bit in the last 10 years.
This reset sequence gets the device out of the state it's left in by the
RaspberryPI firmware when booting from USB.
proc_vmspace_getref: Take p->p_lock around p->p_sflag access.
Prompted by reviewing the locking rules in;
PR kern/60568: panic locking against myself (p->p_lock) in NFS from
sysctl_vmproc
sysctl kern.proc_args.*.cwd/pathname: Use p_reflock, not p_lock.
- Avoid holding p_lock across copyout; this risks deadlock or panic
if memory is exhausted and the uvm fault handler during copyout
tries to deliver SIGKILL, which requires p_lock.
- Avoid holding p_lock across vnode_to_path: this risks deadlock or
panic if the file system, such as nfs, tries to check for pending
signals, which requires p_lock.
PR kern/60568: panic locking against myself (p->p_lock) in NFS from
sysctl_vmproc
sysctl vm.proc.*: Use p_reflock, not p_lock.
- Avoid holding p_lock across copyout; this risks deadlock or panic
if memory is exhausted and the uvm fault handler during copyout
tries to deliver SIGKILL, which requires p_lock.
- Avoid holding p_lock across vnode_to_path: this risks deadlock or
panic if the file system, such as nfs, tries to check for pending
signals, which requires p_lock.
PR kern/60568: panic locking against myself (p->p_lock) in NFS from
sysctl_vmproc
kern: New function proc_find_reflocked.
This is like proc_find_locked but returns with p_reflock held rather
than p_lock. Will be used to replace proc_find_locked in order to
fix:
PR kern/60568: panic locking against myself (p->p_lock) in NFS from
sysctl_vmproc
No modules currently use proc_find_locked or proc_find_reflocked, so
there should be no module ABI compatibility issues here.
pciconf: Sort resource windows in order of decreasing alignment
instead of size.
Consider pci0 has two ppb's. ppb0 has a memory window larger in
size, but smaller in alignment. ppb1 has one smaller in size, but
larger in alignment.
In this case, the memory window of ppb1 must be allocated earlier.
Otherwise, total size of required memory exceeds pci0's mem_total,
in general, due to padding region.
pciconf: Fix round-up logics for total sizes of bridge resources
The previous ones are valid only if alignments are 4K or 1M,
for I/O or memory, respectively.
pciconf: Fix alignments of device memory and I/O resources
Resources must be their-size-aligned. While here:
- Switch *align variable from int to more suitable integer types.
- Make some conditions clearer (NFC).
sdmmc: dmamap_load bounce buffer on demand
When using a bounce buffer, cmd->c_dmamap->dm_segs[0]->ds_len did not agree with cmd->c_datalen because the bounce buffer is loaded once at initialization, so cmd->c_dmamap->dm_segs[0]->ds_len never gets updated before executing a sdmmc command.
This is problematic when the dmamap is passed on to an API like fdt_dma that treats the dmamap as the source of truth.
This problem probably hasn't surfaced yet because it needs three preconditions:
- using bounce buffers is already an edge case for when we can't allocate block size aligned dma memory
- the driver needs CAPS_DMA, but not CAPS_MULTI_SEG_DMA
- the driver needs to use cmd->c_dmamap->dm_segs[0]->ds_len and not cmd->c_datalen
The fix is to bus_dmamap_load the bounce buffer just when we need it. This allows us to load it with the correct size.
evbarm/ti_edma: enable on am18xx SoCs
The linux dt-bindings allow two different ways to specify power/clock domains for the edma3. This commit adds support for the way used on the am18xx (powerdomains).
igc: Fix KASSERT failure when `ifconfig igc%d down`
When we invoke callout_halt(9) for rxr->rx_refill, both in
igc_stop_locked() and igc_free_receive_buffers(), we don't hold
rxr->rxr_lock.
Also, `drvctl -d igc%d` does not trigger KASSERT failure now.
Make is possible to de-select depended options (which are processed in
a separate pass). Example:
<files.foo>
defflag SOME_OPTION: SOME_OTHER_OPTION
<MYFOO>
options SOME_OPTION
no options SOME_OTHER_OPTION
Prior to this change, a warning that SOME_OTHER_OPTION was not selected
would be issued and SOME_OTHER_OPTION would remain selected in the output.
After this change, no warning is issued and SOME_OTHER_OPTION is not
selected in the output as expected.
This does not have broad utility, but can quite useful in certain situations.
s/mipsNN_cp0_cause_read/mips_cp0_cause_read/ in INGENIC_INTR_DEBUG guarded code.
It is disabled though, thus moving #ifdef 0 higher to make option build.
(otherwise buffer is unused and compiler complains)
Not sure why the code was disabled, potentially it was too verbose.