Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 May 2016 07:52:54 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
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
Message-ID:  <201605240752.u4O7qs1n089301@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605240752.u4O7qs1n089301>