linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] libata-dev: ata_check_atapi_dma() fix for ATA_FLAG_PIO_POLLING LLDDs
@ 2006-03-13  7:57 Albert Lee
  2006-03-13  8:09 ` Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Albert Lee @ 2006-03-13  7:57 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: IDE Linux, Tejun Heo, Doug Maxey

ata_check_atapi_dma() fix for LLDDs with the ATA_FLAG_PIO_POLLING flag.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---

We don't support polling DMA.
If the LLDD handles only interrupts in the HSM_ST_LAST state 
(indicated by the ATA_FLAG_PIO_POLLING flag) and the ATAPI device
generates CDB interrupts, we have to use the polling PIO protocol.
(Otherwise, the CDB interrupts might confuse the LLDD.)

We just set the protocol to PIO here in ata_check_atapi_dma().
Later in ata_qc_issue_prot(), the PIO protocol will be set as "polling"
for those LLDDs.

Patch against the irq-pio branch +
(1) irq-pio minor fixes (respin) +
(2) integrate polling pio with irq-pio (respin)

For your review, thanks,

Albert

--- 05_cleanup/drivers/scsi/libata-core.c	2006-03-13 13:29:02.000000000 +0800
+++ 06_check_atapi_dma/drivers/scsi/libata-core.c	2006-03-13 13:29:25.000000000 +0800
@@ -2850,6 +2850,15 @@ int ata_check_atapi_dma(struct ata_queue
 	if (ap->ops->check_atapi_dma)
 		rc = ap->ops->check_atapi_dma(qc);
 
+	/* We don't support polling DMA.
+	 * Use PIO if the LLDD handles only interrupts in
+	 * the HSM_ST_LAST state and the ATAPI device
+	 * generates CDB interrupts.
+	 */
+	if ((ap->flags & ATA_FLAG_PIO_POLLING) &&
+	    (qc->dev->flags & ATA_DFLAG_CDB_INTR))
+		rc = 1;
+
 	return rc;
 }
 /**
@@ -4004,6 +4013,7 @@ unsigned int ata_qc_issue_prot(struct at
 			break;
 		case ATA_PROT_ATAPI_DMA:
 			if (qc->dev->flags & ATA_DFLAG_CDB_INTR)
+				/* see ata_check_atapi_dma() */
 				BUG();
 			break;
 		default:


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-04-01 13:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-13  7:57 [PATCH 1/1] libata-dev: ata_check_atapi_dma() fix for ATA_FLAG_PIO_POLLING LLDDs Albert Lee
2006-03-13  8:09 ` Jeff Garzik
2006-03-14  4:52   ` Albert Lee
2006-03-15 15:54     ` Mark Lord
2006-03-15 16:12       ` Mark Lord
2006-03-15 16:24         ` Mark Lord
2006-03-16  7:22           ` Albert Lee
2006-03-17  5:51             ` Mark Lord
2006-03-15 16:49         ` Mark Lord
2006-04-01 13:24           ` Albert Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).