aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r--drivers/ata/libata-scsi.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index aeb6e01d82ce..57a43649a461 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -1637,6 +1637,7 @@ defer:
1637 1637
1638/** 1638/**
1639 * ata_scsi_rbuf_get - Map response buffer. 1639 * ata_scsi_rbuf_get - Map response buffer.
1640 * @cmd: SCSI command containing buffer to be mapped.
1640 * @flags: unsigned long variable to store irq enable status 1641 * @flags: unsigned long variable to store irq enable status
1641 * @copy_in: copy in from user buffer 1642 * @copy_in: copy in from user buffer
1642 * 1643 *
@@ -1954,7 +1955,7 @@ static unsigned int ata_msense_ctl_mode(u8 *buf)
1954 1955
1955/** 1956/**
1956 * ata_msense_rw_recovery - Simulate MODE SENSE r/w error recovery page 1957 * ata_msense_rw_recovery - Simulate MODE SENSE r/w error recovery page
1957 * @bufp: output buffer 1958 * @buf: output buffer
1958 * 1959 *
1959 * Generate a generic MODE SENSE r/w error recovery page. 1960 * Generate a generic MODE SENSE r/w error recovery page.
1960 * 1961 *
@@ -2342,8 +2343,8 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2342{ 2343{
2343 struct scsi_cmnd *scmd = qc->scsicmd; 2344 struct scsi_cmnd *scmd = qc->scsicmd;
2344 struct ata_device *dev = qc->dev; 2345 struct ata_device *dev = qc->dev;
2345 int using_pio = (dev->flags & ATA_DFLAG_PIO);
2346 int nodata = (scmd->sc_data_direction == DMA_NONE); 2346 int nodata = (scmd->sc_data_direction == DMA_NONE);
2347 int using_pio = !nodata && (dev->flags & ATA_DFLAG_PIO);
2347 unsigned int nbytes; 2348 unsigned int nbytes;
2348 2349
2349 memset(qc->cdb, 0, dev->cdb_len); 2350 memset(qc->cdb, 0, dev->cdb_len);
@@ -2361,7 +2362,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2361 ata_qc_set_pc_nbytes(qc); 2362 ata_qc_set_pc_nbytes(qc);
2362 2363
2363 /* check whether ATAPI DMA is safe */ 2364 /* check whether ATAPI DMA is safe */
2364 if (!using_pio && ata_check_atapi_dma(qc)) 2365 if (!nodata && !using_pio && atapi_check_dma(qc))
2365 using_pio = 1; 2366 using_pio = 1;
2366 2367
2367 /* Some controller variants snoop this value for Packet 2368 /* Some controller variants snoop this value for Packet
@@ -2401,13 +2402,11 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc)
2401 qc->tf.lbam = (nbytes & 0xFF); 2402 qc->tf.lbam = (nbytes & 0xFF);
2402 qc->tf.lbah = (nbytes >> 8); 2403 qc->tf.lbah = (nbytes >> 8);
2403 2404
2404 if (using_pio || nodata) { 2405 if (nodata)
2405 /* no data, or PIO data xfer */ 2406 qc->tf.protocol = ATAPI_PROT_NODATA;
2406 if (nodata) 2407 else if (using_pio)
2407 qc->tf.protocol = ATAPI_PROT_NODATA; 2408 qc->tf.protocol = ATAPI_PROT_PIO;
2408 else 2409 else {
2409 qc->tf.protocol = ATAPI_PROT_PIO;
2410 } else {
2411 /* DMA data xfer */ 2410 /* DMA data xfer */
2412 qc->tf.protocol = ATAPI_PROT_DMA; 2411 qc->tf.protocol = ATAPI_PROT_DMA;
2413 qc->tf.feature |= ATAPI_PKT_DMA; 2412 qc->tf.feature |= ATAPI_PKT_DMA;