aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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
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')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h2
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c16
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c16
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c8
4 files changed, 0 insertions, 42 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 2a59faa632df..e83e4a34725a 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2338,8 +2338,6 @@ typedef struct scsi_qla_host {
2338#define MBX_INTR_WAIT 2 2338#define MBX_INTR_WAIT 2
2339#define MBX_UPDATE_FLASH_ACTIVE 3 2339#define MBX_UPDATE_FLASH_ACTIVE 3
2340 2340
2341 spinlock_t mbx_reg_lock; /* Mbx Cmd Register Lock */
2342
2343 struct semaphore mbx_cmd_sem; /* Serialialize mbx access */ 2341 struct semaphore mbx_cmd_sem; /* Serialialize mbx access */
2344 struct semaphore mbx_intr_sem; /* Used for completion notification */ 2342 struct semaphore mbx_intr_sem; /* Used for completion notification */
2345 2343
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index df69dc016a53..c948a8ce7232 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -86,12 +86,8 @@ qla2100_intr_handler(int irq, void *dev_id)
86 86
87 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 87 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
88 (status & MBX_INTERRUPT) && ha->flags.mbox_int) { 88 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
89 spin_lock_irqsave(&ha->mbx_reg_lock, flags);
90
91 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 89 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
92 up(&ha->mbx_intr_sem); 90 up(&ha->mbx_intr_sem);
93
94 spin_unlock_irqrestore(&ha->mbx_reg_lock, flags);
95 } 91 }
96 92
97 return (IRQ_HANDLED); 93 return (IRQ_HANDLED);
@@ -197,12 +193,8 @@ qla2300_intr_handler(int irq, void *dev_id)
197 193
198 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 194 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
199 (status & MBX_INTERRUPT) && ha->flags.mbox_int) { 195 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
200 spin_lock_irqsave(&ha->mbx_reg_lock, flags);
201
202 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 196 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
203 up(&ha->mbx_intr_sem); 197 up(&ha->mbx_intr_sem);
204
205 spin_unlock_irqrestore(&ha->mbx_reg_lock, flags);
206 } 198 }
207 199
208 return (IRQ_HANDLED); 200 return (IRQ_HANDLED);
@@ -1491,12 +1483,8 @@ qla24xx_intr_handler(int irq, void *dev_id)
1491 1483
1492 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 1484 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
1493 (status & MBX_INTERRUPT) && ha->flags.mbox_int) { 1485 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
1494 spin_lock_irqsave(&ha->mbx_reg_lock, flags);
1495
1496 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 1486 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
1497 up(&ha->mbx_intr_sem); 1487 up(&ha->mbx_intr_sem);
1498
1499 spin_unlock_irqrestore(&ha->mbx_reg_lock, flags);
1500 } 1488 }
1501 1489
1502 return IRQ_HANDLED; 1490 return IRQ_HANDLED;
@@ -1629,12 +1617,8 @@ qla24xx_msix_default(int irq, void *dev_id)
1629 1617
1630 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && 1618 if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) &&
1631 (status & MBX_INTERRUPT) && ha->flags.mbox_int) { 1619 (status & MBX_INTERRUPT) && ha->flags.mbox_int) {
1632 spin_lock_irqsave(&ha->mbx_reg_lock, flags);
1633
1634 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags); 1620 set_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
1635 up(&ha->mbx_intr_sem); 1621 up(&ha->mbx_intr_sem);
1636
1637 spin_unlock_irqrestore(&ha->mbx_reg_lock, flags);
1638 } 1622 }
1639 1623
1640 return IRQ_HANDLED; 1624 return IRQ_HANDLED;
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 */
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index d35ff4a2a764..6f161d3f661b 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1563,14 +1563,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
1563 INIT_LIST_HEAD(&ha->list); 1563 INIT_LIST_HEAD(&ha->list);
1564 INIT_LIST_HEAD(&ha->fcports); 1564 INIT_LIST_HEAD(&ha->fcports);
1565 1565
1566 /*
1567 * These locks are used to prevent more than one CPU
1568 * from modifying the queue at the same time. The
1569 * higher level "host_lock" will reduce most
1570 * contention for these locks.
1571 */
1572 spin_lock_init(&ha->mbx_reg_lock);
1573
1574 qla2x00_config_dma_addressing(ha); 1566 qla2x00_config_dma_addressing(ha);
1575 if (qla2x00_mem_alloc(ha)) { 1567 if (qla2x00_mem_alloc(ha)) {
1576 qla_printk(KERN_WARNING, ha, 1568 qla_printk(KERN_WARNING, ha,