[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210623022824.308041-2-mcgrof@kernel.org>
Date: Tue, 22 Jun 2021 19:28:23 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: bhelgaas@...gle.com, alex.williamson@...hat.com, cohuck@...hat.com,
jgg@...pe.ca, kevin.tian@...el.com, eric.auger@...hat.com,
giovanni.cabiddu@...el.com, mjrosato@...ux.ibm.com,
jannh@...gle.com, kvm@...r.kernel.org, linux-pci@...r.kernel.org,
schnelle@...ux.ibm.com
Cc: minchan@...nel.org, gregkh@...uxfoundation.org, rafael@...nel.org,
jeyu@...nel.org, ngupta@...are.org,
sergey.senozhatsky.work@...il.com, mcgrof@...nel.org,
axboe@...nel.dk, mbenes@...e.com, jpoimboe@...hat.com,
tglx@...utronix.de, keescook@...omium.org, jikos@...nel.org,
rostedt@...dmis.org, peterz@...radead.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/2] PCI: Export pci_dev_trylock() and pci_dev_unlock()
Other places in the kernel use this form, and so just
provide a common path for it.
Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
drivers/pci/pci.c | 6 ++++--
include/linux/pci.h | 3 +++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index f09821af1d2e..b1d9bb3f5ae2 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5027,7 +5027,7 @@ static void pci_dev_lock(struct pci_dev *dev)
}
/* Return 1 on successful lock, 0 on contention */
-static int pci_dev_trylock(struct pci_dev *dev)
+int pci_dev_trylock(struct pci_dev *dev)
{
if (pci_cfg_access_trylock(dev)) {
if (device_trylock(&dev->dev))
@@ -5037,12 +5037,14 @@ static int pci_dev_trylock(struct pci_dev *dev)
return 0;
}
+EXPORT_SYMBOL_GPL(pci_dev_trylock);
-static void pci_dev_unlock(struct pci_dev *dev)
+void pci_dev_unlock(struct pci_dev *dev)
{
device_unlock(&dev->dev);
pci_cfg_access_unlock(dev);
}
+EXPORT_SYMBOL_GPL(pci_dev_unlock);
static void pci_dev_save_and_disable(struct pci_dev *dev)
{
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 6248e044dd29..d8f056f3a2e3 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1622,6 +1622,9 @@ void pci_cfg_access_lock(struct pci_dev *dev);
bool pci_cfg_access_trylock(struct pci_dev *dev);
void pci_cfg_access_unlock(struct pci_dev *dev);
+int pci_dev_trylock(struct pci_dev *dev);
+void pci_dev_unlock(struct pci_dev *dev);
+
/*
* PCI domain support. Sometimes called PCI segment (eg by ACPI),
* a PCI domain is defined to be a set of PCI buses which share
--
2.30.2
Powered by blists - more mailing lists