aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/megaraid/mega_common.h1
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c6
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.h4
3 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/megaraid/mega_common.h b/drivers/scsi/megaraid/mega_common.h
index 26e1e6c55654..fef9ac958754 100644
--- a/drivers/scsi/megaraid/mega_common.h
+++ b/drivers/scsi/megaraid/mega_common.h
@@ -21,6 +21,7 @@
21#include <linux/types.h> 21#include <linux/types.h>
22#include <linux/pci.h> 22#include <linux/pci.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/mutex.h>
24#include <linux/interrupt.h> 25#include <linux/interrupt.h>
25#include <linux/delay.h> 26#include <linux/delay.h>
26#include <linux/blkdev.h> 27#include <linux/blkdev.h>
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 7d5a4d651b03..c46685a03a9f 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -3880,7 +3880,7 @@ megaraid_sysfs_alloc_resources(adapter_t *adapter)
3880 megaraid_sysfs_free_resources(adapter); 3880 megaraid_sysfs_free_resources(adapter);
3881 } 3881 }
3882 3882
3883 sema_init(&raid_dev->sysfs_sem, 1); 3883 mutex_init(&raid_dev->sysfs_mtx);
3884 3884
3885 init_waitqueue_head(&raid_dev->sysfs_wait_q); 3885 init_waitqueue_head(&raid_dev->sysfs_wait_q);
3886 3886
@@ -3981,7 +3981,7 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter)
3981 /* 3981 /*
3982 * Allow only one read at a time to go through the sysfs attributes 3982 * Allow only one read at a time to go through the sysfs attributes
3983 */ 3983 */
3984 down(&raid_dev->sysfs_sem); 3984 mutex_lock(&raid_dev->sysfs_mtx);
3985 3985
3986 uioc = raid_dev->sysfs_uioc; 3986 uioc = raid_dev->sysfs_uioc;
3987 mbox64 = raid_dev->sysfs_mbox64; 3987 mbox64 = raid_dev->sysfs_mbox64;
@@ -4057,7 +4057,7 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter)
4057 4057
4058 del_timer_sync(timerp); 4058 del_timer_sync(timerp);
4059 4059
4060 up(&raid_dev->sysfs_sem); 4060 mutex_unlock(&raid_dev->sysfs_mtx);
4061 4061
4062 return rval; 4062 return rval;
4063} 4063}
diff --git a/drivers/scsi/megaraid/megaraid_mbox.h b/drivers/scsi/megaraid/megaraid_mbox.h
index 9de803cebd4b..626459d1e902 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.h
+++ b/drivers/scsi/megaraid/megaraid_mbox.h
@@ -168,7 +168,7 @@ typedef struct {
168 * @hw_error : set if FW not responding 168 * @hw_error : set if FW not responding
169 * @fast_load : If set, skip physical device scanning 169 * @fast_load : If set, skip physical device scanning
170 * @channel_class : channel class, RAID or SCSI 170 * @channel_class : channel class, RAID or SCSI
171 * @sysfs_sem : semaphore to serialize access to sysfs res. 171 * @sysfs_mtx : mutex to serialize access to sysfs res.
172 * @sysfs_uioc : management packet to issue FW calls from sysfs 172 * @sysfs_uioc : management packet to issue FW calls from sysfs
173 * @sysfs_mbox64 : mailbox packet to issue FW calls from sysfs 173 * @sysfs_mbox64 : mailbox packet to issue FW calls from sysfs
174 * @sysfs_buffer : data buffer for FW commands issued from sysfs 174 * @sysfs_buffer : data buffer for FW commands issued from sysfs
@@ -208,7 +208,7 @@ typedef struct {
208 int hw_error; 208 int hw_error;
209 int fast_load; 209 int fast_load;
210 uint8_t channel_class; 210 uint8_t channel_class;
211 struct semaphore sysfs_sem; 211 struct mutex sysfs_mtx;
212 uioc_t *sysfs_uioc; 212 uioc_t *sysfs_uioc;
213 mbox64_t *sysfs_mbox64; 213 mbox64_t *sysfs_mbox64;
214 caddr_t sysfs_buffer; 214 caddr_t sysfs_buffer;