diff options
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 1cea18f62abc..6e15c5ddae6d 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -832,24 +832,16 @@ static void ata_scsi_dev_config(struct scsi_device *sdev, | |||
832 | /* configure max sectors */ | 832 | /* configure max sectors */ |
833 | blk_queue_max_sectors(sdev->request_queue, dev->max_sectors); | 833 | blk_queue_max_sectors(sdev->request_queue, dev->max_sectors); |
834 | 834 | ||
835 | /* SATA DMA transfers must be multiples of 4 byte, so | 835 | if (dev->class == ATA_DEV_ATAPI) |
836 | * we need to pad ATAPI transfers using an extra sg. | ||
837 | * Decrement max hw segments accordingly. | ||
838 | */ | ||
839 | if (dev->class == ATA_DEV_ATAPI) { | ||
840 | struct request_queue *q = sdev->request_queue; | ||
841 | blk_queue_max_hw_segments(q, q->max_hw_segments - 1); | ||
842 | |||
843 | /* set the min alignment */ | 836 | /* set the min alignment */ |
844 | blk_queue_update_dma_alignment(sdev->request_queue, | 837 | blk_queue_update_dma_alignment(sdev->request_queue, |
845 | ATA_DMA_PAD_SZ - 1); | 838 | ATA_DMA_PAD_SZ - 1); |
846 | } else | 839 | else { |
847 | /* ATA devices must be sector aligned */ | 840 | /* ATA devices must be sector aligned */ |
848 | blk_queue_update_dma_alignment(sdev->request_queue, | 841 | blk_queue_update_dma_alignment(sdev->request_queue, |
849 | ATA_SECT_SIZE - 1); | 842 | ATA_SECT_SIZE - 1); |
850 | |||
851 | if (dev->class == ATA_DEV_ATA) | ||
852 | sdev->manage_start_stop = 1; | 843 | sdev->manage_start_stop = 1; |
844 | } | ||
853 | 845 | ||
854 | if (dev->flags & ATA_DFLAG_AN) | 846 | if (dev->flags & ATA_DFLAG_AN) |
855 | set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); | 847 | set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events); |
@@ -2500,7 +2492,7 @@ static unsigned int atapi_xlat(struct ata_queued_cmd *qc) | |||
2500 | * want to set it properly, and for DMA where it is | 2492 | * want to set it properly, and for DMA where it is |
2501 | * effectively meaningless. | 2493 | * effectively meaningless. |
2502 | */ | 2494 | */ |
2503 | nbytes = min(qc->nbytes, (unsigned int)63 * 1024); | 2495 | nbytes = min(scmd->request->raw_data_len, (unsigned int)63 * 1024); |
2504 | 2496 | ||
2505 | /* Most ATAPI devices which honor transfer chunk size don't | 2497 | /* Most ATAPI devices which honor transfer chunk size don't |
2506 | * behave according to the spec when odd chunk size which | 2498 | * behave according to the spec when odd chunk size which |
@@ -3555,7 +3547,7 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc); | |||
3555 | * @ap: Port to initialize | 3547 | * @ap: Port to initialize |
3556 | * | 3548 | * |
3557 | * Called just after data structures for each port are | 3549 | * Called just after data structures for each port are |
3558 | * initialized. Allocates DMA pad. | 3550 | * initialized. |
3559 | * | 3551 | * |
3560 | * May be used as the port_start() entry in ata_port_operations. | 3552 | * May be used as the port_start() entry in ata_port_operations. |
3561 | * | 3553 | * |
@@ -3564,7 +3556,7 @@ EXPORT_SYMBOL_GPL(ata_sas_port_alloc); | |||
3564 | */ | 3556 | */ |
3565 | int ata_sas_port_start(struct ata_port *ap) | 3557 | int ata_sas_port_start(struct ata_port *ap) |
3566 | { | 3558 | { |
3567 | return ata_pad_alloc(ap, ap->dev); | 3559 | return 0; |
3568 | } | 3560 | } |
3569 | EXPORT_SYMBOL_GPL(ata_sas_port_start); | 3561 | EXPORT_SYMBOL_GPL(ata_sas_port_start); |
3570 | 3562 | ||
@@ -3572,8 +3564,6 @@ EXPORT_SYMBOL_GPL(ata_sas_port_start); | |||
3572 | * ata_port_stop - Undo ata_sas_port_start() | 3564 | * ata_port_stop - Undo ata_sas_port_start() |
3573 | * @ap: Port to shut down | 3565 | * @ap: Port to shut down |
3574 | * | 3566 | * |
3575 | * Frees the DMA pad. | ||
3576 | * | ||
3577 | * May be used as the port_stop() entry in ata_port_operations. | 3567 | * May be used as the port_stop() entry in ata_port_operations. |
3578 | * | 3568 | * |
3579 | * LOCKING: | 3569 | * LOCKING: |
@@ -3582,7 +3572,6 @@ EXPORT_SYMBOL_GPL(ata_sas_port_start); | |||
3582 | 3572 | ||
3583 | void ata_sas_port_stop(struct ata_port *ap) | 3573 | void ata_sas_port_stop(struct ata_port *ap) |
3584 | { | 3574 | { |
3585 | ata_pad_free(ap, ap->dev); | ||
3586 | } | 3575 | } |
3587 | EXPORT_SYMBOL_GPL(ata_sas_port_stop); | 3576 | EXPORT_SYMBOL_GPL(ata_sas_port_stop); |
3588 | 3577 | ||