Skip to contentSkip to conversation

pm8001_hwi.c uldd_task - missing spin_lockirqsave?

DISCUSSION roel kluin 2 participants 2 messages Sep 17, 2012 SCSI

lore
Share & tools
lore

roel kluin

author
#0 lore raw

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);
	}
#1 lore raw
Quoted 2 lines

The file drivers/scsi/pm8001/pm8001_hwi.c contains the piece of code

below,

Quoted 2 lines

at
the end of mpi_sata_completion() and mpi_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_lockirqsave instead? 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.