aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-03 18:40:25 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-05 11:40:57 -0500
commit661b40644190eb5987907584920cb11a4a2c7a9e (patch)
treec6534a78b498505fb627be27098618627de43630
parentb6708fbf98ac01d27c8d4d7f7b4fa87583b658cc (diff)
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: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com>
-rw-r--r--drivers/pci/hotplug/acpiphp.h1
-rw-r--r--drivers/pci/hotplug/acpiphp_glue.c23
2 files changed, 3 insertions, 21 deletions
diff --git a/drivers/pci/hotplug/acpiphp.h b/drivers/pci/hotplug/acpiphp.h
index 098ff425f850..373c7aa3b4a6 100644
--- a/drivers/pci/hotplug/acpiphp.h
+++ b/drivers/pci/hotplug/acpiphp.h
@@ -93,7 +93,6 @@ struct acpiphp_slot {
93 struct list_head funcs; /* one slot may have different 93 struct list_head funcs; /* one slot may have different
94 objects (i.e. for each function) */ 94 objects (i.e. for each function) */
95 struct slot *slot; 95 struct slot *slot;
96 struct mutex crit_sect;
97 96
98 u8 device; /* pci device# */ 97 u8 device; /* pci device# */
99 u32 flags; /* see below */ 98 u32 flags; /* see below */
diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c
index 27abd501c258..0961911c706e 100644
--- a/drivers/pci/hotplug/acpiphp_glue.c
+++ b/drivers/pci/hotplug/acpiphp_glue.c
@@ -347,7 +347,6 @@ static acpi_status register_slot(acpi_handle handle, u32 lvl, void *data,
347 slot->bus = bridge->pci_bus; 347 slot->bus = bridge->pci_bus;
348 slot->device = device; 348 slot->device = device;
349 INIT_LIST_HEAD(&slot->funcs); 349 INIT_LIST_HEAD(&slot->funcs);
350 mutex_init(&slot->crit_sect);
351 350
352 list_add_tail(&slot->node, &bridge->slots); 351 list_add_tail(&slot->node, &bridge->slots);
353 352
@@ -744,7 +743,6 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
744 struct pci_bus *bus = slot->bus; 743 struct pci_bus *bus = slot->bus;
745 struct pci_dev *dev, *tmp; 744 struct pci_dev *dev, *tmp;
746 745
747 mutex_lock(&slot->crit_sect);
748 if (slot_no_hotplug(slot)) { 746 if (slot_no_hotplug(slot)) {
749 ; /* do nothing */ 747 ; /* do nothing */
750 } else if (get_slot_status(slot) == ACPI_STA_ALL) { 748 } else if (get_slot_status(slot) == ACPI_STA_ALL) {
@@ -759,7 +757,6 @@ static void acpiphp_check_bridge(struct acpiphp_bridge *bridge)
759 } else { 757 } else {
760 disable_slot(slot); 758 disable_slot(slot);
761 } 759 }
762 mutex_unlock(&slot->crit_sect);
763 } 760 }
764} 761}
765 762
@@ -846,12 +843,8 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
846 } else { 843 } else {
847 struct acpiphp_slot *slot = func->slot; 844 struct acpiphp_slot *slot = func->slot;
848 845
849 if (slot->flags & SLOT_IS_GOING_AWAY) 846 if (!(slot->flags & SLOT_IS_GOING_AWAY))
850 break; 847 enable_slot(slot);
851
852 mutex_lock(&slot->crit_sect);
853 enable_slot(slot);
854 mutex_unlock(&slot->crit_sect);
855 } 848 }
856 break; 849 break;
857 850
@@ -862,7 +855,6 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
862 acpiphp_check_bridge(bridge); 855 acpiphp_check_bridge(bridge);
863 } else { 856 } else {
864 struct acpiphp_slot *slot = func->slot; 857 struct acpiphp_slot *slot = func->slot;
865 int ret;
866 858
867 if (slot->flags & SLOT_IS_GOING_AWAY) 859 if (slot->flags & SLOT_IS_GOING_AWAY)
868 break; 860 break;
@@ -871,10 +863,7 @@ static void hotplug_event(acpi_handle handle, u32 type, void *data)
871 * Check if anything has changed in the slot and rescan 863 * Check if anything has changed in the slot and rescan
872 * from the parent if that's the case. 864 * from the parent if that's the case.
873 */ 865 */
874 mutex_lock(&slot->crit_sect); 866 if (acpiphp_rescan_slot(slot))
875 ret = acpiphp_rescan_slot(slot);
876 mutex_unlock(&slot->crit_sect);
877 if (ret)
878 acpiphp_check_bridge(func->parent); 867 acpiphp_check_bridge(func->parent);
879 } 868 }
880 break; 869 break;
@@ -1088,13 +1077,10 @@ int acpiphp_enable_slot(struct acpiphp_slot *slot)
1088 if (slot->flags & SLOT_IS_GOING_AWAY) 1077 if (slot->flags & SLOT_IS_GOING_AWAY)
1089 return -ENODEV; 1078 return -ENODEV;
1090 1079
1091 mutex_lock(&slot->crit_sect);
1092 /* configure all functions */ 1080 /* configure all functions */
1093 if (!(slot->flags & SLOT_ENABLED)) 1081 if (!(slot->flags & SLOT_ENABLED))
1094 enable_slot(slot); 1082 enable_slot(slot);
1095 1083
1096 mutex_unlock(&slot->crit_sect);
1097
1098 pci_unlock_rescan_remove(); 1084 pci_unlock_rescan_remove();
1099 return 0; 1085 return 0;
1100} 1086}
@@ -1110,8 +1096,6 @@ static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot)
1110 if (slot->flags & SLOT_IS_GOING_AWAY) 1096 if (slot->flags & SLOT_IS_GOING_AWAY)
1111 return -ENODEV; 1097 return -ENODEV;
1112 1098
1113 mutex_lock(&slot->crit_sect);
1114
1115 /* unconfigure all functions */ 1099 /* unconfigure all functions */
1116 disable_slot(slot); 1100 disable_slot(slot);
1117 1101
@@ -1125,7 +1109,6 @@ static int acpiphp_disable_and_eject_slot(struct acpiphp_slot *slot)
1125 break; 1109 break;
1126 } 1110 }
1127 1111
1128 mutex_unlock(&slot->crit_sect);
1129 return 0; 1112 return 0;
1130} 1113}
1131 1114