From dfdbb32093ce354251f15ff54247f29285456e2a Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 24 Nov 2019 15:37:19 +0000 Subject: Don't need giant for these drivers dev nodes. Also, Giant isn't required to busy / unbusy a device, so drop that too while I'm here. It's not done elsewhere in the tree and in the future will likely be handled by a node lock to ensure consistency. Leave Giant in place for attach and removing childing, as that's actually still needed, even if imperfect. Remove stale comment about contigmalloc taking Giant and calling w/o the lock held. Neither of these is still true. --- sys/dev/aac/aac.c | 4 +--- sys/dev/aacraid/aacraid.c | 8 ++------ 2 files changed, 3 insertions(+), 9 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index f7ad60581180..74e9fc7f34a8 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -215,7 +215,7 @@ static struct aac_mntinforesp * static struct cdevsw aac_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = 0, .d_open = aac_open, .d_ioctl = aac_ioctl, .d_poll = aac_poll, @@ -3210,9 +3210,7 @@ aac_cdevpriv_dtor(void *arg) sc = arg; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - mtx_lock(&Giant); device_unbusy(sc->aac_dev); - mtx_unlock(&Giant); } /* diff --git a/sys/dev/aacraid/aacraid.c b/sys/dev/aacraid/aacraid.c index 3c8a33d02a96..572f0429b280 100644 --- a/sys/dev/aacraid/aacraid.c +++ b/sys/dev/aacraid/aacraid.c @@ -218,7 +218,7 @@ static u_int32_t static struct cdevsw aacraid_cdevsw = { .d_version = D_VERSION, - .d_flags = D_NEEDGIANT, + .d_flags = 0, .d_open = aac_open, #if __FreeBSD_version < 702000 .d_close = aac_close, @@ -1044,9 +1044,7 @@ aac_command_thread(struct aac_softc *sc) "aacraid_aifthd", AAC_PERIODIC_INTERVAL * hz); /* - * First see if any FIBs need to be allocated. This needs - * to be called without the driver lock because contigmalloc - * will grab Giant, and would result in an LOR. + * First see if any FIBs need to be allocated. */ if ((sc->aifflags & AAC_AIFFLAGS_ALLOCFIBS) != 0) { aac_alloc_commands(sc); @@ -3090,9 +3088,7 @@ aac_cdevpriv_dtor(void *arg) sc = arg; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); - mtx_lock(&Giant); device_unbusy(sc->aac_dev); - mtx_unlock(&Giant); } #else static int -- cgit v1.3