From 2ce4ee6a935c49f349042c223b991cd2be46e15d Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Tue, 13 Apr 2004 04:28:03 -0700 Subject: [PATCH] [PATCH] ide-disk.c: workaround for bogus LBA48 drives From: Geert Uytterhoeven 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 4f547ef3f9707..a316abaf74008 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -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) -- 2.53.0