Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55502ddb authored by Kirill A. Shutemov's avatar Kirill A. Shutemov Committed by Rafael J. Wysocki
Browse files

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: default avatarKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent bc805a55
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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 */
	if (!(slot->flags & SLOT_ENABLED))
		retval = enable_device(slot);

	mutex_unlock(&slot->crit_sect);
	return retval;
}