aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
authorSuleiman Souhlal <suleiman@google.com>2007-03-26 17:03:20 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-03-26 17:03:20 -0400
commit513daadd152ddbf32cb6d0447ddba3427ce5b8e8 (patch)
tree994549525a3830b496af552dee1fd73227f36373 /drivers/ide/ide-iops.c
parent362ebd83adb4ff2761b6f49a3570f501c3c7e467 (diff)
ide: use correct IDE error recovery
IDE error recovery is using IDLE IMMEDIATE if the drive is busy or has DRQ set. This violates the ATA spec (can only send IDLE IMMEDIATE when drive is not busy) and really hoses up some drives (modern drives will not be able to recover using this error handling). The correct thing to do is issue a SRST followed by a SET FEATURES command. This is what Western Digital recommends for error recovery and what Western Digital says Windows does.  It also does not violate the ATA spec as far as I can tell. Bart: * port the patch over the current tree * undo the recalibration code removal * send SET FEATURES command after checking for good drive status * don't check whether the current request is of REQ_TYPE_ATA_{CMD,TASK} type because we need to send SET FEATURES before handling any requests * some pre-ATA4 drives require INITIALIZE DEVICE PARAMETERS command before other commands (except IDENTIFY) so send SET FEATURES only if there are no pending drive->special requests * update comments and patch description * any bugs introduced by this patch are mine and not Suleiman's :-) Signed-off-by: Suleiman Souhlal <suleiman@google.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r--drivers/ide/ide-iops.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 5523c52fee7..1ee53a551c3 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -1094,6 +1094,9 @@ static void pre_reset(ide_drive_t *drive)
1094 if (HWIF(drive)->pre_reset != NULL) 1094 if (HWIF(drive)->pre_reset != NULL)
1095 HWIF(drive)->pre_reset(drive); 1095 HWIF(drive)->pre_reset(drive);
1096 1096
1097 if (drive->current_speed != 0xff)
1098 drive->desired_speed = drive->current_speed;
1099 drive->current_speed = 0xff;
1097} 1100}
1098 1101
1099/* 1102/*