summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-core.c
diff options
context:
space:
mode:
authorAlbert Lee <albertcc@tw.ibm.com>2006-06-22 13:00:25 +0800
committerJeff Garzik <jeff@garzik.org>2006-06-22 23:26:24 -0400
commit3a778275626c0eb97674e92875efeba01189ce0e (patch)
treed0df8b559e2d95772ebd30a3cc70b86ae2703a9e /drivers/scsi/libata-core.c
parent71f0737b2889b86f774a94afaf1342c2c0d61cb5 (diff)
downloadlinux-3a778275626c0eb97674e92875efeba01189ce0e.tar.gz
linux-3a778275626c0eb97674e92875efeba01189ce0e.tar.bz2
linux-3a778275626c0eb97674e92875efeba01189ce0e.zip
[PATCH] libata-dev: move the CDB-intr DMA blacklisting
Move the DMA blacklisting of the CDB-intr devices from ata_check_atapi_dma() to ata_dma_blacklisted(), where it makes more sense. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/scsi/libata-core.c')
-rw-r--r--drivers/scsi/libata-core.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index df483adc3f75..425ab1493fd3 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -2943,6 +2943,14 @@ static int ata_dma_blacklisted(const struct ata_device *dev)
unsigned int nlen, rlen;
int i;
+ /* We don't support polling DMA.
+ * DMA blacklist those ATAPI devices with CDB-intr (and use PIO)
+ * if the LLDD handles only interrupts in the HSM_ST_LAST state.
+ */
+ if ((dev->ap->flags & ATA_FLAG_PIO_POLLING) &&
+ (dev->flags & ATA_DFLAG_CDB_INTR))
+ return 1;
+
ata_id_string(dev->id, model_num, ATA_ID_PROD_OFS,
sizeof(model_num));
ata_id_string(dev->id, model_rev, ATA_ID_FW_REV_OFS,
@@ -3235,15 +3243,6 @@ int ata_check_atapi_dma(struct ata_queued_cmd *qc)
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;
}
/**
@@ -4551,7 +4550,7 @@ unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc)
break;
case ATA_PROT_ATAPI_DMA:
if (qc->dev->flags & ATA_DFLAG_CDB_INTR)
- /* see ata_check_atapi_dma() */
+ /* see ata_dma_blacklisted() */
BUG();
break;
default: