2002-06-04 20:58:52

by Robert Cardell

[permalink] [raw]
Subject: [PATCH] Trivial, IDE geometry fix / defconfig changes


Hi all,

Two patches included. The first fixes a bug with really large (48-bit lba)
drives where the kernel miscomputes the geometry if the BIOS isn't 48-bit
aware. (At least I think that's when it would happen.) This messes up the EVMS
in particular, since it thinks the drives are 16 times their real size, and
tries to read past the end of the device at discovery time. I'm sending it to
the list as well as Marcelo just to be sure it's the right fix (although it's
very trivial, I'm just paranoid :), and so it can be sent to Linus/Martin D.
if it's still relevant to 2.5.

I've also taken the liberty of changing the default configuration to exclude
the Symbios 8xx SCSI, EtherExpress Pro, and Ensoniq ES1371, on the basis that:
- In the first case, the driver is being superceded,
- In the first two cases, they are 'hidden' from view if you use
make menuconfig and don't specifically check for them. I'm sick of
accidentally building them into my kernels.
- None of them are particularly common pieces of hardware anyway.

There are lots of other things I'd change in the default config (why is SMP
the default and parport not, for example?), but these are the things that
/really/ bother me.

First patch against drivers/ide/ide-disk.c, second against arch/i386/defconfig.
(2.4.19-pre9) I'm not on the list at the moment, cc me to reply.

Thanks,

Robert Cardell
<[email protected]>


--- ide-disk.c.old Tue Jun 4 21:09:10 2002
+++ ide-disk.c Tue Jun 4 21:09:44 2002
@@ -929,9 +929,9 @@

if (id->cfs_enable_2 & 0x0400) {
capacity_2 = id->lba_capacity_2;
- drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect);
drive->head = drive->bios_head = 255;
drive->sect = drive->bios_sect = 63;
+ drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect);
drive->select.b.lba = 1;
set_max_ext = idedisk_read_native_max_address_ext(drive);
if (set_max_ext > capacity_2) {



--- defconfig.old Tue Jun 4 21:13:00 2002
+++ defconfig Tue Jun 4 21:21:41 2002
@@ -325,10 +325,7 @@
# CONFIG_SCSI_NCR53C7xx is not set
# CONFIG_SCSI_SYM53C8XX_2 is not set
# CONFIG_SCSI_NCR53C8XX is not set
-CONFIG_SCSI_SYM53C8XX=y
-CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=4
-CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
-CONFIG_SCSI_NCR53C8XX_SYNC=20
+# CONFIG_SCSI_SYM53C8XX is not set
# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
# CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set
# CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set
@@ -415,7 +412,7 @@
# CONFIG_DE4X5 is not set
# CONFIG_DGRS is not set
# CONFIG_DM9102 is not set
-CONFIG_EEPRO100=y
+# CONFIG_EEPRO100 is not set
# CONFIG_LNE390 is not set
# CONFIG_FEALNX is not set
# CONFIG_NATSEMI is not set
@@ -694,7 +691,7 @@
#
# Sound
#
-CONFIG_SOUND=y
+# CONFIG_SOUND is not set
# CONFIG_SOUND_BT878 is not set
# CONFIG_SOUND_CMPCI is not set
# CONFIG_SOUND_EMU10K1 is not set
@@ -702,7 +699,7 @@
# CONFIG_SOUND_FUSION is not set
# CONFIG_SOUND_CS4281 is not set
# CONFIG_SOUND_ES1370 is not set
-CONFIG_SOUND_ES1371=y
+# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_ESSSOLO1 is not set
# CONFIG_SOUND_MAESTRO is not set
# CONFIG_SOUND_MAESTRO3 is not set


2002-06-04 21:26:46

by Rik van Riel

[permalink] [raw]
Subject: Re: [PATCH] Trivial, IDE geometry fix / defconfig changes


> Date: Tue, 4 Jun 2002 21:56:17 +0100
> From: Robert Cardell <[email protected]>
> To: [email protected], [email protected]

If you have problems reaching marcelo, feel free to borrow my domain ;)

cheers,

Rik
--
Bravely reimplemented by the knights who say "NIH".

http://www.surriel.com/ http://distro.conectiva.com/

2002-06-04 21:51:43

by Robert Cardell

[permalink] [raw]
Subject: Re: [PATCH] Trivial, IDE geometry fix / defconfig changes

On Tue, Jun 04, 2002 at 06:22:09PM -0300, Rik van Riel wrote:
>
> > Date: Tue, 4 Jun 2002 21:56:17 +0100
> > From: Robert Cardell <[email protected]>
> > To: [email protected], [email protected]
>
> If you have problems reaching marcelo, feel free to borrow my domain ;)
>
Already realised (got a bounce). I'd just blindly copied it from one of his BK
summaries... and now I look like such an idiot, I guess there's no way he'll
even look at the patch ;)

Robert Cardell
<[email protected]>

2002-06-04 23:41:51

by Guest section DW

[permalink] [raw]
Subject: Re: [PATCH] Trivial, IDE geometry fix / defconfig changes

On Tue, Jun 04, 2002 at 09:56:17PM +0100, Robert Cardell wrote:

> --- ide-disk.c.old Tue Jun 4 21:09:10 2002
> +++ ide-disk.c Tue Jun 4 21:09:44 2002
> @@ -929,9 +929,9 @@
>
> if (id->cfs_enable_2 & 0x0400) {
> capacity_2 = id->lba_capacity_2;
> - drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect);
> drive->head = drive->bios_head = 255;
> drive->sect = drive->bios_sect = 63;
> + drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect);
> drive->select.b.lba = 1;
> set_max_ext = idedisk_read_native_max_address_ext(drive);
> if (set_max_ext > capacity_2) {
>

Yes, let me confirm: this patch is required.
I sent it to the list on 10 Feb 2002 ("[PATCH] tiny IDE fixes"); apparently
nobody picked it up, or at least it didnt reach 2.4.19-pre9 yet.
That patch also removed some dead code.

Andries

2002-06-06 02:47:04

by Rusty Russell

[permalink] [raw]
Subject: Re: [PATCH] Trivial, IDE geometry fix / defconfig changes

On Wed, 5 Jun 2002 01:41:46 +0200
Guest section DW <[email protected]> wrote:

> On Tue, Jun 04, 2002 at 09:56:17PM +0100, Robert Cardell wrote:
>
> > --- ide-disk.c.old Tue Jun 4 21:09:10 2002
> > +++ ide-disk.c Tue Jun 4 21:09:44 2002
> > @@ -929,9 +929,9 @@
> >
> > if (id->cfs_enable_2 & 0x0400) {
> > capacity_2 = id->lba_capacity_2;
> > - drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect);
> > drive->head = drive->bios_head = 255;
> > drive->sect = drive->bios_sect = 63;
> > + drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect);
> > drive->select.b.lba = 1;
> > set_max_ext = idedisk_read_native_max_address_ext(drive);
> > if (set_max_ext > capacity_2) {
> >
>
> Yes, let me confirm: this patch is required.
> I sent it to the list on 10 Feb 2002 ("[PATCH] tiny IDE fixes"); apparently
> nobody picked it up, or at least it didnt reach 2.4.19-pre9 yet.
> That patch also removed some dead code.

If you'd sent it to the trivial patch maintainer... <plug plug>

Rusty.
--
there are those who do and those who hang on and you don't see too
many doers quoting their contemporaries. -- Larry McVoy