aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSantosh Nayak <santoshprasadnayak@gmail.com>2012-03-09 03:13:38 -0500
committerJames Bottomley <JBottomley@Parallels.com>2012-03-28 03:58:09 -0400
commitb08c1856b4d4295040ec72f15427588087369220 (patch)
tree54e826e81447826233cd73c0bffddb5d2dc2094f /drivers
parenta93107355d2d4557e7e19ea1724bdb710268cd34 (diff)
[SCSI] pm8001: Use spin_lock_irqsave() for task_state.
Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com> Acked-by: Jack Wang <jack_wang@usish.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/pm8001/pm8001_hwi.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 5022bf7af3c8..8477df4958cd 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -2093,6 +2093,7 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
2093 struct ata_task_resp *resp ; 2093 struct ata_task_resp *resp ;
2094 u32 *sata_resp; 2094 u32 *sata_resp;
2095 struct pm8001_device *pm8001_dev; 2095 struct pm8001_device *pm8001_dev;
2096 unsigned long flags;
2096 2097
2097 psataPayload = (struct sata_completion_resp *)(piomb + 4); 2098 psataPayload = (struct sata_completion_resp *)(piomb + 4);
2098 status = le32_to_cpu(psataPayload->status); 2099 status = le32_to_cpu(psataPayload->status);
@@ -2382,26 +2383,26 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
2382 ts->stat = SAS_DEV_NO_RESPONSE; 2383 ts->stat = SAS_DEV_NO_RESPONSE;
2383 break; 2384 break;
2384 } 2385 }
2385 spin_lock_irq(&t->task_state_lock); 2386 spin_lock_irqsave(&t->task_state_lock, flags);
2386 t->task_state_flags &= ~SAS_TASK_STATE_PENDING; 2387 t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
2387 t->task_state_flags &= ~SAS_TASK_AT_INITIATOR; 2388 t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
2388 t->task_state_flags |= SAS_TASK_STATE_DONE; 2389 t->task_state_flags |= SAS_TASK_STATE_DONE;
2389 if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) { 2390 if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
2390 spin_unlock_irq(&t->task_state_lock); 2391 spin_unlock_irqrestore(&t->task_state_lock, flags);
2391 PM8001_FAIL_DBG(pm8001_ha, 2392 PM8001_FAIL_DBG(pm8001_ha,
2392 pm8001_printk("task 0x%p done with io_status 0x%x" 2393 pm8001_printk("task 0x%p done with io_status 0x%x"
2393 " resp 0x%x stat 0x%x but aborted by upper layer!\n", 2394 " resp 0x%x stat 0x%x but aborted by upper layer!\n",
2394 t, status, ts->resp, ts->stat)); 2395 t, status, ts->resp, ts->stat));
2395 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); 2396 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
2396 } else if (t->uldd_task) { 2397 } else if (t->uldd_task) {
2397 spin_unlock_irq(&t->task_state_lock); 2398 spin_unlock_irqrestore(&t->task_state_lock, flags);
2398 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); 2399 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
2399 mb();/* ditto */ 2400 mb();/* ditto */
2400 spin_unlock_irq(&pm8001_ha->lock); 2401 spin_unlock_irq(&pm8001_ha->lock);
2401 t->task_done(t); 2402 t->task_done(t);
2402 spin_lock_irq(&pm8001_ha->lock); 2403 spin_lock_irq(&pm8001_ha->lock);
2403 } else if (!t->uldd_task) { 2404 } else if (!t->uldd_task) {
2404 spin_unlock_irq(&t->task_state_lock); 2405 spin_unlock_irqrestore(&t->task_state_lock, flags);
2405 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); 2406 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
2406 mb();/*ditto*/ 2407 mb();/*ditto*/
2407 spin_unlock_irq(&pm8001_ha->lock); 2408 spin_unlock_irq(&pm8001_ha->lock);
@@ -2423,6 +2424,7 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha , void *piomb)
2423 u32 tag = le32_to_cpu(psataPayload->tag); 2424 u32 tag = le32_to_cpu(psataPayload->tag);
2424 u32 port_id = le32_to_cpu(psataPayload->port_id); 2425 u32 port_id = le32_to_cpu(psataPayload->port_id);
2425 u32 dev_id = le32_to_cpu(psataPayload->device_id); 2426 u32 dev_id = le32_to_cpu(psataPayload->device_id);
2427 unsigned long flags;
2426 2428
2427 ccb = &pm8001_ha->ccb_info[tag]; 2429 ccb = &pm8001_ha->ccb_info[tag];
2428 t = ccb->task; 2430 t = ccb->task;
@@ -2593,26 +2595,26 @@ static void mpi_sata_event(struct pm8001_hba_info *pm8001_ha , void *piomb)
2593 ts->stat = SAS_OPEN_TO; 2595 ts->stat = SAS_OPEN_TO;
2594 break; 2596 break;
2595 } 2597 }
2596 spin_lock_irq(&t->task_state_lock); 2598 spin_lock_irqsave(&t->task_state_lock, flags);
2597 t->task_state_flags &= ~SAS_TASK_STATE_PENDING; 2599 t->task_state_flags &= ~SAS_TASK_STATE_PENDING;
2598 t->task_state_flags &= ~SAS_TASK_AT_INITIATOR; 2600 t->task_state_flags &= ~SAS_TASK_AT_INITIATOR;
2599 t->task_state_flags |= SAS_TASK_STATE_DONE; 2601 t->task_state_flags |= SAS_TASK_STATE_DONE;
2600 if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) { 2602 if (unlikely((t->task_state_flags & SAS_TASK_STATE_ABORTED))) {
2601 spin_unlock_irq(&t->task_state_lock); 2603 spin_unlock_irqrestore(&t->task_state_lock, flags);
2602 PM8001_FAIL_DBG(pm8001_ha, 2604 PM8001_FAIL_DBG(pm8001_ha,
2603 pm8001_printk("task 0x%p done with io_status 0x%x" 2605 pm8001_printk("task 0x%p done with io_status 0x%x"
2604 " resp 0x%x stat 0x%x but aborted by upper layer!\n", 2606 " resp 0x%x stat 0x%x but aborted by upper layer!\n",
2605 t, event, ts->resp, ts->stat)); 2607 t, event, ts->resp, ts->stat));
2606 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); 2608 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
2607 } else if (t->uldd_task) { 2609 } else if (t->uldd_task) {
2608 spin_unlock_irq(&t->task_state_lock); 2610 spin_unlock_irqrestore(&t->task_state_lock, flags);
2609 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); 2611 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
2610 mb();/* ditto */ 2612 mb();/* ditto */
2611 spin_unlock_irq(&pm8001_ha->lock); 2613 spin_unlock_irq(&pm8001_ha->lock);
2612 t->task_done(t); 2614 t->task_done(t);
2613 spin_lock_irq(&pm8001_ha->lock); 2615 spin_lock_irq(&pm8001_ha->lock);
2614 } else if (!t->uldd_task) { 2616 } else if (!t->uldd_task) {
2615 spin_unlock_irq(&t->task_state_lock); 2617 spin_unlock_irqrestore(&t->task_state_lock, flags);
2616 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); 2618 pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
2617 mb();/*ditto*/ 2619 mb();/*ditto*/
2618 spin_unlock_irq(&pm8001_ha->lock); 2620 spin_unlock_irq(&pm8001_ha->lock);