Skip to content

Commit

Permalink
PCI Hotplug: fakephp: fix deadlock... again
Browse files Browse the repository at this point in the history
Commit fe99740 (construct one
fakephp slot per PCI slot) introduced a regression, causing a
deadlock when removing a PCI device.

We also never actually removed the device from the PCI core.

So we:

	- remove the device from the PCI core
	- do not directly call remove_slot() to prevent deadlock

Yu Zhao reported and diagnosed this defect.

Signed-off-by: Alex Chiang <achiang@hp.com>
Acked-by: Yu Zhao <yu.zhao@intel.com>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
  • Loading branch information
Alex Chiang authored and jbarnes993 committed Sep 9, 2008
1 parent 53bc887 commit 4890202
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pci/hotplug/fakephp.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,15 +320,15 @@ static int disable_slot(struct hotplug_slot *slot)
return -ENODEV;
}

/* remove the device from the pci core */
pci_remove_bus_device(dev);

/* queue work item to blow away this sysfs entry and other
* parts.
*/
INIT_WORK(&dslot->remove_work, remove_slot_worker);
queue_work(dummyphp_wq, &dslot->remove_work);

/* blow away this sysfs entry and other parts. */
remove_slot(dslot);

pci_dev_put(dev);
}
return 0;
Expand Down

0 comments on commit 4890202

Please sign in to comment.