Commit aa914d0d authored by Jens Axboe's avatar Jens Axboe

[PATCH] ide minimum 48-bit support

This is the small patch that we all agreed on. With this patch, we do
nice big writes/reads on ide disks that support 48-bit lba.
parent 21eca852
...@@ -1479,7 +1479,7 @@ static int probe_lba_addressing (ide_drive_t *drive, int arg) ...@@ -1479,7 +1479,7 @@ static int probe_lba_addressing (ide_drive_t *drive, int arg)
static int set_lba_addressing (ide_drive_t *drive, int arg) static int set_lba_addressing (ide_drive_t *drive, int arg)
{ {
return (probe_lba_addressing(drive, arg)); return probe_lba_addressing(drive, arg);
} }
static void idedisk_add_settings(ide_drive_t *drive) static void idedisk_add_settings(ide_drive_t *drive)
...@@ -1566,6 +1566,18 @@ static void idedisk_setup (ide_drive_t *drive) ...@@ -1566,6 +1566,18 @@ static void idedisk_setup (ide_drive_t *drive)
(void) probe_lba_addressing(drive, 1); (void) probe_lba_addressing(drive, 1);
if (drive->addressing == 1) {
ide_hwif_t *hwif = HWIF(drive);
int max_s = 2048;
if (max_s > hwif->rqsize)
max_s = hwif->rqsize;
blk_queue_max_sectors(&drive->queue, max_s);
}
printk("%s: max request size: %dKiB\n", drive->name, drive->queue.max_sectors / 2);
/* Extract geometry if we did not already have one for the drive */ /* Extract geometry if we did not already have one for the drive */
if (!drive->cyl || !drive->head || !drive->sect) { if (!drive->cyl || !drive->head || !drive->sect) {
drive->cyl = drive->bios_cyl = id->cyls; drive->cyl = drive->bios_cyl = id->cyls;
......
...@@ -998,6 +998,7 @@ EXPORT_SYMBOL(save_match); ...@@ -998,6 +998,7 @@ EXPORT_SYMBOL(save_match);
static void ide_init_queue(ide_drive_t *drive) static void ide_init_queue(ide_drive_t *drive)
{ {
request_queue_t *q = &drive->queue; request_queue_t *q = &drive->queue;
ide_hwif_t *hwif = HWIF(drive);
int max_sectors = 256; int max_sectors = 256;
/* /*
...@@ -1013,8 +1014,10 @@ static void ide_init_queue(ide_drive_t *drive) ...@@ -1013,8 +1014,10 @@ static void ide_init_queue(ide_drive_t *drive)
drive->queue_setup = 1; drive->queue_setup = 1;
blk_queue_segment_boundary(q, 0xffff); blk_queue_segment_boundary(q, 0xffff);
if (HWIF(drive)->rqsize) if (!hwif->rqsize)
max_sectors = HWIF(drive)->rqsize; hwif->rqsize = hwif->addressing ? 256 : 65536;
if (hwif->rqsize < max_sectors)
max_sectors = hwif->rqsize;
blk_queue_max_sectors(q, max_sectors); blk_queue_max_sectors(q, max_sectors);
/* IDE DMA can do PRD_ENTRIES number of segments. */ /* IDE DMA can do PRD_ENTRIES number of segments. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment