Skip to contentSkip to conversation

[2.4.23][patch]no DRQ after issuing WRITE

PATCH Daniel Tram Lux 1 participant 1 message Dec 15, 2003

lore
Share & tools
lore
#0 lore raw

Hi,

basically same patch as for 2.6.0-test 11

against following problem:

hda: no DRQ after issuing WRITE
ide0: reset: success
hda: status timeout: status=0xd0 { Busy }

Regards
Daniel Lux

drivers/ide/ide-iops.c 2003-12-15 19:55:33.000000000 +0100 renamed from drivers/ide/ide-iops.c 2003-12-15 14:32:39.000000000 +0100 +14 -4
@@ -664,12 +664,22 @@
        if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) {
                local_irq_set(flags);
                timeout += jiffies;
-               while ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) {
+               stat = hwif->INB(IDE_STATUS_REG);
+               while (stat & BUSY_STAT) {
                        if (time_after(jiffies, timeout)) {
-                               local_irq_restore(flags);
-                               *startstop = DRIVER(drive)->error(drive, "status timeout", stat);
-                               return 1;
+                               /*
+                                * do one more status read in case we were interrupted between last
+                                * stat = hwif->INB(IDE_STATUS_REG) and time_after(jiffies, timeout)
+                                * in wich case the timeout might have been shorter than specified.
+                                */
+                               if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) {
+                                       local_irq_restore(flags);
+                                       *startstop = DRIVER(drive)->error(drive, "status timeout", stat);
+                                       return 1;
+                               }
                        }
+                       else
+                               stat = hwif->INB(IDE_STATUS_REG);
                }
                local_irq_restore(flags);
        }