diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/libata-core.c | 11 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 9812bbf05e62..1845119cc7f0 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -2396,6 +2396,7 @@ int ata_dev_configure(struct ata_device *dev) | |||
2396 | else if (dev->class == ATA_DEV_ATAPI) { | 2396 | else if (dev->class == ATA_DEV_ATAPI) { |
2397 | const char *cdb_intr_string = ""; | 2397 | const char *cdb_intr_string = ""; |
2398 | const char *atapi_an_string = ""; | 2398 | const char *atapi_an_string = ""; |
2399 | const char *dma_dir_string = ""; | ||
2399 | u32 sntf; | 2400 | u32 sntf; |
2400 | 2401 | ||
2401 | rc = atapi_cdb_len(id); | 2402 | rc = atapi_cdb_len(id); |
@@ -2436,13 +2437,19 @@ int ata_dev_configure(struct ata_device *dev) | |||
2436 | cdb_intr_string = ", CDB intr"; | 2437 | cdb_intr_string = ", CDB intr"; |
2437 | } | 2438 | } |
2438 | 2439 | ||
2440 | if (atapi_dmadir || atapi_id_dmadir(dev->id)) { | ||
2441 | dev->flags |= ATA_DFLAG_DMADIR; | ||
2442 | dma_dir_string = ", DMADIR"; | ||
2443 | } | ||
2444 | |||
2439 | /* print device info to dmesg */ | 2445 | /* print device info to dmesg */ |
2440 | if (ata_msg_drv(ap) && print_info) | 2446 | if (ata_msg_drv(ap) && print_info) |
2441 | ata_dev_printk(dev, KERN_INFO, | 2447 | ata_dev_printk(dev, KERN_INFO, |
2442 | "ATAPI: %s, %s, max %s%s%s\n", | 2448 | "ATAPI: %s, %s, max %s%s%s%s\n", |
2443 | modelbuf, fwrevbuf, | 2449 | modelbuf, fwrevbuf, |
2444 | ata_mode_string(xfer_mask), | 2450 | ata_mode_string(xfer_mask), |
2445 | cdb_intr_string, atapi_an_string); | 2451 | cdb_intr_string, atapi_an_string, |
2452 | dma_dir_string); | ||
2446 | } | 2453 | } |
2447 | 2454 | ||
2448 | /* determine max_sectors */ | 2455 | /* determine max_sectors */ |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index f888babc8283..0562b0a49f3b 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2582,7 +2582,8 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) | |||
2582 | qc->tf.protocol = ATAPI_PROT_DMA; | 2582 | qc->tf.protocol = ATAPI_PROT_DMA; |
2583 | qc->tf.feature |= ATAPI_PKT_DMA; | 2583 | qc->tf.feature |= ATAPI_PKT_DMA; |
2584 | 2584 | ||
2585 | if (atapi_dmadir && (scmd->sc_data_direction != DMA_TO_DEVICE)) | 2585 | if ((dev->flags & ATA_DFLAG_DMADIR) && |
2586 | (scmd->sc_data_direction != DMA_TO_DEVICE)) | ||
2586 | /* some SATA bridges need us to indicate data xfer direction */ | 2587 | /* some SATA bridges need us to indicate data xfer direction */ |
2587 | qc->tf.feature |= ATAPI_DMADIR; | 2588 | qc->tf.feature |= ATAPI_DMADIR; |
2588 | } | 2589 | } |