Commit 661b4064 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

ACPI / hotplug / PCI: Drop crit_sect locking

After recent PCI core changes related to the rescan/remove locking,
the code sections under crit_sect mutexes from ACPIPHP slot objects
are always executed under the general PCI rescan/remove lock.
For this reason, the crit_sect mutexes are simply redundant, so drop
them.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
parent b6708fbf
...@@ -93,7 +93,6 @@ struct acpiphp_slot { ...@@ -93,7 +93,6 @@ struct acpiphp_slot {
struct list_head funcs; /* one slot may have different struct list_head funcs; /* one slot may have different
objects (i.e. for each function) */ objects (i.e. for each function) */
struct slot *slot; struct slot *slot;
struct mutex crit_sect;
u8 device; /* pci device# */ u8 device; /* pci device# */
u32 flags; /* see below */ u32 flags; /* see below */
......
...@@ -347,7 +347,6 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data, ...@@ -347,7 +347,6 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
slot->bus = bridge->pci_bus; slot->bus = bridge->pci_bus;
slot->device = device; slot->device = device;
INIT_LIST_HEAD(&slot->funcs); INIT_LIST_HEAD(&slot->funcs);
mutex_init(&slot->crit_sect);
list_add_tail(&slot->node, &bridge->slots); list_add_tail(&slot->node, &bridge->slots);
...@@ -744,7 +743,6 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) ...@@ -744,7 +743,6 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
struct pci_bus *bus = slot->bus; struct pci_bus *bus = slot->bus;
struct pci_dev *dev, *tmp; struct pci_dev *dev, *tmp;
mutex_lock(&slot->crit_sect);
if (slot_no_hotplug(slot)) { if (slot_no_hotplug(slot)) {
; /* do nothing */ ; /* do nothing */
} else if (get_slot_status(slot) == ACPI_STA_ALL) { } else if (get_slot_status(slot) == ACPI_STA_ALL) {
...@@ -759,7 +757,6 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge) ...@@ -759,7 +757,6 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
} else { } else {
disable_slot(slot); disable_slot(slot);
} }
mutex_unlock(&slot->crit_sect);
} }
} }
...@@ -846,12 +843,8 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data) ...@@ -846,12 +843,8 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
} else { } else {
struct acpiphp_slot *slot = func->slot; struct acpiphp_slot *slot = func->slot;
if (slot->flags & SLOT_IS_GOING_AWAY) if (!(slot->flags & SLOT_IS_GOING_AWAY))
break; enable_slot(slot);
mutex_lock(&slot->crit_sect);
enable_slot(slot);
mutex_unlock(&slot->crit_sect);
} }
break; break;
...@@ -862,7 +855,6 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data) ...@@ -862,7 +855,6 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
acpiphp_check_bridge(bridge); acpiphp_check_bridge(bridge);
} else { } else {
struct acpiphp_slot *slot = func->slot; struct acpiphp_slot *slot = func->slot;
int ret;
if (slot->flags & SLOT_IS_GOING_AWAY) if (slot->flags & SLOT_IS_GOING_AWAY)
break; break;
...@@ -871,10 +863,7 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data) ...@@ -871,10 +863,7 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
* Check if anything has changed in the slot and rescan * Check if anything has changed in the slot and rescan
* from the parent if that's the case. * from the parent if that's the case.
*/ */
mutex_lock(&slot->crit_sect); if (acpiphp_rescan_slot(slot))
ret = acpiphp_rescan_slot(slot);
mutex_unlock(&slot->crit_sect);
if (ret)
acpiphp_check_bridge(func->parent); acpiphp_check_bridge(func->parent);
} }
break; break;
...@@ -1088,13 +1077,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot) ...@@ -1088,13 +1077,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
if (slot->flags & SLOT_IS_GOING_AWAY) if (slot->flags & SLOT_IS_GOING_AWAY)
return -ENODEV; return -ENODEV;
mutex_lock(&slot->crit_sect);
/* configure all functions */ /* configure all functions */
if (!(slot->flags & SLOT_ENABLED)) if (!(slot->flags & SLOT_ENABLED))
enable_slot(slot); enable_slot(slot);
mutex_unlock(&slot->crit_sect);
pci_unlock_rescan_remove(); pci_unlock_rescan_remove();
return 0; return 0;
} }
...@@ -1110,8 +1096,6 @@ static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) ...@@ -1110,8 +1096,6 @@ static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot)
if (slot->flags & SLOT_IS_GOING_AWAY) if (slot->flags & SLOT_IS_GOING_AWAY)
return -ENODEV; return -ENODEV;
mutex_lock(&slot->crit_sect);
/* unconfigure all functions */ /* unconfigure all functions */
disable_slot(slot); disable_slot(slot);
...@@ -1125,7 +1109,6 @@ static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot) ...@@ -1125,7 +1109,6 @@ static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot)
break; break;
} }
mutex_unlock(&slot->crit_sect);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment