diff options
-rw-r--r-- | drivers/ata/libata-core.c | 5 | ||||
-rw-r--r-- | drivers/ata/libata-scsi.c | 19 |
2 files changed, 8 insertions, 16 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 5028396029b3..f531a89c26c9 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1533,6 +1533,11 @@ int ata_dev_configure(struct ata_device *dev) | |||
1533 | cdb_intr_string); | 1533 | cdb_intr_string); |
1534 | } | 1534 | } |
1535 | 1535 | ||
1536 | /* determine max_sectors */ | ||
1537 | dev->max_sectors = ATA_MAX_SECTORS; | ||
1538 | if (dev->flags & ATA_DFLAG_LBA48) | ||
1539 | dev->max_sectors = ATA_MAX_SECTORS_LBA48; | ||
1540 | |||
1536 | if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) { | 1541 | if (dev->horkage & ATA_HORKAGE_DIAGNOSTIC) { |
1537 | /* Let the user know. We don't want to disallow opens for | 1542 | /* Let the user know. We don't want to disallow opens for |
1538 | rescue purposes, or in case the vendor is just a blithering | 1543 | rescue purposes, or in case the vendor is just a blithering |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 6b2553dae489..f13dd07a5331 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -807,23 +807,10 @@ static void ata_scsi_sdev_config(struct scsi_device *sdev) | |||
807 | static void ata_scsi_dev_config(struct scsi_device *sdev, | 807 | static void ata_scsi_dev_config(struct scsi_device *sdev, |
808 | struct ata_device *dev) | 808 | struct ata_device *dev) |
809 | { | 809 | { |
810 | unsigned int max_sectors; | 810 | /* configure max sectors */ |
811 | blk_queue_max_sectors(sdev->request_queue, dev->max_sectors); | ||
811 | 812 | ||
812 | /* TODO: 2048 is an arbitrary number, not the | 813 | /* SATA DMA transfers must be multiples of 4 byte, so |
813 | * hardware maximum. This should be increased to | ||
814 | * 65534 when Jens Axboe's patch for dynamically | ||
815 | * determining max_sectors is merged. | ||
816 | */ | ||
817 | max_sectors = ATA_MAX_SECTORS; | ||
818 | if (dev->flags & ATA_DFLAG_LBA48) | ||
819 | max_sectors = ATA_MAX_SECTORS_LBA48; | ||
820 | if (dev->max_sectors) | ||
821 | max_sectors = dev->max_sectors; | ||
822 | |||
823 | blk_queue_max_sectors(sdev->request_queue, max_sectors); | ||
824 | |||
825 | /* | ||
826 | * SATA DMA transfers must be multiples of 4 byte, so | ||
827 | * we need to pad ATAPI transfers using an extra sg. | 814 | * we need to pad ATAPI transfers using an extra sg. |
828 | * Decrement max hw segments accordingly. | 815 | * Decrement max hw segments accordingly. |
829 | */ | 816 | */ |