Re: IDE disk geometry + patch

Peter T. Breuer (ptb@it.uc3m.es)
Fri, 4 Dec 1998 14:42:39 +0100 (MET)


I saw this recently on new fujitsus. Reported 1023,255,63 after selecting LBA.
Result complete muddle until I realized that _smart IDE disk_ (or somesuch)
had been enabled in the bios. Turned it off and all OK.

But LBA has _always_ been the preferred access mode for linux. Are you saying
that it is not? Please explain!

Peter

"A month of sundays ago Andries.Brouwer@cwi.nl wrote:"
>
> People complain that the kernel reports
> hda: IB<-DTTA-351680, 16124MB w/462kB Cache, CHS=1024/255/63, UDMA
> for their large IDE disks.
> But 1024*255*63*512=8422686720, so the reported C/H/S describes
> only half of the disk.
>
> Conjectured sequence of events: the disk reports 16383,16,63;
> these numbers would have been recognized by the kernel,
> but unfortunately the user selected LBA, and the BIOS
> turned this geometry into 1024,255,63 which the kernel
> no longer recognizes. Now the fragment of ide.c:do_identify()
> in 2.0.36 or ide-disk.c:idedisk_setup() in 2.1.130
>
> /* Correct the number of cyls if the bios value is too small */
> if (drive->sect == drive->bios_sect && drive->head == drive->bios_head) {
> if (drive->cyl > drive->bios_cyl)
> drive->bios_cyl = drive->cyl;
> }
>
> does not update drive->bios_cyl since drive->head != drive->bios_head.
> So, I propose that the above fragment be changed into something like
>
> /* Set the cylinder count - the BIOS reported value may be too small */
> if (drive->bios_sect && drive->bios_head)
> drive->bios_cyl = capacity / (drive->bios_sect * drive->bios_head);
>
> where `capacity' is current_capacity(drive) in the 2.0.36 source,
> and idedisk_capacity(drive) in the 2.1.130 source.
>
> Andries
>
>
> -
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/