linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] 2.5 ide 48-bit usage
Date: Thu, 8 May 2003 18:34:41 +0200	[thread overview]
Message-ID: <20030508163441.GG20941@suse.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0305080924400.2967-100000@home.transmeta.com>

On Thu, May 08 2003, Linus Torvalds wrote:
> 
> On Thu, 8 May 2003, Jens Axboe wrote:
> > 
> > Maybe a define or two would help here. When you see drive->addressing
> > and hwif->addressing, you assume that they are used identically. That
> > !hwif->addressing means 48-bit is ok, while !drive->addressing means
> > it's not does not help at all.
> 
> Why not just change the names? The current setup clearly is confusing, and
> adding defines doesn't much help. Rename the structure member so that the
> name says what it is, aka "address_mode", and when renaming it you'd go
> through the source anyway and change "!addressing" to something more
> readable like "address_mode == IDE_LBA48" or whatever.

Might not be a bad idea, drive->address_mode is a heck of a lot more to
the point. I'll do a swipe of this tomorrow, if no one beats me to it.

> (Anyway, I'll just drop all the 48-bit patches for now, since you've 
> totally confused me about which ones are right and what the bugs are ;)

I think we can all agree on the last one (attached again, it's short) is
ok. The 'only use 48-bit when needed' can wait until Bart gets the
taskfile infrastructure in place, until then I'll just have to eat the
overhead :)

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


  reply	other threads:[~2003-05-08 16:22 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-07  8:49 [PATCH] 2.5 ide 48-bit usage Jens Axboe
2003-05-07 16:28 ` Linus Torvalds
2003-05-07 16:46   ` Jens Axboe
2003-05-07 17:15     ` Linus Torvalds
2003-05-07 17:33       ` Jens Axboe
2003-05-07 17:42         ` Linus Torvalds
2003-05-07 17:50           ` Jens Axboe
2003-05-07 19:58             ` Bartlomiej Zolnierkiewicz
2003-05-07 20:19               ` Jens Axboe
2003-05-08  7:56                 ` Jens Axboe
2003-05-08 11:01                   ` Alan Cox
2003-05-08 12:01                     ` Jens Axboe
2003-05-12 21:41                       ` Mike Fedyk
2003-05-13  6:44                         ` Jens Axboe
2003-05-08 11:34                   ` Bartlomiej Zolnierkiewicz
2003-05-08 11:59                     ` Jens Axboe
2003-05-08 12:20                       ` Bartlomiej Zolnierkiewicz
2003-05-08 12:26                         ` Jens Axboe
2003-05-08 12:36                         ` Jens Axboe
2003-05-08 13:16                           ` Bartlomiej Zolnierkiewicz
2003-05-08 13:23                             ` Jens Axboe
2003-05-08 13:35                               ` Bartlomiej Zolnierkiewicz
2003-05-08 13:37                                 ` Jens Axboe
2003-05-08 14:47                                   ` Jens Axboe
2003-05-08 14:51                                     ` Jens Axboe
2003-05-08 14:46                                 ` Alan Cox
2003-05-08 15:49                                   ` Bartlomiej Zolnierkiewicz
2003-05-08 16:16                                     ` Jens Axboe
2003-05-08 16:27                                       ` Linus Torvalds
2003-05-08 16:34                                         ` Jens Axboe [this message]
2003-05-08 16:59                                           ` Bartlomiej Zolnierkiewicz
2003-05-09  7:40                                             ` Jens Axboe
2003-05-08 22:06                                           ` Alan Cox
2003-05-09  7:06                                             ` Jens Axboe
2003-05-09  8:28                                               ` [PATCH][RFC] Sanitize hwif/drive addressing (was Re: [PATCH] 2.5 ide 48-bit usage) Jens Axboe
2003-05-09 11:07                                                 ` Bartlomiej Zolnierkiewicz
2003-05-09 12:03                                                   ` Jens Axboe
2003-05-07 21:45     ` [PATCH] 2.5 ide 48-bit usage Henning P. Schmiedehausen
2003-05-07 22:03       ` Alan Cox
2003-05-07 22:55       ` H. Peter Anvin
2003-05-07 18:29   ` Alan Cox
2003-05-07 19:30     ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030508163441.GG20941@suse.de \
    --to=axboe@suse.de \
    --cc=B.Zolnierkiewicz@elka.pw.edu.pl \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).