Skip to contentSkip to conversation

pata-bf54x: Set ATAPI host state machine to control IDE device terminate sequence.

PATCH Applied Bryan Wu 3 participants 3 messages May 12, 2008 – May 19, 2008 libata

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

PATCH 1/1 pata-bf54x: Set ATAPI host state machine to control IDE device terminate sequence.

From: Sonic Zhang <[email protected]>

Set ATAPI host state machine to control IDE device terminate sequence. Some IDE harddisk may assert terminate sequence in the middle of a formal DMA transaction and resume later. Bit DETECT_TERM in ATAPI_CTRL register determines whether the ATAPI host state machine or the kernel driver should take care of this case.

---
 drivers/ata/pata_bf54x.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/ata/pata_bf54x.c +4 -1
index 9ab8973..5551610 100644
@@ -911,7 +911,10 @@ static void bfin_bmdma_start(struct ata_queued_cmd *qc)
 	/* Reset all transfer count */
 	ATAPI_SET_CONTROL(base, ATAPI_GET_CONTROL(base) | TFRCNT_RST);
 
-		/* Set transfer length to buffer len */
+	/* Set ATAPI state machine contorl in terminate sequence */
+	ATAPI_SET_CONTROL(base, ATAPI_GET_CONTROL(base) | END_ON_TERM);
+
+	/* Set transfer length to buffer len */
 	for_each_sg(qc->sg, sg, qc->n_elem, si) {
 		ATAPI_SET_XFER_LEN(base, (sg_dma_len(sg) >> 1));
 	}
Signature · 1 line
1.5.5
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · On Mon, 12 May 2008 12:12:16 +0800 Bryan Wu <[email protected]> wrote:

From: Sonic Zhang <[email protected]>

Set ATAPI host state machine to control IDE device terminate sequence. Some IDE harddisk may assert terminate sequence in the middle of a formal DMA transaction and resume later. Bit DETECT_TERM in ATAPI_CTRL register determines whether the ATAPI host state machine or the kernel driver should take care of this case.

(but when submitting fix typo "contorl" )

Quoted 20 lines
---
 drivers/ata/pata_bf54x.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/ata/pata_bf54x.c +4 -1
index 9ab8973..5551610 100644
@@ -911,7 +911,10 @@ static void bfin_bmdma_start(struct ata_queued_cmd *qc)
 	/* Reset all transfer count */
 	ATAPI_SET_CONTROL(base, ATAPI_GET_CONTROL(base) | TFRCNT_RST);
 
-		/* Set transfer length to buffer len */
+	/* Set ATAPI state machine contorl in terminate sequence */
+	ATAPI_SET_CONTROL(base, ATAPI_GET_CONTROL(base) | END_ON_TERM);
+
+	/* Set transfer length to buffer len */
 	for_each_sg(qc->sg, sg, qc->n_elem, si) {
 		ATAPI_SET_XFER_LEN(base, (sg_dma_len(sg) >> 1));
 	}
Signature · 3 lines
--
	"Alan, I'm getting a bit worried about you."
				-- Linus Torvalds
Applied
#2 lore raw
In reply to Bryan Wu
Quoted 19 lines · Bryan Wu

From: Sonic Zhang <[email protected]>

Set ATAPI host state machine to control IDE device terminate sequence. Some IDE harddisk may assert terminate sequence in the middle of a formal DMA transaction and resume later. Bit DETECT_TERM in ATAPI_CTRL register determines whether the ATAPI host state machine or the kernel driver should take care of this case.

---
 drivers/ata/pata_bf54x.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/ata/pata_bf54x.c +0 -0
index 9ab8973..5551610 100644

drivers/ata/pata_bf54x.c static void bfin_bmdma_start(struct ata_queued_cmd *qc) · line 918

Quoted 9 lines
drivers/ata/pata_bf54x.c +4 -1
@@ -911,7 +911,10 @@ static void bfin_bmdma_start(struct ata_queued_cmd *qc)
 	/* Reset all transfer count */
 	ATAPI_SET_CONTROL(base, ATAPI_GET_CONTROL(base) | TFRCNT_RST);
 
-		/* Set transfer length to buffer len */
+	/* Set ATAPI state machine contorl in terminate sequence */
+	ATAPI_SET_CONTROL(base, ATAPI_GET_CONTROL(base) | END_ON_TERM);
+
+	/* Set transfer length to buffer len */
 	for_each_sg(qc->sg, sg, qc->n_elem, si) {

applied