From owner-svn-src-all@freebsd.org Sun Nov 24 15:37:20 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEA0A1B245C; Sun, 24 Nov 2019 15:37:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47LZ6S2d82z48FK; Sun, 24 Nov 2019 15:37:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38BE426417; Sun, 24 Nov 2019 15:37:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAOFbKcT060156; Sun, 24 Nov 2019 15:37:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAOFbJNn060154; Sun, 24 Nov 2019 15:37:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201911241537.xAOFbJNn060154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 24 Nov 2019 15:37:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355058 - in head/sys/dev: aac aacraid X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: aac aacraid X-SVN-Commit-Revision: 355058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Nov 2019 15:37:20 -0000 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