diff options
author | Alex Chiang <achiang@hp.com> | 2008-09-05 17:05:03 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2008-09-09 14:44:06 -0400 |
commit | 48902025af4da44dbbc0231061e542d6d40e712e (patch) | |
tree | 76560726e8345829b20cf4f604de8456336ba9cb /drivers/pci/hotplug/fakephp.c | |
parent | 53bc88701be91e7f631ad31418b32392aa952e9b (diff) |
PCI Hotplug: fakephp: fix deadlock... again
Commit fe99740cac117f208707488c03f3789cf4904957 (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>
Diffstat (limited to 'drivers/pci/hotplug/fakephp.c')
-rw-r--r-- | drivers/pci/hotplug/fakephp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c index 40337a06c18a..146ca9cd1567 100644 --- a/drivers/pci/hotplug/fakephp.c +++ b/drivers/pci/hotplug/fakephp.c | |||
@@ -320,15 +320,15 @@ static int disable_slot(struct hotplug_slot *slot) | |||
320 | return -ENODEV; | 320 | return -ENODEV; |
321 | } | 321 | } |
322 | 322 | ||
323 | /* remove the device from the pci core */ | ||
324 | pci_remove_bus_device(dev); | ||
325 | |||
323 | /* queue work item to blow away this sysfs entry and other | 326 | /* queue work item to blow away this sysfs entry and other |
324 | * parts. | 327 | * parts. |
325 | */ | 328 | */ |
326 | INIT_WORK(&dslot->remove_work, remove_slot_worker); | 329 | INIT_WORK(&dslot->remove_work, remove_slot_worker); |
327 | queue_work(dummyphp_wq, &dslot->remove_work); | 330 | queue_work(dummyphp_wq, &dslot->remove_work); |
328 | 331 | ||
329 | /* blow away this sysfs entry and other parts. */ | ||
330 | remove_slot(dslot); | ||
331 | |||
332 | pci_dev_put(dev); | 332 | pci_dev_put(dev); |
333 | } | 333 | } |
334 | return 0; | 334 | return 0; |