pci_reset_function() being called from "bind" or "unbind"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux