tech-kern archive

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


On Tue, Dec 15, 2009 at 05:25:47PM +0100, Christoph Badura wrote:
> On Tue, Dec 15, 2009 at 10:35:37AM +0100, Manuel Bouyer wrote:
> > ATA up to and including ATA6 says that words 60-61 shall be less than
> > or equal to 0x10000000. ATA7 made this 0xfffffff (no idea why)
> > which means that the last sector effectively addressable by LBA28
> > effectively decreased by one sector between ATA6 and ATA7.
> Yes, however, the sector 0xfffffff is accessible via LBA48 on drives that
> support LBA48.
> The check I proposed in the patch effectively is:
> if (drive supports LBA48) {
>       if (transfer accesses sectors beyond 0xffffffe)
>               use LBA48 transfer;

but that's wrong, for some drives 0xffffffe should be 0xfffffff

> }
> else
>       use LBA28 transfer;
> So, for non-LBA48 drives all 2^28 sectors are accessible in LBA28 mode.
> But for LBA48 drives only 2^28-1 in LBA28 mode and the rest in LBA48 mode.
> All the version of the ATA-5/6 specs I looked at demand that a drive
> fail a transfer that goes beyond the last user accessible sector as reported
> in word 60:61 in LBA28 mode.  Hence we can't rely on accessing that last
> sector when only LBA28 mode is feasible and the drive reports the limit
> as 0xfffffff.

Sure. But some drives report it as 0x10000000. This is why I suggest
using the content of word 60:61 instead of a constant.

> > I just figured that the best way to handle this is probably to use
> > the content of words 60-61 as the LBA48 boundary then.
> I think that is unecessary.  Because in sectors 0 to 0xffffffe are accessible
> in LBA48 mode, too.  It is only important to use LBA48 commands for the
> sectors above the boundary.  But below the boundary LBA48 and LBA28 both
> will work.

Sure, but I can't see how it relates to what I proposed ?

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

Home | Main Index | Thread Index | Old Index