Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Yijing Wang and committed by
Bjorn Helgaas
50277c8b 50b52fde

+3 -2
+2 -1
drivers/pci/hotplug/pciehp_ctrl.c
··· 233 233 if (retval) { 234 234 ctrl_err(ctrl, "Cannot add device at %04x:%02x:00\n", 235 235 pci_domain_nr(parent), parent->number); 236 - goto err_exit; 236 + if (retval != -EEXIST) 237 + goto err_exit; 237 238 } 238 239 239 240 pciehp_green_led_on(p_slot);
+1 -1
drivers/pci/hotplug/pciehp_pci.c
··· 50 50 "at %04x:%02x:00, cannot hot-add\n", pci_name(dev), 51 51 pci_domain_nr(parent), parent->number); 52 52 pci_dev_put(dev); 53 - ret = -EINVAL; 53 + ret = -EEXIST; 54 54 goto out; 55 55 } 56 56