* re: [SCSI] pm8001: Fix for sata io circular lock dependency.
@ 2011-10-05 6:25 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2011-10-05 6:25 UTC (permalink / raw)
To: jack wang, James Bottomley; +Cc: linux-scsi
The locking in 9e79e12554d "[SCSI] pm8001: Fix for sata io circular
lock dependency." is wrong. We should revert this patch.
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index a3de306..68695b7 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -1901,7 +1901,7 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
{
struct sas_task *t;
struct pm8001_ccb_info *ccb;
- unsigned long flags;
+ unsigned long flags = 0;
u32 param;
u32 status;
u32 tag;
@@ -2040,7 +2040,9 @@ mpi_sata_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
ts->stat = SAS_QUEUE_FULL;
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/*in order to force CPU ordering*/
+ spin_unlock_irqrestore(&pm8001_ha->lock, flags);
t->task_done(t);
+ spin_lock_irqsave(&pm8001_ha->lock, flags);
return;
}
break;
We can't just call spin_unlock_irqrestore(&pm8001_ha->lock, 0);
It makes no sense to call spin_lock_irqsave() and then return
immediately. We could call spin_lock_irq() if we don't plan to
restore the state of flags.
regards,
dan carpenter
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-05 6:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-05 6:25 [SCSI] pm8001: Fix for sata io circular lock dependency Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox