kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()
all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
- Extend alldevs_mtx section in deviter_init.
- Assert ownership of alldevs_mtx in private functions:
. deviter_reinit
. deviter_next1
. deviter_next2
- Acquire alldevs_mtx in deviter_next.
(alldevs_mtx is not relevant to the struct deviter object, which is
private to the caller who must guarantee exclusive access to it.)
XXX Since everything has (or should have) been switched to dev_t, we
XXX could probably remove the check for
XXX
XXX ca->ca_devsize >= sizeof(struct device)
XXX
XXX But someone ought to check on that first!
Reviewed by riastradh@
detaching devices at shutdown time with RB_POWERDOWN.
When detaching wd(4), put the drive in standby before detach
for DETACH_POWEROFF.
Fix PR kern/51252
used before.
- assert that old size == 0 or old pointer valid
- check for size instead
- rewrite array splice operation with simple loops instead of memcpy/memset.
list of future callbacks. We've already processed the list (and removed
all the entries), and there's nothing in the future that will process
the list again.
This avoids the possibility of leaving an entry in the list that points
to an unloaded module's former address space.
can start up. this solves the problem where a console device needs
mountroot to complete attaching, and must create wsdisplay0 before
init tries to open /dev/console. fixes PR#49709.
XXX: pullup-7
weak aliases device_register(9) and device_register_post_config(9)
for the stub routine voidop(). Get rid of __HAVE_DEVICE_REGISTER and
__HAVE_DEVICE_REGISTER_POST_CONFIG.
after mountroot(), like config_interrupt(9) that defers
configuration after interrupts are enabled.
This will be used for devices that require firmware loaded
from the root file system by firmload(9) to complete device
initialization (getting MAC address etc).
No objection on tech-kern@:
http://mail-index.NetBSD.org/tech-kern/2010/06/18/msg008370.html
and will also fix PR kern/43125.
and acquiring alldevs_mtx already blocks those interrupts, so delete the
splhigh()/splx() in config_alldevs_lock()/_unlock().
Release alldevs_mtx while freeing memory with kmem_free(9); according to
new documentation, kmem_free(9) can sleep! :-) Thanks to rmind@ for the
tip.
Next step: use finer-grained locking, probably by adding a mutex to
cfdriver_t.
And after that: make sure that all threads of execution are out of the
device_t and/or softc before releasing their memory.