aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_sas.h
diff options
context:
space:
mode:
authorYang, Bo <Bo.Yang@lsi.com>2009-10-06 16:47:35 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-10-29 13:03:21 -0400
commit0c79e681eef10810a5ed41a2eb1dce244ab1c37d (patch)
treec6b389d9acafd043ddbc5b8ea159f1ee1d4fc899 /drivers/scsi/megaraid/megaraid_sas.h
parentf4c9a1317d32bb0af7546ef0c1dcc3be52dc8d0a (diff)
[SCSI] megaraid_sas: Fix the fix for fw hang caused by megaraid sas application
Add a lock to the skinny firmware initialisation sequence to prevent the two stage write being non atomic if multiple instances use it. Add a flag to the driver shutdown sequence to prevent aen ioctls being called after shutdown begins. Signed-off-by Bo Yang<bo.yang@lsi.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_sas.h')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index a1fd44bc1817..13ac37e80075 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -1157,17 +1157,6 @@ struct megasas_evt_detail {
1157 1157
1158} __attribute__ ((packed)); 1158} __attribute__ ((packed));
1159 1159
1160 struct megasas_instance_template {
1161 void (*fire_cmd)(dma_addr_t ,u32 ,struct megasas_register_set __iomem *);
1162
1163 void (*enable_intr)(struct megasas_register_set __iomem *) ;
1164 void (*disable_intr)(struct megasas_register_set __iomem *);
1165
1166 int (*clear_intr)(struct megasas_register_set __iomem *);
1167
1168 u32 (*read_fw_status_reg)(struct megasas_register_set __iomem *);
1169 };
1170
1171struct megasas_instance { 1160struct megasas_instance {
1172 1161
1173 u32 *producer; 1162 u32 *producer;
@@ -1193,6 +1182,8 @@ struct megasas_instance {
1193 spinlock_t cmd_pool_lock; 1182 spinlock_t cmd_pool_lock;
1194 /* used to synch producer, consumer ptrs in dpc */ 1183 /* used to synch producer, consumer ptrs in dpc */
1195 spinlock_t completion_lock; 1184 spinlock_t completion_lock;
1185 /* used to sync fire the cmd to fw */
1186 spinlock_t fire_lock;
1196 struct dma_pool *frame_dma_pool; 1187 struct dma_pool *frame_dma_pool;
1197 struct dma_pool *sense_dma_pool; 1188 struct dma_pool *sense_dma_pool;
1198 1189
@@ -1224,6 +1215,18 @@ struct megasas_instance {
1224 struct timer_list io_completion_timer; 1215 struct timer_list io_completion_timer;
1225}; 1216};
1226 1217
1218struct megasas_instance_template {
1219 void (*fire_cmd)(struct megasas_instance *, dma_addr_t, \
1220 u32, struct megasas_register_set __iomem *);
1221
1222 void (*enable_intr)(struct megasas_register_set __iomem *) ;
1223 void (*disable_intr)(struct megasas_register_set __iomem *);
1224
1225 int (*clear_intr)(struct megasas_register_set __iomem *);
1226
1227 u32 (*read_fw_status_reg)(struct megasas_register_set __iomem *);
1228};
1229
1227#define MEGASAS_IS_LOGICAL(scp) \ 1230#define MEGASAS_IS_LOGICAL(scp) \
1228 (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1 1231 (scp->device->channel < MEGASAS_MAX_PD_CHANNELS) ? 0 : 1
1229 1232