linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pci_reset_function() being called from "bind" or "unbind"
@ 2012-01-04 18:43 Konrad Rzeszutek Wilk
  2012-01-04 19:04 ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 2+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-01-04 18:43 UTC (permalink / raw)
  To: jbarnes, linux-pci


I am looking at implementing the FLR functionality in the xen-pciback driver and
found a mutex issue I am not entirely sure how to resolve.

In essence I am trying to call pci_reset_function() when a PCI device is
"attached" (using "bind") to the xen-pciback driver.

This means that when a user does:

 echo "0000:01.07.0" > /sys/bus/pci/drivers/pciback/bind

we end up calling:
  driver_bind:
    device_lock(dev);
    pcistub_probe:
       pcistub_seize:
         pcistub_init_device:
           .. pci_enable_device()
           --> want also to do pci_reset_function(), which calls
                 pci_dev_reset(dev, 0):
			if (!0) {
				device_lock(dev) <==== DEADLOCK

           .. pci_disable_device()

So looking at the code I saw __pci_reset_function which I thought
would do the same as pci_reset_function but without locking.
However, it is actually the opposite - it is with the locking.

My thought is that one way to resolve this is by wrapping
pci_probe_reset_function with a EXPORT_SYMBOL_GPL and use that
instead. Or perhaps have a new function called
"pci_reset_function_locked" ?

Thoughts?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-01-04 19:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04 18:43 pci_reset_function() being called from "bind" or "unbind" Konrad Rzeszutek Wilk
2012-01-04 19:04 ` Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).