pm8001_hwi.c uldd_task - missing spin_lockirqsave?
The file drivers/scsi/pm8001/pm8001_hwi.c contains the piece of code below, at the end of mpi_sata_completion() and mpi_sata_event(), which appears wrong. While the test is opposite, the executed branch does exactly the same. I believe one of the branches should spin_lockirqsave instead? not 100% sure how to fix this.
Roel
} else if (t->uldd_task) {
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/* ditto */
spin_unlock_irq(&pm8001_ha->lock);
t->task_done(t);
spin_lock_irq(&pm8001_ha->lock);
} else if (!t->uldd_task) {
spin_unlock_irqrestore(&t->task_state_lock, flags);
pm8001_ccb_task_free(pm8001_ha, t, ccb, tag);
mb();/*ditto*/
spin_unlock_irq(&pm8001_ha->lock);
t->task_done(t);
spin_lock_irq(&pm8001_ha->lock);
}Quoted 2 lines
The file
drivers/scsi/pm8001/pm8001_hwi.ccontains the piece of code
below,
Quoted 2 lines
at
the end ofmpi_sata_completion()andmpi_sata_event(), which appears
wrong.
Quoted 1 line
While the test is opposite, the executed branch does exactly the same. I
believe
Quoted 1 line
one of the branches should
spin_lockirqsaveinstead? not 100% sure how to
fix
Quoted 19 lines
this.
Roel
} else if (t->uldd_task) { spin_unlock_irqrestore(&t->task_state_lock, flags); pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); mb();/* ditto */ spin_unlock_irq(&pm8001_ha->lock); t->task_done(t); spin_lock_irq(&pm8001_ha->lock); } else if (!t->uldd_task) { spin_unlock_irqrestore(&t->task_state_lock, flags); pm8001_ccb_task_free(pm8001_ha, t, ccb, tag); mb();/*ditto*/ spin_unlock_irq(&pm8001_ha->lock); t->task_done(t); spin_lock_irq(&pm8001_ha->lock); }
Quoted 1 line
--
[Jack Wang] Current mainline code all task->uldd_task is not null, so we can remove the below branch. Not sure why you said should use spin_lock_irqsave.