Re: [PATCH] 2.5 ide 48-bit usage

Jens Axboe
2003-05-08T14:34:40Z

On Thu, May 08 2003, Jens Axboe wrote:
> > > Ditto, cannot be reliable without the taskfile changes.
> > >
> > > I won't bother with anything new until the taskfile stuff is in.
> >
> > Good decision.
>
> So what's the time frame on that?

And the more important question, how are you creating the taskfile? If
it's reachable from end_io context (and not just the submission path),
which it must be to solve the problem was are discussing here, then
surely it's not from the stack.

BTW, how about a minor compromise. See attached patch, I'd be happy with
that for now. It _is_ essentially two seperate issues, right? One is
getting good request sizes on 48-bit commands, the other is taking some
decent advantage of 48-bit commands.

diff -Nru a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
--- a/drivers/ide/ide-disk.c Thu May 8 14:32:59 2003
+++ b/drivers/ide/ide-disk.c Thu May 8 14:32:59 2003
@@ -1479,7 +1483,7 @@

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)
@@ -1565,6 +1569,18 @@
}

(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 */
if (!drive->cyl || !drive->head || !drive->sect) {
diff -Nru a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
--- a/drivers/ide/ide-probe.c Thu May 8 14:32:59 2003
+++ b/drivers/ide/ide-probe.c Thu May 8 14:32:59 2003
@@ -998,6 +998,7 @@
static void ide_init_queue(ide_drive_t *drive)
{
request_queue_t *q = &drive->queue;
+ ide_hwif_t *hwif = HWIF(drive);
int max_sectors = 256;

/*
@@ -1013,8 +1014,10 @@
drive->queue_setup = 1;
blk_queue_segment_boundary(q, 0xffff);

- if (HWIF(drive)->rqsize)
- max_sectors = HWIF(drive)->rqsize;
+ if (!hwif->rqsize)
+ hwif->rqsize = hwif->addressing ? 256 : 65536;
+ if (hwif->rqsize < max_sectors)
+ max_sectors = hwif->rqsize;
blk_queue_max_sectors(q, max_sectors);

/* IDE DMA can do PRD_ENTRIES number of segments. */

--
Jens Axboe