summaryrefslogtreecommitdiff
path: root/drivers/pci/hotplug
diff options
context:
space:
mode:
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>2013-07-14 01:27:26 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-23 06:00:26 +0400
commit55502ddb2d83ada0661733361ec14b9cbef157a5 (patch)
treeb67ac3c49fc57a4d76d848f81166bfe936c820fb /drivers/pci/hotplug
parentbc805a55392a7cb3e9b1251d00449c70e3967fc5 (diff)
downloadlinux-55502ddb2d83ada0661733361ec14b9cbef157a5.tar.xz
ACPI / hotplug / PCI: Do not check SLOT_ENABLED in enable_device()
With Thunderbolt you can daisy chain devices: connect new devices to an already plugged one. In that case the "hotplug slot" is already enabled, but we still want to look for new PCI devices behind it. Reuse enable_device() to scan for new PCI devices on enabled slots and push the SLOT_ENABLED check up into acpiphp_enable_slot(). [rjw: Rebased, modified the changelog] Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/pci/hotplug')
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index b6691cc8230b..c7a668e1fc12 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -545,9 +545,6 @@ static int __ref enable_device(struct acpiphp_slot *slot)
int num, max, pass;
LIST_HEAD(add_list);
- if (slot->flags & SLOT_ENABLED)
- goto err_exit;
-
list_for_each_entry(func, &slot->funcs, sibling)
acpiphp_bus_add(func_to_handle(func));
@@ -1024,11 +1021,14 @@ void acpiphp_remove_slots(struct pci_bus *bus)
*/
int acpiphp_enable_slot(struct acpiphp_slot *slot)
{
- int retval;
+ int retval = 0;
mutex_lock(&slot->crit_sect);
+
/* configure all functions */
- retval = enable_device(slot);
+ if (!(slot->flags & SLOT_ENABLED))
+ retval = enable_device(slot);
+
mutex_unlock(&slot->crit_sect);
return retval;
}