aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYijing Wang <wangyijing@huawei.com>2014-02-11 19:36:51 -0500
committerBjorn Helgaas <bhelgaas@google.com>2014-02-14 12:13:56 -0500
commit50277c8b06d56f2345e1a0693db46db29fc6d063 (patch)
tree8593272fd1307dbcd6b0d1f675eec3b12e85b1f4
parent50b52fdee050745935d92e7026373edea2647e60 (diff)
PCI: pciehp: Don't turn slot off when hot-added device already exists
If we found device already exists during hot add device, we should leave it, not turn the slot off. Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r--drivers/pci/hotplug/pciehp_ctrl.c3
-rw-r--r--drivers/pci/hotplug/pciehp_pci.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c
index fec99a164d93..b4a4ac150e61 100644
--- a/drivers/pci/hotplug/pciehp_ctrl.c
+++ b/drivers/pci/hotplug/pciehp_ctrl.c
@@ -233,7 +233,8 @@ static int board_added(struct slot *p_slot)
233 if (retval) { 233 if (retval) {
234 ctrl_err(ctrl, "Cannot add device at %04x:%02x:00\n", 234 ctrl_err(ctrl, "Cannot add device at %04x:%02x:00\n",
235 pci_domain_nr(parent), parent->number); 235 pci_domain_nr(parent), parent->number);
236 goto err_exit; 236 if (retval != -EEXIST)
237 goto err_exit;
237 } 238 }
238 239
239 pciehp_green_led_on(p_slot); 240 pciehp_green_led_on(p_slot);
diff --git a/drivers/pci/hotplug/pciehp_pci.c b/drivers/pci/hotplug/pciehp_pci.c
index b07d7cc2d697..1b533060ce65 100644
--- a/drivers/pci/hotplug/pciehp_pci.c
+++ b/drivers/pci/hotplug/pciehp_pci.c
@@ -50,7 +50,7 @@ int pciehp_configure_device(struct slot *p_slot)
50 "at %04x:%02x:00, cannot hot-add\n", pci_name(dev), 50 "at %04x:%02x:00, cannot hot-add\n", pci_name(dev),
51 pci_domain_nr(parent), parent->number); 51 pci_domain_nr(parent), parent->number);
52 pci_dev_put(dev); 52 pci_dev_put(dev);
53 ret = -EINVAL; 53 ret = -EEXIST;
54 goto out; 54 goto out;
55 } 55 }
56 56