diff options
author | trasz <trasz@FreeBSD.org> | 2015-05-24 04:14:09 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2015-05-24 04:14:09 +0000 |
commit | 531e259796a40dbc2136525917ce52587b882c13 (patch) | |
tree | 63a0af7e72743511329ee86949d4bceed034b004 /sys/cam/cam_xpt.c | |
parent | e65a83355e4c18754f620a7c9b6e26553c777817 (diff) | |
download | FreeBSD-src-531e259796a40dbc2136525917ce52587b882c13.zip FreeBSD-src-531e259796a40dbc2136525917ce52587b882c13.tar.gz |
MFC r279554:
Make periphdriver_register() take XPT lock when modifying the periph_drivers
array.
This fixes a panic that sometimes occured when kldloading ctl.ko.
PR: 200384
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r-- | sys/cam/cam_xpt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c index b48654a..645ded0 100644 --- a/sys/cam/cam_xpt.c +++ b/sys/cam/cam_xpt.c @@ -149,6 +149,8 @@ typedef int xpt_pdrvfunc_t (struct periph_driver **pdrv, void *arg); /* Transport layer configuration information */ static struct xpt_softc xsoftc; +MTX_SYSINIT(xpt_topo_init, &xsoftc.xpt_topo_lock, "XPT topology lock", MTX_DEF); + TUNABLE_INT("kern.cam.boot_delay", &xsoftc.boot_delay); SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, &xsoftc.boot_delay, 0, "Bus registration wait time"); @@ -850,7 +852,6 @@ xpt_init(void *dummy) mtx_init(&xsoftc.xpt_lock, "XPT lock", NULL, MTX_DEF); mtx_init(&xsoftc.xpt_highpower_lock, "XPT highpower lock", NULL, MTX_DEF); - mtx_init(&xsoftc.xpt_topo_lock, "XPT topology lock", NULL, MTX_DEF); xsoftc.xpt_taskq = taskqueue_create("CAM XPT task", M_WAITOK, taskqueue_thread_enqueue, /*context*/&xsoftc.xpt_taskq); |