aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-27 13:00:23 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-27 13:00:23 -0400
commit75ca0d22668a36fc83e17407d369b528a22c562c (patch)
tree81934436cdeb95d4a51d95481a1c6b973609d38e /drivers/ata/libata-scsi.c
parent7af5f532a23c421ab9a70b1a9a78c722d26d95ff (diff)
parent40a1d531f6c894b298e784fd2090d87633e4989a (diff)
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: libata: kill ATA_HORKAGE_DMA_RW_ONLY libata: use PIO for non-16 byte aligned ATAPI commands libata: call ata_check_atapi_dma() with qc better prepared libata: fix infinite EH waiting bug libata: fix ata_dev_disable() pata_it821x: fix section mismatch warning libata: remove unused variable from ata_eh_reset() libata: be less verbose about hpa libata: kill non-sense warning message libata: kill the infamous abnormal status message HPT374 is UDMA100 not UDMA133
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index c228df298bd8..4ddf00c8c5f5 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2384,11 +2384,6 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2384 int using_pio = (dev->flags & ATA_DFLAG_PIO); 2384 int using_pio = (dev->flags & ATA_DFLAG_PIO);
2385 int nodata = (scmd->sc_data_direction == DMA_NONE); 2385 int nodata = (scmd->sc_data_direction == DMA_NONE);
2386 2386
2387 if (!using_pio)
2388 /* Check whether ATAPI DMA is safe */
2389 if (ata_check_atapi_dma(qc))
2390 using_pio = 1;
2391
2392 memset(qc->cdb, 0, dev->cdb_len); 2387 memset(qc->cdb, 0, dev->cdb_len);
2393 memcpy(qc->cdb, scmd->cmnd, scmd->cmd_len); 2388 memcpy(qc->cdb, scmd->cmnd, scmd->cmd_len);
2394 2389
@@ -2401,19 +2396,22 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2401 } 2396 }
2402 2397
2403 qc->tf.command = ATA_CMD_PACKET; 2398 qc->tf.command = ATA_CMD_PACKET;
2399 qc->nbytes = scmd->request_bufflen;
2400
2401 /* check whether ATAPI DMA is safe */
2402 if (!using_pio && ata_check_atapi_dma(qc))
2403 using_pio = 1;
2404 2404
2405 /* no data, or PIO data xfer */
2406 if (using_pio || nodata) { 2405 if (using_pio || nodata) {
2406 /* no data, or PIO data xfer */
2407 if (nodata) 2407 if (nodata)
2408 qc->tf.protocol = ATA_PROT_ATAPI_NODATA; 2408 qc->tf.protocol = ATA_PROT_ATAPI_NODATA;
2409 else 2409 else
2410 qc->tf.protocol = ATA_PROT_ATAPI; 2410 qc->tf.protocol = ATA_PROT_ATAPI;
2411 qc->tf.lbam = (8 * 1024) & 0xff; 2411 qc->tf.lbam = (8 * 1024) & 0xff;
2412 qc->tf.lbah = (8 * 1024) >> 8; 2412 qc->tf.lbah = (8 * 1024) >> 8;
2413 } 2413 } else {
2414 2414 /* DMA data xfer */
2415 /* DMA data xfer */
2416 else {
2417 qc->tf.protocol = ATA_PROT_ATAPI_DMA; 2415 qc->tf.protocol = ATA_PROT_ATAPI_DMA;
2418 qc->tf.feature |= ATAPI_PKT_DMA; 2416 qc->tf.feature |= ATAPI_PKT_DMA;
2419 2417
@@ -2422,8 +2420,6 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2422 qc->tf.feature |= ATAPI_DMADIR; 2420 qc->tf.feature |= ATAPI_DMADIR;
2423 } 2421 }
2424 2422
2425 qc->nbytes = scmd->request_bufflen;
2426
2427 return 0; 2423 return 0;
2428} 2424}
2429 2425