From b3b3e8a6df90df506e4d23d8788df5594b50b176 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 26 Mar 2003 18:02:29 -0800 Subject: [PATCH] [PATCH] Avoid unknown IDE commands One from Jens - fix up the problems with older Samsung disks that don't abort unknown commands sometimes --- drivers/ide/ide-disk.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index ac03de8b8e4a5..e3da95e75367b 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -1098,6 +1098,7 @@ static inline int idedisk_supports_host_protected_area(ide_drive_t *drive) * in above order (i.e., if value of higher priority is available, * reset will be ignored). */ +#define IDE_STROKE_LIMIT (32000*1024*2) static void init_idedisk_capacity (ide_drive_t *drive) { struct hd_driveid *id = drive->id; @@ -1118,7 +1119,7 @@ static void init_idedisk_capacity (ide_drive_t *drive) drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect); drive->select.b.lba = 1; set_max_ext = idedisk_read_native_max_address_ext(drive); - if (set_max_ext > capacity_2) { + if (set_max_ext > capacity_2 && capacity_2 > IDE_STROKE_LIMIT) { #ifdef CONFIG_IDEDISK_STROKE set_max_ext = idedisk_read_native_max_address_ext(drive); set_max_ext = idedisk_set_max_address_ext(drive, set_max_ext); @@ -1145,7 +1146,7 @@ static void init_idedisk_capacity (ide_drive_t *drive) drive->select.b.lba = 1; } - if (set_max > capacity) { + if (set_max > capacity && capacity > IDE_STROKE_LIMIT) { #ifdef CONFIG_IDEDISK_STROKE set_max = idedisk_read_native_max_address(drive); set_max = idedisk_set_max_address(drive, set_max); -- 2.53.0