Skip to content

Commit

Permalink
acpiphp: disable bridges
Browse files Browse the repository at this point in the history
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: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Satoru Takeuchi authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent 0dad351 commit d5cdb67
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit d5cdb67

Please sign in to comment.