Commit 2ce4ee6a authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] ide-disk.c: workaround for bogus LBA48 drives

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().
parent 95299738
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment