Commit d5cdb672 authored by Satoru Takeuchi's avatar Satoru Takeuchi Committed by Greg Kroah-Hartman

acpiphp: disable bridges

Currently acpiphp calls pci_enable_device() against all
hot-added bridges, but acpiphp does not call pci_disable_device()
against them in hot-remove. So ioapic hot-remove would fail.
This patch fixes this issue.
Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: default avatarMUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: default avatarSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0dad3510
......@@ -1105,6 +1105,16 @@ static int enable_device(struct acpiphp_slot *slot)
return retval;
}
static void disable_bridges(struct pci_bus *bus)
{
struct pci_dev *dev;
list_for_each_entry(dev, &bus->devices, bus_list) {
if (dev->subordinate) {
disable_bridges(dev->subordinate);
pci_disable_device(dev);
}
}
}
/**
* disable_device - disable a slot
......@@ -1129,8 +1139,13 @@ static int disable_device(struct acpiphp_slot *slot)
func->bridge = NULL;
}
if (func->pci_dev)
if (func->pci_dev) {
pci_stop_bus_device(func->pci_dev);
if (func->pci_dev->subordinate) {
disable_bridges(func->pci_dev->subordinate);
pci_disable_device(func->pci_dev);
}
}
acpiphp_bus_trim(func->handle);
/* try to remove anyway.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment