diff options
Diffstat (limited to 'drivers/message/fusion')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 10 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 3 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 8 |
3 files changed, 11 insertions, 10 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 6ee5876d0524..a34ddc7bce80 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -2180,7 +2180,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) | |||
2180 | /* | 2180 | /* |
2181 | * Initalize link list for inactive raid volumes. | 2181 | * Initalize link list for inactive raid volumes. |
2182 | */ | 2182 | */ |
2183 | init_MUTEX(&ioc->raid_data.inactive_list_mutex); | 2183 | mutex_init(&ioc->raid_data.inactive_list_mutex); |
2184 | INIT_LIST_HEAD(&ioc->raid_data.inactive_list); | 2184 | INIT_LIST_HEAD(&ioc->raid_data.inactive_list); |
2185 | 2185 | ||
2186 | if (ioc->bus_type == SAS) { | 2186 | if (ioc->bus_type == SAS) { |
@@ -5166,13 +5166,13 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc) | |||
5166 | if (list_empty(&ioc->raid_data.inactive_list)) | 5166 | if (list_empty(&ioc->raid_data.inactive_list)) |
5167 | return; | 5167 | return; |
5168 | 5168 | ||
5169 | down(&ioc->raid_data.inactive_list_mutex); | 5169 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
5170 | list_for_each_entry_safe(component_info, pNext, | 5170 | list_for_each_entry_safe(component_info, pNext, |
5171 | &ioc->raid_data.inactive_list, list) { | 5171 | &ioc->raid_data.inactive_list, list) { |
5172 | list_del(&component_info->list); | 5172 | list_del(&component_info->list); |
5173 | kfree(component_info); | 5173 | kfree(component_info); |
5174 | } | 5174 | } |
5175 | up(&ioc->raid_data.inactive_list_mutex); | 5175 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
5176 | } | 5176 | } |
5177 | 5177 | ||
5178 | /** | 5178 | /** |
@@ -5231,7 +5231,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
5231 | if (!handle_inactive_volumes) | 5231 | if (!handle_inactive_volumes) |
5232 | goto out; | 5232 | goto out; |
5233 | 5233 | ||
5234 | down(&ioc->raid_data.inactive_list_mutex); | 5234 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
5235 | for (i = 0; i < buffer->NumPhysDisks; i++) { | 5235 | for (i = 0; i < buffer->NumPhysDisks; i++) { |
5236 | if(mpt_raid_phys_disk_pg0(ioc, | 5236 | if(mpt_raid_phys_disk_pg0(ioc, |
5237 | buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) | 5237 | buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) |
@@ -5251,7 +5251,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
5251 | list_add_tail(&component_info->list, | 5251 | list_add_tail(&component_info->list, |
5252 | &ioc->raid_data.inactive_list); | 5252 | &ioc->raid_data.inactive_list); |
5253 | } | 5253 | } |
5254 | up(&ioc->raid_data.inactive_list_mutex); | 5254 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
5255 | 5255 | ||
5256 | out: | 5256 | out: |
5257 | if (buffer) | 5257 | if (buffer) |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index 50c0c173e24e..0041ab3e5e80 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -51,6 +51,7 @@ | |||
51 | 51 | ||
52 | #include <linux/kernel.h> | 52 | #include <linux/kernel.h> |
53 | #include <linux/pci.h> | 53 | #include <linux/pci.h> |
54 | #include <linux/mutex.h> | ||
54 | 55 | ||
55 | #include "lsi/mpi_type.h" | 56 | #include "lsi/mpi_type.h" |
56 | #include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */ | 57 | #include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */ |
@@ -531,7 +532,7 @@ struct inactive_raid_component_info { | |||
531 | typedef struct _RaidCfgData { | 532 | typedef struct _RaidCfgData { |
532 | IOCPage2_t *pIocPg2; /* table of Raid Volumes */ | 533 | IOCPage2_t *pIocPg2; /* table of Raid Volumes */ |
533 | IOCPage3_t *pIocPg3; /* table of physical disks */ | 534 | IOCPage3_t *pIocPg3; /* table of physical disks */ |
534 | struct semaphore inactive_list_mutex; | 535 | struct mutex inactive_list_mutex; |
535 | struct list_head inactive_list; /* link list for physical | 536 | struct list_head inactive_list; /* link list for physical |
536 | disk that belong in | 537 | disk that belong in |
537 | inactive volumes */ | 538 | inactive volumes */ |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index c207bda6723b..89c63147a15d 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -2304,14 +2304,14 @@ mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
2304 | if (list_empty(&ioc->raid_data.inactive_list)) | 2304 | if (list_empty(&ioc->raid_data.inactive_list)) |
2305 | goto out; | 2305 | goto out; |
2306 | 2306 | ||
2307 | down(&ioc->raid_data.inactive_list_mutex); | 2307 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
2308 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, | 2308 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, |
2309 | list) { | 2309 | list) { |
2310 | if ((component_info->d.PhysDiskID == id) && | 2310 | if ((component_info->d.PhysDiskID == id) && |
2311 | (component_info->d.PhysDiskBus == channel)) | 2311 | (component_info->d.PhysDiskBus == channel)) |
2312 | rc = 1; | 2312 | rc = 1; |
2313 | } | 2313 | } |
2314 | up(&ioc->raid_data.inactive_list_mutex); | 2314 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
2315 | 2315 | ||
2316 | out: | 2316 | out: |
2317 | return rc; | 2317 | return rc; |
@@ -2341,14 +2341,14 @@ mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id) | |||
2341 | if (list_empty(&ioc->raid_data.inactive_list)) | 2341 | if (list_empty(&ioc->raid_data.inactive_list)) |
2342 | goto out; | 2342 | goto out; |
2343 | 2343 | ||
2344 | down(&ioc->raid_data.inactive_list_mutex); | 2344 | mutex_lock(&ioc->raid_data.inactive_list_mutex); |
2345 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, | 2345 | list_for_each_entry(component_info, &ioc->raid_data.inactive_list, |
2346 | list) { | 2346 | list) { |
2347 | if ((component_info->d.PhysDiskID == id) && | 2347 | if ((component_info->d.PhysDiskID == id) && |
2348 | (component_info->d.PhysDiskBus == channel)) | 2348 | (component_info->d.PhysDiskBus == channel)) |
2349 | rc = component_info->d.PhysDiskNum; | 2349 | rc = component_info->d.PhysDiskNum; |
2350 | } | 2350 | } |
2351 | up(&ioc->raid_data.inactive_list_mutex); | 2351 | mutex_unlock(&ioc->raid_data.inactive_list_mutex); |
2352 | 2352 | ||
2353 | out: | 2353 | out: |
2354 | return rc; | 2354 | return rc; |