From cf417e5494582453c033d8cac9e1352e74215435 Mon Sep 17 00:00:00 2001 From: Jay Fenlason Date: Fri, 3 Oct 2008 11:19:09 -0400 Subject: 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 Update fill_bus_reset_event() accordingly. Include linux/spinlock.h. Signed-off-by: Stefan Richter --- drivers/firewire/fw-device.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/firewire/fw-device.h') 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 @@ #include #include #include +#include #include enum fw_device_state { @@ -64,6 +65,8 @@ struct fw_device { bool cmc; struct fw_card *card; struct device device; + /* to prevent deadlocks, never take this lock with card->lock held */ + spinlock_t client_list_lock; struct list_head client_list; u32 *config_rom; size_t config_rom_length; -- cgit v1.2.2