diff options
| author | Kristen Carlson Accardi <kristen.c.accardi@intel.com> | 2006-10-30 14:18:45 -0500 |
|---|---|---|
| committer | Len Brown <len.brown@intel.com> | 2006-10-30 15:12:40 -0500 |
| commit | 8b0dc866dd9b8d10a53cb3537385a51b7ee54b62 (patch) | |
| tree | 85c77ff74fba34ff67865ec2f819b6253e044e2e /drivers | |
| parent | c1b707d253fe918b92882cff1dbd926b47e14fd2 (diff) | |
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>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/acpi/dock.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 578b99b71d9c..c7df2a1ea9d7 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
| @@ -44,7 +44,7 @@ struct dock_station { | |||
| 44 | unsigned long last_dock_time; | 44 | unsigned long last_dock_time; |
| 45 | u32 flags; | 45 | u32 flags; |
| 46 | spinlock_t dd_lock; | 46 | spinlock_t dd_lock; |
| 47 | spinlock_t hp_lock; | 47 | struct mutex hp_lock; |
| 48 | struct list_head dependent_devices; | 48 | struct list_head dependent_devices; |
| 49 | struct list_head hotplug_devices; | 49 | struct list_head hotplug_devices; |
| 50 | }; | 50 | }; |
| @@ -114,9 +114,9 @@ static void | |||
| 114 | dock_add_hotplug_device(struct dock_station *ds, | 114 | dock_add_hotplug_device(struct dock_station *ds, |
| 115 | struct dock_dependent_device *dd) | 115 | struct dock_dependent_device *dd) |
| 116 | { | 116 | { |
| 117 | spin_lock(&ds->hp_lock); | 117 | mutex_lock(&ds->hp_lock); |
| 118 | list_add_tail(&dd->hotplug_list, &ds->hotplug_devices); | 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 | /** |
| @@ -130,9 +130,9 @@ static void | |||
| 130 | dock_del_hotplug_device(struct dock_station *ds, | 130 | dock_del_hotplug_device(struct dock_station *ds, |
| 131 | struct dock_dependent_device *dd) | 131 | struct dock_dependent_device *dd) |
| 132 | { | 132 | { |
| 133 | spin_lock(&ds->hp_lock); | 133 | mutex_lock(&ds->hp_lock); |
| 134 | list_del(&dd->hotplug_list); | 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 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event) | |||
| 295 | { | 295 | { |
| 296 | struct dock_dependent_device *dd; | 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 | * First call driver specific hotplug functions | 301 | * First call driver specific hotplug functions |
| @@ -317,7 +317,7 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event) | |||
| 317 | else | 317 | else |
| 318 | dock_create_acpi_device(dd->handle); | 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 | static void dock_event(struct dock_station *ds, u32 event, int num) | 323 | static void dock_event(struct dock_station *ds, u32 event, int num) |
| @@ -625,7 +625,7 @@ static int dock_add(acpi_handle handle) | |||
| 625 | INIT_LIST_HEAD(&dock_station->dependent_devices); | 625 | INIT_LIST_HEAD(&dock_station->dependent_devices); |
| 626 | INIT_LIST_HEAD(&dock_station->hotplug_devices); | 626 | INIT_LIST_HEAD(&dock_station->hotplug_devices); |
| 627 | spin_lock_init(&dock_station->dd_lock); | 627 | spin_lock_init(&dock_station->dd_lock); |
| 628 | spin_lock_init(&dock_station->hp_lock); | 628 | mutex_init(&dock_station->hp_lock); |
| 629 | ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); | 629 | ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); |
| 630 | 630 | ||
| 631 | /* Find dependent devices */ | 631 | /* Find dependent devices */ |
