From owner-svn-src-all@freebsd.org Tue May 24 07:52:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17AE4B48324; Tue, 24 May 2016 07:52:55 +0000 (UTC) (envelope-from hselasky@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 mx1.freebsd.org (Postfix) with ESMTPS id DDEB31979; Tue, 24 May 2016 07:52:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4O7qsfx089302; Tue, 24 May 2016 07:52:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4O7qs1n089301; Tue, 24 May 2016 07:52:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201605240752.u4O7qs1n089301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 24 May 2016 07:52:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r300591 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head 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.22 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: Tue, 24 May 2016 07:52:55 -0000 Author: hselasky Date: Tue May 24 07:52:53 2016 New Revision: 300591 URL: https://svnweb.freebsd.org/changeset/base/300591 Log: Use the DROP_GIANT() and PICKUP_GIANT() macros instead of making assumptions about how the Giant mutex is locked. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Tue May 24 07:46:20 2016 (r300590) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Tue May 24 07:52:53 2016 (r300591) @@ -146,12 +146,12 @@ linux_pci_attach(device_t dev) else pdev->dev.irq = 255; pdev->irq = pdev->dev.irq; - mtx_unlock(&Giant); + DROP_GIANT(); spin_lock(&pci_lock); list_add(&pdev->links, &pci_devices); spin_unlock(&pci_lock); error = pdrv->probe(pdev, id); - mtx_lock(&Giant); + PICKUP_GIANT(); if (error) { spin_lock(&pci_lock); list_del(&pdev->links); @@ -173,9 +173,9 @@ linux_pci_detach(device_t dev) td = curthread; linux_set_current(td, &t); pdev = device_get_softc(dev); - mtx_unlock(&Giant); + DROP_GIANT(); pdev->pdrv->remove(pdev); - mtx_lock(&Giant); + PICKUP_GIANT(); spin_lock(&pci_lock); list_del(&pdev->links); spin_unlock(&pci_lock);