Commit 1cf53d5d authored by Kristen Carlson Accardi's avatar Kristen Carlson Accardi Committed by Greg Kroah-Hartman

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: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 89913bf7
...@@ -243,9 +243,10 @@ int pciehp_configure_device(struct slot *p_slot) ...@@ -243,9 +243,10 @@ int pciehp_configure_device(struct slot *p_slot)
int pciehp_unconfigure_device(struct slot *p_slot) int pciehp_unconfigure_device(struct slot *p_slot)
{ {
int rc = 0; int ret, rc = 0;
int j; int j;
u8 bctl = 0; u8 bctl = 0;
u8 presence = 0;
struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate; struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus, dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus,
...@@ -263,7 +264,11 @@ int pciehp_unconfigure_device(struct slot *p_slot) ...@@ -263,7 +264,11 @@ int pciehp_unconfigure_device(struct slot *p_slot)
continue; continue;
} }
if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) { if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl); ret = p_slot->hpc_ops->get_adapter_status(p_slot,
&presence);
if (!ret && presence) {
pci_read_config_byte(temp, PCI_BRIDGE_CONTROL,
&bctl);
if (bctl & PCI_BRIDGE_CTL_VGA) { if (bctl & PCI_BRIDGE_CTL_VGA) {
err("Cannot remove display device %s\n", err("Cannot remove display device %s\n",
pci_name(temp)); pci_name(temp));
...@@ -271,6 +276,7 @@ int pciehp_unconfigure_device(struct slot *p_slot) ...@@ -271,6 +276,7 @@ int pciehp_unconfigure_device(struct slot *p_slot)
continue; continue;
} }
} }
}
pci_remove_bus_device(temp); pci_remove_bus_device(temp);
pci_dev_put(temp); pci_dev_put(temp);
} }
......
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