diff options
author | hselasky <hselasky@FreeBSD.org> | 2016-05-24 07:52:53 +0000 |
---|---|---|
committer | hselasky <hselasky@FreeBSD.org> | 2016-05-24 07:52:53 +0000 |
commit | 53c5fcfd379ff955f7fe3831df6d8c7a313f0205 (patch) | |
tree | 14c3f03c808a5be2e88e7c4d6143322b15d41f6d /sys/compat/linuxkpi | |
parent | 9c5bbe0e983a291755913af4e8511a18ce46e4d7 (diff) | |
download | FreeBSD-src-53c5fcfd379ff955f7fe3831df6d8c7a313f0205.zip FreeBSD-src-53c5fcfd379ff955f7fe3831df6d8c7a313f0205.tar.gz |
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
Diffstat (limited to 'sys/compat/linuxkpi')
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 646a230..cc95ea6 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -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); |