pm8001: Fix for sata io circular lock dependency.
Subsystems (2)
The locking in 9e79e12554d "[SCSI] pm8001: Fix for sata io circular lock dependency." is wrong. We should revert this patch.
drivers/scsi/pm8001/pm8001_hwi.c +3 -1
@@ -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