From 24d8bf1b0a12a92171c6f08a665c6ff3f0788c91 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Mon, 21 Apr 2014 15:43:08 -0400 Subject: xen/pciback: Document when the 'unbind' and 'bind' functions are called. And also mention that you cannot do any pci_reset_function, pci_reset_slot, or such calls. This is because they take the same lock as SysFS does - and we would end up with a dead-lock if we call those functions. Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: David Vrabel --- drivers/xen/xen-pciback/pci_stub.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/xen') diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index b84426a7f88d..1539becad139 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -493,6 +493,8 @@ static int pcistub_seize(struct pci_dev *dev) return err; } +/* Called when 'bind'. This means we must _NOT_ call pci_reset_function or + * other functions that take the sysfs lock. */ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id) { int err = 0; @@ -520,6 +522,8 @@ out: return err; } +/* Called when 'unbind'. This means we must _NOT_ call pci_reset_function or + * other functions that take the sysfs lock. */ static void pcistub_remove(struct pci_dev *dev) { struct pcistub_device *psdev, *found_psdev = NULL; -- cgit v1.2.3-59-g8ed1b