]> git.hungrycats.org Git - linux/commitdiff
[PATCH] ide-disk.c: workaround for bogus LBA48 drives
authorBartlomiej Zolnierkiewicz <b.zolnierkiewicz@elka.pw.edu.pl>
Tue, 13 Apr 2004 11:28:03 +0000 (04:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 13 Apr 2004 11:28:03 +0000 (04:28 -0700)
From: Geert Uytterhoeven <geert@linux-m68k.org>

Apparently some IDE drives (e.g. a pile of 80 GB ST380020ACE drives I have
access to) advertise to support LBA48, but don't, causing kernels that support
LBA48 (i.e. anything newer than 2.4.18, including 2.4.25 and 2.6.4) to fail on
them.  Older kernels (including 2.2.20 on the Debian woody CDs) work fine.

Check for id->lba_capacity_2 being non-zero in idedisk_supports_lba48().

drivers/ide/ide-disk.c

index 4f547ef3f970780bc4938962697d8b6efb028556..a316abaf74008efb74deb7bbf89378b03d8c25a6 100644 (file)
@@ -1068,7 +1068,8 @@ static inline int idedisk_supports_hpa(const struct hd_driveid *id)
  */
 static inline int idedisk_supports_lba48(const struct hd_driveid *id)
 {
-       return (id->command_set_2 & 0x0400) && (id->cfs_enable_2 & 0x0400);
+       return (id->command_set_2 & 0x0400) && (id->cfs_enable_2 & 0x0400)
+              && id->lba_capacity_2;
 }
 
 static inline void idedisk_check_hpa(ide_drive_t *drive)