diff options
author | Jay Fenlason <fenlason@redhat.com> | 2008-10-03 11:19:09 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-03-24 15:56:36 -0400 |
commit | cf417e5494582453c033d8cac9e1352e74215435 (patch) | |
tree | a1681ef863c8c4219506e16b7982e51dc0718387 /drivers/firewire/fw-device.h | |
parent | 1aa292bb1c53500e3ab570b955d03afa97a9404d (diff) |
firewire: add a client_list_lock
This adds a client_list_lock, which only protects the device's
client_list, so that future versions of the driver can call code that
takes the card->lock while holding the client_list_lock. Adding this
lock is much simpler than adding __ versions of all the functions that
the future version may need. The one ordering issue is to make sure
code never takes the client_list_lock with card->lock held. Since
client_list_lock is only used in three places, that isn't hard.
Signed-off-by: Jay Fenlason <fenlason@redhat.com>
Update fill_bus_reset_event() accordingly. Include linux/spinlock.h.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-device.h')
-rw-r--r-- | drivers/firewire/fw-device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h index 8ef6ec2ca21c..008a7908a865 100644 --- a/drivers/firewire/fw-device.h +++ b/drivers/firewire/fw-device.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/cdev.h> | 23 | #include <linux/cdev.h> |
24 | #include <linux/idr.h> | 24 | #include <linux/idr.h> |
25 | #include <linux/rwsem.h> | 25 | #include <linux/rwsem.h> |
26 | #include <linux/spinlock.h> | ||
26 | #include <asm/atomic.h> | 27 | #include <asm/atomic.h> |
27 | 28 | ||
28 | enum fw_device_state { | 29 | enum fw_device_state { |
@@ -64,6 +65,8 @@ struct fw_device { | |||
64 | bool cmc; | 65 | bool cmc; |
65 | struct fw_card *card; | 66 | struct fw_card *card; |
66 | struct device device; | 67 | struct device device; |
68 | /* to prevent deadlocks, never take this lock with card->lock held */ | ||
69 | spinlock_t client_list_lock; | ||
67 | struct list_head client_list; | 70 | struct list_head client_list; |
68 | u32 *config_rom; | 71 | u32 *config_rom; |
69 | size_t config_rom_length; | 72 | size_t config_rom_length; |