Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1cf53d5ddb93b77ce1e277da85fe695e4c2a667d
Commit:     1cf53d5ddb93b77ce1e277da85fe695e4c2a667d
Parent:     89913bf77a60fdb6ff204a670d3e191848a7b2c8
Author:     Kristen Carlson Accardi <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 9 16:09:31 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Fri Oct 12 15:03:14 2007 -0700

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 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 854aaea..8f2b25c 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)
 
 int pciehp_unconfigure_device(struct slot *p_slot)
 {
-       int rc = 0;
+       int ret, rc = 0;
        int j;
        u8 bctl = 0;
+       u8 presence = 0;
        struct pci_bus *parent = p_slot->ctrl->pci_dev->subordinate;
 
        dbg("%s: bus/dev = %x/%x\n", __FUNCTION__, p_slot->bus,
@@ -263,12 +264,17 @@ int pciehp_unconfigure_device(struct slot *p_slot)
                        continue;
                }
                if (temp->hdr_type == PCI_HEADER_TYPE_BRIDGE) {
-                       pci_read_config_byte(temp, PCI_BRIDGE_CONTROL, &bctl);
-                       if (bctl & PCI_BRIDGE_CTL_VGA) {
-                               err("Cannot remove display device %s\n",
+                       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) {
+                                       err("Cannot remove display device %s\n",
                                                pci_name(temp));
-                               pci_dev_put(temp);
-                               continue;
+                                       pci_dev_put(temp);
+                                       continue;
+                               }
                        }
                }
                pci_remove_bus_device(temp);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to