Message ID | 20210916093336.2895602-4-schnelle@linux.ibm.com (mailing list archive) |
---|---|
State | Not Applicable |
Delegated to: | Bjorn Helgaas |
Headers | show |
Series | s390/pci: automatic error recovery | expand |
On Thu, 2021-09-16 at 11:33 +0200, Niklas Schnelle wrote: > Commit e3a9b1212b9d ("PCI: Export pci_dev_trylock() and pci_dev_unlock()") > already exported pci_dev_trylock()/pci_dev_unlock() however in some > circumstances such as during error recovery it makes sense to block > waiting to get full access to the device so also export pci_dev_lock(). > > Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> > --- > drivers/pci/pci.c | 3 ++- > include/linux/pci.h | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index ce2ab62b64cf..6fe810fdb796 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -5059,12 +5059,13 @@ static int pci_reset_bus_function(struct pci_dev *dev, bool probe) > return pci_parent_bus_reset(dev, probe); > } > > -static void pci_dev_lock(struct pci_dev *dev) > +void pci_dev_lock(struct pci_dev *dev) > { > pci_cfg_access_lock(dev); > /* block PM suspend, driver probe, etc. */ > device_lock(&dev->dev); > } > +EXPORT_SYMBOL_GPL(pci_dev_lock); > > /* Return 1 on successful lock, 0 on contention */ > int pci_dev_trylock(struct pci_dev *dev) > diff --git a/include/linux/pci.h b/include/linux/pci.h > index cd8aa6fce204..c27c8fd1d30c 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -1671,6 +1671,7 @@ 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); > > +void pci_dev_lock(struct pci_dev *dev); > int pci_dev_trylock(struct pci_dev *dev); > void pci_dev_unlock(struct pci_dev *dev); > Friendly ping. This now being the only common code change required and with currently no known other issus, an Ack for this is the only thing preventing this feature from going ahead. So any feedback would be appreciated!
On Thu, Sep 16, 2021 at 11:33:35AM +0200, Niklas Schnelle wrote: > Commit e3a9b1212b9d ("PCI: Export pci_dev_trylock() and pci_dev_unlock()") > already exported pci_dev_trylock()/pci_dev_unlock() however in some > circumstances such as during error recovery it makes sense to block > waiting to get full access to the device so also export pci_dev_lock(). > > Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> > --- > drivers/pci/pci.c | 3 ++- > include/linux/pci.h | 1 + > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index ce2ab62b64cf..6fe810fdb796 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -5059,12 +5059,13 @@ static int pci_reset_bus_function(struct pci_dev *dev, bool probe) > return pci_parent_bus_reset(dev, probe); > } > > -static void pci_dev_lock(struct pci_dev *dev) > +void pci_dev_lock(struct pci_dev *dev) > { > pci_cfg_access_lock(dev); > /* block PM suspend, driver probe, etc. */ > device_lock(&dev->dev); > } > +EXPORT_SYMBOL_GPL(pci_dev_lock); > > /* Return 1 on successful lock, 0 on contention */ > int pci_dev_trylock(struct pci_dev *dev) > diff --git a/include/linux/pci.h b/include/linux/pci.h > index cd8aa6fce204..c27c8fd1d30c 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -1671,6 +1671,7 @@ 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); > > +void pci_dev_lock(struct pci_dev *dev); > int pci_dev_trylock(struct pci_dev *dev); > void pci_dev_unlock(struct pci_dev *dev); > > -- > 2.25.1 >
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index ce2ab62b64cf..6fe810fdb796 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -5059,12 +5059,13 @@ static int pci_reset_bus_function(struct pci_dev *dev, bool probe) return pci_parent_bus_reset(dev, probe); } -static void pci_dev_lock(struct pci_dev *dev) +void pci_dev_lock(struct pci_dev *dev) { pci_cfg_access_lock(dev); /* block PM suspend, driver probe, etc. */ device_lock(&dev->dev); } +EXPORT_SYMBOL_GPL(pci_dev_lock); /* Return 1 on successful lock, 0 on contention */ int pci_dev_trylock(struct pci_dev *dev) diff --git a/include/linux/pci.h b/include/linux/pci.h index cd8aa6fce204..c27c8fd1d30c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1671,6 +1671,7 @@ 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); +void pci_dev_lock(struct pci_dev *dev); int pci_dev_trylock(struct pci_dev *dev); void pci_dev_unlock(struct pci_dev *dev);
Commit e3a9b1212b9d ("PCI: Export pci_dev_trylock() and pci_dev_unlock()") already exported pci_dev_trylock()/pci_dev_unlock() however in some circumstances such as during error recovery it makes sense to block waiting to get full access to the device so also export pci_dev_lock(). Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> --- drivers/pci/pci.c | 3 ++- include/linux/pci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)