svn commit: r355058 - in head/sys/dev: aac aacraid

Warner Losh imp at FreeBSD.org
Sun Nov 24 15:37:20 UTC 2019


Author: imp
Date: Sun Nov 24 15:37:19 2019
New Revision: 355058
URL: https://svnweb.freebsd.org/changeset/base/355058

Log:
  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.

Modified:
  head/sys/dev/aac/aac.c
  head/sys/dev/aacraid/aacraid.c

Modified: head/sys/dev/aac/aac.c
==============================================================================
--- head/sys/dev/aac/aac.c	Sun Nov 24 15:37:14 2019	(r355057)
+++ head/sys/dev/aac/aac.c	Sun Nov 24 15:37:19 2019	(r355058)
@@ -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);
 }
 
 /*

Modified: head/sys/dev/aacraid/aacraid.c
==============================================================================
--- head/sys/dev/aacraid/aacraid.c	Sun Nov 24 15:37:14 2019	(r355057)
+++ head/sys/dev/aacraid/aacraid.c	Sun Nov 24 15:37:19 2019	(r355058)
@@ -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


More information about the svn-src-all mailing list