Skip to contentSkip to conversation

libata-sff: fix ata_sff_post_internal_cmd()

PATCH Applied Tejun Heo 2 participants 2 messages Oct 20, 2008 – Oct 23, 2008 libata

lore
Share & tools
lore

Tejun Heo

author
#0 lore raw

PATCH 1/1 libata-sff: fix ata_sff_post_internal_cmd()

ata_sff_post_internal_cmd() needs to grab port lock before calling ata_bmdma_stop() and also need to clear hsm_task_state. Fix it.

---
 drivers/ata/libata-sff.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/ata/libata-sff.c +10 -1
Index: work/drivers/ata/libata-sff.c
===================================================================
@@ -2153,8 +2153,17 @@ void ata_sff_error_handler(struct ata_po
  */
 void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc)
 {
-	if (qc->ap->ioaddr.bmdma_addr)
+	struct ata_port *ap = qc->ap;
+	unsigned long flags;
+
+	spin_lock_irqsave(ap->lock, flags);
+
+	ap->hsm_task_state = HSM_ST_IDLE;
+
+	if (ap->ioaddr.bmdma_addr)
 		ata_bmdma_stop(qc);
+
+	spin_unlock_irqrestore(ap->lock, flags);
 }
 
 /**
Applied
#1 lore raw
Quoted 7 lines · Tejun Heo

ata_sff_post_internal_cmd() needs to grab port lock before calling ata_bmdma_stop() and also need to clear hsm_task_state. Fix it.

---
 drivers/ata/libata-sff.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

applied