tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: WD_QUIRK_FORCE_LBA48



On Mon, Dec 14, 2009 at 04:27:51PM +0100, Manuel Bouyer wrote:
> On Sun, Dec 13, 2009 at 10:41:15PM +0000, Christoph Badura wrote:
> > -           (wd->sc_wdc_bio.blkno > LBA48_THRESHOLD ||
> > +           (wd->sc_wdc_bio.blkno +
> > +               wd->sc_wdc_bio.bcount / wd->sc_dk.dk_label->d_secsize >
> > +               LBA48_THRESHOLD ||
> 
> but please make this (LBA48_THRESHOLD + 1). Otherwise the last
> LBA24 sector will be inaccessible on non-LBA48 controllers.

As David pointed out the last addressable LBA28 sector is actually
0xFFFFFFE, c.f. 6.2.1. of ATA-ATAPI-6 spec[1].  Also, 6.2.2. of the spec
requires devices to return an error if an attempt is made to access
sector 0xFFFFFFFF.  So the check for > LBA48_THRESHOLD is correct.

> > @@ -1634,7 +1636,7 @@
> >         wd->sc_wdc_bio.blkno = blkno;
> >         wd->sc_wdc_bio.flags = ATA_POLL;
> >         if (wd->sc_flags & WDF_LBA48 &&
> > -           (blkno > LBA48_THRESHOLD ||
> > +           (blkno + nblks > LBA48_THRESHOLD ||
> >             (wd->sc_quirks & WD_QUIRK_FORCE_LBA48) != 0))
> >                 wd->sc_wdc_bio.flags |= ATA_LBA48;
> 
> This one should be OK to detect LBA48 drives that have a problem
> accessing the last LBA24 sector using LBA24 commands.

This one is in wddump() and it needs to work the same as the other one.

So, how do we go on.  Do I just commit the above or do I put put test kernels
for people to check?

--chris

[1] 
http://www.t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf


Home | Main Index | Thread Index | Old Index