diff options
author | David Fries <david@fries.net> | 2008-10-16 01:04:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:49 -0400 |
commit | c30c9b15187e977ab5928f7276e9dfcd8d6f9460 (patch) | |
tree | d36d7513c5acf1d39f581625ffa5c1915ae5627f /drivers/w1/masters | |
parent | dd78c9439fc1e031835bccb934d27b978c72c536 (diff) |
W1: fix deadlocks and remove w1_control_thread
w1_control_thread was removed which would wake up every second and process
newly registered family codes and complete some final cleanup for a
removed master. Those routines were moved to the threads that were
previously requesting those operations. A new function
w1_reconnect_slaves takes care of reconnecting existing slave devices when
a new family code is registered or removed. The removal case was missing
and would cause a deadlock waiting for the family code reference count to
decrease, which will now happen. A problem with registering a family code
was fixed. A slave device would be unattached if it wasn't yet claimed,
then attached at the end of the list, two unclaimed slaves would cause an
infinite loop.
The struct w1_bus_master.search now takes a pointer to the struct
w1_master device to avoid searching for it, which would have caused a
lock ordering deadlock with the removal of w1_control_thread.
Signed-off-by: David Fries <david@fries.net>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/w1/masters')
-rw-r--r-- | drivers/w1/masters/ds1wm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c index 10211e493001..ea894bf18113 100644 --- a/drivers/w1/masters/ds1wm.c +++ b/drivers/w1/masters/ds1wm.c | |||
@@ -274,8 +274,8 @@ static u8 ds1wm_reset_bus(void *data) | |||
274 | return 0; | 274 | return 0; |
275 | } | 275 | } |
276 | 276 | ||
277 | static void ds1wm_search(void *data, u8 search_type, | 277 | static void ds1wm_search(void *data, struct w1_master *master_dev, |
278 | w1_slave_found_callback slave_found) | 278 | u8 search_type, w1_slave_found_callback slave_found) |
279 | { | 279 | { |
280 | struct ds1wm_data *ds1wm_data = data; | 280 | struct ds1wm_data *ds1wm_data = data; |
281 | int i; | 281 | int i; |
@@ -313,7 +313,7 @@ static void ds1wm_search(void *data, u8 search_type, | |||
313 | ds1wm_write_register(ds1wm_data, DS1WM_CMD, ~DS1WM_CMD_SRA); | 313 | ds1wm_write_register(ds1wm_data, DS1WM_CMD, ~DS1WM_CMD_SRA); |
314 | ds1wm_reset(ds1wm_data); | 314 | ds1wm_reset(ds1wm_data); |
315 | 315 | ||
316 | slave_found(ds1wm_data, rom_id); | 316 | slave_found(master_dev, rom_id); |
317 | } | 317 | } |
318 | 318 | ||
319 | /* --------------------------------------------------------------------- */ | 319 | /* --------------------------------------------------------------------- */ |