Commit 8b0dc866dd9b8d10a53cb3537385a51b7ee54b62
Committed by
Len Brown
1 parent
c1b707d253
Exists in
master
and in
7 other branches
ACPI: dock: use mutex instead of spinlock
http://bugzilla.kernel.org/show_bug.cgi?id=7303 Use a mutex instead of a spinlock for locking the hotplug list because we need to call into the ACPI subsystem which might sleep. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Showing 1 changed file with 8 additions and 8 deletions Side-by-side Diff
drivers/acpi/dock.c
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | unsigned long last_dock_time; |
45 | 45 | u32 flags; |
46 | 46 | spinlock_t dd_lock; |
47 | - spinlock_t hp_lock; | |
47 | + struct mutex hp_lock; | |
48 | 48 | struct list_head dependent_devices; |
49 | 49 | struct list_head hotplug_devices; |
50 | 50 | }; |
51 | 51 | |
... | ... | @@ -114,9 +114,9 @@ |
114 | 114 | dock_add_hotplug_device(struct dock_station *ds, |
115 | 115 | struct dock_dependent_device *dd) |
116 | 116 | { |
117 | - spin_lock(&ds->hp_lock); | |
117 | + mutex_lock(&ds->hp_lock); | |
118 | 118 | list_add_tail(&dd->hotplug_list, &ds->hotplug_devices); |
119 | - spin_unlock(&ds->hp_lock); | |
119 | + mutex_unlock(&ds->hp_lock); | |
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
123 | 123 | |
... | ... | @@ -130,9 +130,9 @@ |
130 | 130 | dock_del_hotplug_device(struct dock_station *ds, |
131 | 131 | struct dock_dependent_device *dd) |
132 | 132 | { |
133 | - spin_lock(&ds->hp_lock); | |
133 | + mutex_lock(&ds->hp_lock); | |
134 | 134 | list_del(&dd->hotplug_list); |
135 | - spin_unlock(&ds->hp_lock); | |
135 | + mutex_unlock(&ds->hp_lock); | |
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
... | ... | @@ -295,7 +295,7 @@ |
295 | 295 | { |
296 | 296 | struct dock_dependent_device *dd; |
297 | 297 | |
298 | - spin_lock(&ds->hp_lock); | |
298 | + mutex_lock(&ds->hp_lock); | |
299 | 299 | |
300 | 300 | /* |
301 | 301 | * First call driver specific hotplug functions |
... | ... | @@ -317,7 +317,7 @@ |
317 | 317 | else |
318 | 318 | dock_create_acpi_device(dd->handle); |
319 | 319 | } |
320 | - spin_unlock(&ds->hp_lock); | |
320 | + mutex_unlock(&ds->hp_lock); | |
321 | 321 | } |
322 | 322 | |
323 | 323 | static void dock_event(struct dock_station *ds, u32 event, int num) |
... | ... | @@ -625,7 +625,7 @@ |
625 | 625 | INIT_LIST_HEAD(&dock_station->dependent_devices); |
626 | 626 | INIT_LIST_HEAD(&dock_station->hotplug_devices); |
627 | 627 | spin_lock_init(&dock_station->dd_lock); |
628 | - spin_lock_init(&dock_station->hp_lock); | |
628 | + mutex_init(&dock_station->hp_lock); | |
629 | 629 | ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); |
630 | 630 | |
631 | 631 | /* Find dependent devices */ |