diff mbox

PCI: Export pci_probe_reset_function()

Message ID 20150409155100.6891.72838.stgit@gimli.home (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Alex Williamson April 9, 2015, 3:51 p.m. UTC
The equivalent bus and slot versions of this are already exported and
vfio-pci would like a function-probe available so we can expose
function-level reset capabilities to the user without necessarily
using it to perform a reset before enabling the device for the user.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
---
 drivers/pci/pci.c   |    1 +
 include/linux/pci.h |    1 +
 2 files changed, 2 insertions(+)


--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bjorn Helgaas April 9, 2015, 7:58 p.m. UTC | #1
On Thu, Apr 09, 2015 at 09:51:43AM -0600, Alex Williamson wrote:
> The equivalent bus and slot versions of this are already exported and
> vfio-pci would like a function-probe available so we can expose
> function-level reset capabilities to the user without necessarily
> using it to perform a reset before enabling the device for the user.
> 
> Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

Applied to pci/virtualization for v4.1, thanks!

> ---
>  drivers/pci/pci.c   |    1 +
>  include/linux/pci.h |    1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 81f06e8..9f3e691 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3524,6 +3524,7 @@ int pci_probe_reset_function(struct pci_dev *dev)
>  {
>  	return pci_dev_reset(dev, 1);
>  }
> +EXPORT_SYMBOL_GPL(pci_probe_reset_function);
>  
>  /**
>   * pci_reset_function - quiesce and reset a PCI device function
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 211e9da..233d1ae 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -986,6 +986,7 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
>  			  enum pcie_link_width *width);
>  int __pci_reset_function(struct pci_dev *dev);
>  int __pci_reset_function_locked(struct pci_dev *dev);
> +int pci_probe_reset_function(struct pci_dev *dev);
>  int pci_reset_function(struct pci_dev *dev);
>  int pci_try_reset_function(struct pci_dev *dev);
>  int pci_probe_reset_slot(struct pci_slot *slot);
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas April 9, 2015, 8 p.m. UTC | #2
On Thu, Apr 09, 2015 at 02:58:46PM -0500, Bjorn Helgaas wrote:
> On Thu, Apr 09, 2015 at 09:51:43AM -0600, Alex Williamson wrote:
> > The equivalent bus and slot versions of this are already exported and
> > vfio-pci would like a function-probe available so we can expose
> > function-level reset capabilities to the user without necessarily
> > using it to perform a reset before enabling the device for the user.
> > 
> > Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> 
> Applied to pci/virtualization for v4.1, thanks!

Actually, maybe it makes more sense for you to apply this along with the
vfio patch that uses it?  So if you want:

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> > ---
> >  drivers/pci/pci.c   |    1 +
> >  include/linux/pci.h |    1 +
> >  2 files changed, 2 insertions(+)
> > 
> > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > index 81f06e8..9f3e691 100644
> > --- a/drivers/pci/pci.c
> > +++ b/drivers/pci/pci.c
> > @@ -3524,6 +3524,7 @@ int pci_probe_reset_function(struct pci_dev *dev)
> >  {
> >  	return pci_dev_reset(dev, 1);
> >  }
> > +EXPORT_SYMBOL_GPL(pci_probe_reset_function);
> >  
> >  /**
> >   * pci_reset_function - quiesce and reset a PCI device function
> > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > index 211e9da..233d1ae 100644
> > --- a/include/linux/pci.h
> > +++ b/include/linux/pci.h
> > @@ -986,6 +986,7 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
> >  			  enum pcie_link_width *width);
> >  int __pci_reset_function(struct pci_dev *dev);
> >  int __pci_reset_function_locked(struct pci_dev *dev);
> > +int pci_probe_reset_function(struct pci_dev *dev);
> >  int pci_reset_function(struct pci_dev *dev);
> >  int pci_try_reset_function(struct pci_dev *dev);
> >  int pci_probe_reset_slot(struct pci_slot *slot);
> > 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alex Williamson April 9, 2015, 8:11 p.m. UTC | #3
On Thu, 2015-04-09 at 15:00 -0500, Bjorn Helgaas wrote:
> On Thu, Apr 09, 2015 at 02:58:46PM -0500, Bjorn Helgaas wrote:
> > On Thu, Apr 09, 2015 at 09:51:43AM -0600, Alex Williamson wrote:
> > > The equivalent bus and slot versions of this are already exported and
> > > vfio-pci would like a function-probe available so we can expose
> > > function-level reset capabilities to the user without necessarily
> > > using it to perform a reset before enabling the device for the user.
> > > 
> > > Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
> > 
> > Applied to pci/virtualization for v4.1, thanks!
> 
> Actually, maybe it makes more sense for you to apply this along with the
> vfio patch that uses it?  So if you want:
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

That would be more convenient, I'll take it.  Thanks!

Alex

> > > ---
> > >  drivers/pci/pci.c   |    1 +
> > >  include/linux/pci.h |    1 +
> > >  2 files changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > > index 81f06e8..9f3e691 100644
> > > --- a/drivers/pci/pci.c
> > > +++ b/drivers/pci/pci.c
> > > @@ -3524,6 +3524,7 @@ int pci_probe_reset_function(struct pci_dev *dev)
> > >  {
> > >  	return pci_dev_reset(dev, 1);
> > >  }
> > > +EXPORT_SYMBOL_GPL(pci_probe_reset_function);
> > >  
> > >  /**
> > >   * pci_reset_function - quiesce and reset a PCI device function
> > > diff --git a/include/linux/pci.h b/include/linux/pci.h
> > > index 211e9da..233d1ae 100644
> > > --- a/include/linux/pci.h
> > > +++ b/include/linux/pci.h
> > > @@ -986,6 +986,7 @@ int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
> > >  			  enum pcie_link_width *width);
> > >  int __pci_reset_function(struct pci_dev *dev);
> > >  int __pci_reset_function_locked(struct pci_dev *dev);
> > > +int pci_probe_reset_function(struct pci_dev *dev);
> > >  int pci_reset_function(struct pci_dev *dev);
> > >  int pci_try_reset_function(struct pci_dev *dev);
> > >  int pci_probe_reset_slot(struct pci_slot *slot);
> > > 



--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 81f06e8..9f3e691 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3524,6 +3524,7 @@  int pci_probe_reset_function(struct pci_dev *dev)
 {
 	return pci_dev_reset(dev, 1);
 }
+EXPORT_SYMBOL_GPL(pci_probe_reset_function);
 
 /**
  * pci_reset_function - quiesce and reset a PCI device function
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 211e9da..233d1ae 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -986,6 +986,7 @@  int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
 			  enum pcie_link_width *width);
 int __pci_reset_function(struct pci_dev *dev);
 int __pci_reset_function_locked(struct pci_dev *dev);
+int pci_probe_reset_function(struct pci_dev *dev);
 int pci_reset_function(struct pci_dev *dev);
 int pci_try_reset_function(struct pci_dev *dev);
 int pci_probe_reset_slot(struct pci_slot *slot);