aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_mbx.c
diff options
context:
space:
mode:
authorSeokmann Ju <seokmann.ju@qlogic.com>2007-01-29 13:22:30 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-01-31 12:15:09 -0500
commit03c79cc56e4497cbd09d74a73c1bd0d1d9a8a16c (patch)
treef6cb0b9880e1c513cdbfbb4b161e9ea040c007a6 /drivers/scsi/qla2xxx/qla_mbx.c
parent7c98a046b76a3a858c21b75235bf146493b76e11 (diff)
[SCSI] qla2xxx: Remove unnecessary spinlock primitive - mbx_reg_lock.
Since, mailbox commands are executed in a synchronous manner, there is no need to have a separate spinlock primitive to protect data/register access shared by callers. Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_mbx.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index c52bd9ca8d7a..c6f0cdf4cdc4 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -55,7 +55,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
55 uint16_t __iomem *optr; 55 uint16_t __iomem *optr;
56 uint32_t cnt; 56 uint32_t cnt;
57 uint32_t mboxes; 57 uint32_t mboxes;
58 unsigned long mbx_flags = 0;
59 unsigned long wait_time; 58 unsigned long wait_time;
60 59
61 rval = QLA_SUCCESS; 60 rval = QLA_SUCCESS;
@@ -81,10 +80,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
81 /* Save mailbox command for debug */ 80 /* Save mailbox command for debug */
82 ha->mcp = mcp; 81 ha->mcp = mcp;
83 82
84 /* Try to get mailbox register access */
85 if (!abort_active)
86 spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
87
88 DEBUG11(printk("scsi(%ld): prepare to issue mbox cmd=0x%x.\n", 83 DEBUG11(printk("scsi(%ld): prepare to issue mbox cmd=0x%x.\n",
89 ha->host_no, mcp->mb[0])); 84 ha->host_no, mcp->mb[0]));
90 85
@@ -161,9 +156,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
161 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT); 156 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT);
162 spin_unlock_irqrestore(&ha->hardware_lock, flags); 157 spin_unlock_irqrestore(&ha->hardware_lock, flags);
163 158
164 if (!abort_active)
165 spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
166
167 /* Wait for either the timer to expire 159 /* Wait for either the timer to expire
168 * or the mbox completion interrupt 160 * or the mbox completion interrupt
169 */ 161 */
@@ -184,8 +176,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
184 else 176 else
185 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT); 177 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT);
186 spin_unlock_irqrestore(&ha->hardware_lock, flags); 178 spin_unlock_irqrestore(&ha->hardware_lock, flags);
187 if (!abort_active)
188 spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
189 179
190 wait_time = jiffies + mcp->tov * HZ; /* wait at most tov secs */ 180 wait_time = jiffies + mcp->tov * HZ; /* wait at most tov secs */
191 while (!ha->flags.mbox_int) { 181 while (!ha->flags.mbox_int) {
@@ -201,9 +191,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
201 } /* while */ 191 } /* while */
202 } 192 }
203 193
204 if (!abort_active)
205 spin_lock_irqsave(&ha->mbx_reg_lock, mbx_flags);
206
207 /* Check whether we timed out */ 194 /* Check whether we timed out */
208 if (ha->flags.mbox_int) { 195 if (ha->flags.mbox_int) {
209 uint16_t *iptr2; 196 uint16_t *iptr2;
@@ -256,9 +243,6 @@ qla2x00_mailbox_command(scsi_qla_host_t *ha, mbx_cmd_t *mcp)
256 rval = QLA_FUNCTION_TIMEOUT; 243 rval = QLA_FUNCTION_TIMEOUT;
257 } 244 }
258 245
259 if (!abort_active)
260 spin_unlock_irqrestore(&ha->mbx_reg_lock, mbx_flags);
261
262 ha->flags.mbox_busy = 0; 246 ha->flags.mbox_busy = 0;
263 247
264 /* Clean up */ 248 /* Clean up */