Skip to content

Commit

Permalink
xen/pciback: Document when the 'unbind' and 'bind' functions are called.
Browse files Browse the repository at this point in the history
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 <konrad.wilk@oracle.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
  • Loading branch information
Konrad Rzeszutek Wilk committed May 23, 2014
1 parent 8be9df6 commit 24d8bf1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/xen/xen-pciback/pci_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -520,6 +522,8 @@ static int pcistub_probe(struct pci_dev *dev, const struct pci_device_id *id)
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;
Expand Down

0 comments on commit 24d8bf1

Please sign in to comment.