Commit ed5f606f authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by James Bottomley

[SCSI] mpt fusion: convert inactive_list_mutex to a mutex

the semaphore inactive_list_mutex is used as a mutex, convert it to
the mutex API
Signed-off-by: default avatarMatthias Kaehlcke <matthias@kaehlcke.net>
Acked-by: default avatar"Moore, Eric" <Eric.Moore@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 23a274c8
...@@ -2180,7 +2180,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) ...@@ -2180,7 +2180,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag)
/* /*
* Initalize link list for inactive raid volumes. * Initalize link list for inactive raid volumes.
*/ */
init_MUTEX(&ioc->raid_data.inactive_list_mutex); mutex_init(&ioc->raid_data.inactive_list_mutex);
INIT_LIST_HEAD(&ioc->raid_data.inactive_list); INIT_LIST_HEAD(&ioc->raid_data.inactive_list);
if (ioc->bus_type == SAS) { if (ioc->bus_type == SAS) {
...@@ -5166,13 +5166,13 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc) ...@@ -5166,13 +5166,13 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc)
if (list_empty(&ioc->raid_data.inactive_list)) if (list_empty(&ioc->raid_data.inactive_list))
return; return;
down(&ioc->raid_data.inactive_list_mutex); mutex_lock(&ioc->raid_data.inactive_list_mutex);
list_for_each_entry_safe(component_info, pNext, list_for_each_entry_safe(component_info, pNext,
&ioc->raid_data.inactive_list, list) { &ioc->raid_data.inactive_list, list) {
list_del(&component_info->list); list_del(&component_info->list);
kfree(component_info); kfree(component_info);
} }
up(&ioc->raid_data.inactive_list_mutex); mutex_unlock(&ioc->raid_data.inactive_list_mutex);
} }
/** /**
...@@ -5231,7 +5231,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) ...@@ -5231,7 +5231,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
if (!handle_inactive_volumes) if (!handle_inactive_volumes)
goto out; goto out;
down(&ioc->raid_data.inactive_list_mutex); mutex_lock(&ioc->raid_data.inactive_list_mutex);
for (i = 0; i < buffer->NumPhysDisks; i++) { for (i = 0; i < buffer->NumPhysDisks; i++) {
if(mpt_raid_phys_disk_pg0(ioc, if(mpt_raid_phys_disk_pg0(ioc,
buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0) buffer->PhysDisk[i].PhysDiskNum, &phys_disk) != 0)
...@@ -5251,7 +5251,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id) ...@@ -5251,7 +5251,7 @@ mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
list_add_tail(&component_info->list, list_add_tail(&component_info->list,
&ioc->raid_data.inactive_list); &ioc->raid_data.inactive_list);
} }
up(&ioc->raid_data.inactive_list_mutex); mutex_unlock(&ioc->raid_data.inactive_list_mutex);
out: out:
if (buffer) if (buffer)
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/mutex.h>
#include "lsi/mpi_type.h" #include "lsi/mpi_type.h"
#include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */ #include "lsi/mpi.h" /* Fusion MPI(nterface) basic defs */
...@@ -531,7 +532,7 @@ struct inactive_raid_component_info { ...@@ -531,7 +532,7 @@ struct inactive_raid_component_info {
typedef struct _RaidCfgData { typedef struct _RaidCfgData {
IOCPage2_t *pIocPg2; /* table of Raid Volumes */ IOCPage2_t *pIocPg2; /* table of Raid Volumes */
IOCPage3_t *pIocPg3; /* table of physical disks */ IOCPage3_t *pIocPg3; /* table of physical disks */
struct semaphore inactive_list_mutex; struct mutex inactive_list_mutex;
struct list_head inactive_list; /* link list for physical struct list_head inactive_list; /* link list for physical
disk that belong in disk that belong in
inactive volumes */ inactive volumes */
......
...@@ -2304,14 +2304,14 @@ mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id) ...@@ -2304,14 +2304,14 @@ mptscsih_is_phys_disk(MPT_ADAPTER *ioc, u8 channel, u8 id)
if (list_empty(&ioc->raid_data.inactive_list)) if (list_empty(&ioc->raid_data.inactive_list))
goto out; goto out;
down(&ioc->raid_data.inactive_list_mutex); mutex_lock(&ioc->raid_data.inactive_list_mutex);
list_for_each_entry(component_info, &ioc->raid_data.inactive_list, list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
list) { list) {
if ((component_info->d.PhysDiskID == id) && if ((component_info->d.PhysDiskID == id) &&
(component_info->d.PhysDiskBus == channel)) (component_info->d.PhysDiskBus == channel))
rc = 1; rc = 1;
} }
up(&ioc->raid_data.inactive_list_mutex); mutex_unlock(&ioc->raid_data.inactive_list_mutex);
out: out:
return rc; return rc;
...@@ -2341,14 +2341,14 @@ mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id) ...@@ -2341,14 +2341,14 @@ mptscsih_raid_id_to_num(MPT_ADAPTER *ioc, u8 channel, u8 id)
if (list_empty(&ioc->raid_data.inactive_list)) if (list_empty(&ioc->raid_data.inactive_list))
goto out; goto out;
down(&ioc->raid_data.inactive_list_mutex); mutex_lock(&ioc->raid_data.inactive_list_mutex);
list_for_each_entry(component_info, &ioc->raid_data.inactive_list, list_for_each_entry(component_info, &ioc->raid_data.inactive_list,
list) { list) {
if ((component_info->d.PhysDiskID == id) && if ((component_info->d.PhysDiskID == id) &&
(component_info->d.PhysDiskBus == channel)) (component_info->d.PhysDiskBus == channel))
rc = component_info->d.PhysDiskNum; rc = component_info->d.PhysDiskNum;
} }
up(&ioc->raid_data.inactive_list_mutex); mutex_unlock(&ioc->raid_data.inactive_list_mutex);
out: out:
return rc; return rc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment