Subject: Re: LBA48_THRESHOLD
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Manuel Bouyer <>
List: tech-kern
Date: 01/16/2005 01:36:41
On Sat, Jan 15, 2005 at 02:27:12PM -0500, der Mouse wrote:
> > 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.
> I am inclined to doubt any such drives exist; manufacturers generally
> go for round *decimal* numbers of bytes, which means they tend to avoid
> round *binary* numbers of bytes.

Exept that in this case it's a limit of the interface. So they produced
drives with the maximum capacity the interface allows.
There are also a drives with highter capacity, which will announce this
capacity if a jumper is set. This allows larger drives to be functionnal
with legacy hardware/drivers.

> Also, is it possible to report a size of 0x10000000 through LBA?

Yes, it's a 32bit value.

> I
> would tend to doubt it, or the ST3200822A presumably would be doing it.

Or the ST3200822A firmware is buggy.

> Or am I missing something else?  (I readily admit there's a whole lot
> here I do not really understand, so this is fairly likely.)
> > However, instead of the quick, we could probably use the LBA sectors
> > reported to decide when to switch to LBA48, instead of the quirk.
> I'm not sure what you mean.  You mean,
> wd->sc-wdc_bio.blkno >= LBA-reported-size?

Yes. More specifically, I mean remplace
        if (wd->sc_flags & WDF_LBA48 &&
	    (wd->sc_wdc_bio.blkno > LBA48_THRESHOLD ||
	    (wd->sc_quirks & WD_QUIRK_FORCE_LBA48) != 0))
	if (wd->sc_flags & WDF_LBA48 &&
	    wd->sc_wdc_bio.blkno > LBA-reported-size)

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference