diff options
author | Kristen Carlson Accardi <kristen.c.accardi@intel.com> | 2007-08-09 19:09:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 18:03:14 -0400 |
commit | 1cf53d5ddb93b77ce1e277da85fe695e4c2a667d (patch) | |
tree | c7db79ee80550c66f7bdc3cf4c9111bbff577a93 /drivers/pci/hotplug | |
parent | 89913bf77a60fdb6ff204a670d3e191848a7b2c8 (diff) |
PCI Hotplug: pciehp: Dont check bridge control on remove
When removing a device with a bridge on it, only read the
bridge control register if the adapter is actually present.
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r-- | drivers/pci/hotplug/pciehp_pci.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c index 854aaea09e4d..8f2b25c49f84 100644 --- a/drivers/pci/hotplug/pciehp_pci.c +++ b/drivers/pci/hotplug/pciehp_pci.c | |||
@@ -243,9 +243,10 @@ int pciehp_configure_device(struct slot *p_slot) | |||
243 | 243 | ||
244 | int pciehp_unconfigure_device(struct slot *p_slot) | 244 | int pciehp_unconfigure_device(struct slot *p_slot) |
245 | { | 245 | { |
246 | int rc = 0; | 246 | int ret, rc = 0; |
247 | int j; | 247 | int j; |
248 | u8 bctl = 0; | 248 | u8 bctl = 0; |
249 | u8 presence = 0; | ||
249 | struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; | 250 | struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; |
250 | 251 | ||
251 | dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus, | 252 | dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus, |
@@ -263,12 +264,17 @@ int pciehp_unconfigure_device(struct slot *p_slot) | |||
263 | continue; | 264 | continue; |
264 | } | 265 | } |
265 | if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { | 266 | if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { |
266 | pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl); | 267 | ret = p_slot->hpc_ops->get_adapter_status(p_slot, |
267 | if (bctl & PCI_BRIDGE_CTL_VGA) { | 268 | &presence); |
268 | err("Cannot remove display device %s\n", | 269 | if (!ret && presence) { |
270 | pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, | ||
271 | &bctl); | ||
272 | if (bctl & PCI_BRIDGE_CTL_VGA) { | ||
273 | err("Cannot remove display device %s\n", | ||
269 | pci_name(temp)); | 274 | pci_name(temp)); |
270 | pci_dev_put(temp); | 275 | pci_dev_put(temp); |
271 | continue; | 276 | continue; |
277 | } | ||
272 | } | 278 | } |
273 | } | 279 | } |
274 | pci_remove_bus_device(temp); | 280 | pci_remove_bus_device(temp); |