Subject: Re: LBA48_THRESHOLD
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 01/15/2005 19:26:58
On Sat, Jan 15, 2005 at 11:41:11AM -0500, der Mouse wrote:
> I note in wd.c:
> 
> 
> #define LBA48_THRESHOLD         (0xfffffff)     /* 128GB / DEV_BSIZE */
> ...
>         /*
>          * This seagate drive seems to have issue addressing sector 0xfffffff
>          * (aka LBA48_THRESHOLD) in LBA mode. The workaround is to force
>          * LBA48
>          */
>         { "ST3200822A",
>           WD_QUIRK_FORCE_LBA48 },
> ...
>         if (wd->sc_flags & WDF_LBA48 &&
>             (wd->sc_wdc_bio.blkno > LBA48_THRESHOLD ||
>             (wd->sc_quirks & WD_QUIRK_FORCE_LBA48) != 0))
>                 wd->sc_wdc_bio.flags |= ATA_LBA48;
> 
> I note that the ST3200822A claims only 0x0fffffff sectors when viewed
> the LBA way, not 0x10000000, so it's not surprising that it doesn't
> like to be addressed the LBA way for a sector that, according to the
> LBA interface, is past the end of the drive.
> 
> Wouldn't it make more sense for the > to be >=?  ISTM the quirk could
> go away then.

No, because it could then break existing setups of drives supporting
LBA48, but with 0x10000000 sectors (so which don't need LBA48),
connected to controllers that don't handle LBA48.

However, instead of the quick, we could probably use the LBA sectors
reported to decide when to switch to LBA48, instead of the quirk.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--