From owner-svn-src-stable@freebsd.org Wed Oct 17 00:57:29 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C4EF10E6986; Wed, 17 Oct 2018 00:57:29 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBFA088F61; Wed, 17 Oct 2018 00:57:28 +0000 (UTC) (envelope-from np@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 B83CD24497; Wed, 17 Oct 2018 00:57:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9H0vSST059513; Wed, 17 Oct 2018 00:57:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9H0vSnX059512; Wed, 17 Oct 2018 00:57:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201810170057.w9H0vSnX059512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 17 Oct 2018 00:57:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r339397 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 339397 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Oct 2018 00:57:29 -0000 Author: np Date: Wed Oct 17 00:57:28 2018 New Revision: 339397 URL: https://svnweb.freebsd.org/changeset/base/339397 Log: MFC r333139: cxgbe(4): Destroy the cdev before disabling interrupts in driver detach. Filter work requests are submitted in the nexus cdev's ioctl which then blocks waiting for a reply. If driver detach runs in this state and disables interrupts the ioctl will never complete and detach will hang in destroy_cdev. Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Wed Oct 17 00:45:01 2018 (r339396) +++ stable/11/sys/dev/cxgbe/t4_main.c Wed Oct 17 00:57:28 2018 (r339397) @@ -1308,15 +1308,15 @@ t4_detach_common(device_t dev) sc = device_get_softc(dev); + if (sc->cdev) { + destroy_dev(sc->cdev); + sc->cdev = NULL; + } + sc->flags &= ~CHK_MBOX_ACCESS; if (sc->flags & FULL_INIT_DONE) { if (!(sc->flags & IS_VF)) t4_intr_disable(sc); - } - - if (sc->cdev) { - destroy_dev(sc->cdev); - sc->cdev = NULL; } if (device_is_attached(dev)) {