Skip to contentSkip to conversation

ide: Fix code dealing with sleeping devices in do_ide_request()

PATCH Applied Elias Oltmanns 2 participants 2 messages Mar 25, 2009 – Mar 26, 2009 libata

lore
Share & tools
lore
#0 lore raw

Unfortunately, I missed a catch when reviewing the patch committed as 201bffa4. Here is the fix to the currently broken handling of sleeping devices. In particular, this is required to get the disk shock protection code working again.

---
Applies to v2.6.29.

 drivers/ide/ide-io.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
drivers/ide/ide-io.c +4 -5
index a9a6c20..af70777 100644
@@ -736,11 +736,10 @@ repeat:
 		prev_port = hwif->host->cur_port;
 		hwif->rq = NULL;
 
-		if (drive->dev_flags & IDE_DFLAG_SLEEPING) {
-			if (time_before(drive->sleep, jiffies)) {
-				ide_unlock_port(hwif);
-				goto plug_device;
-			}
+		if (drive->dev_flags & IDE_DFLAG_SLEEPING &&
+		    time_after(drive->sleep, jiffies)) {
+			ide_unlock_port(hwif);
+			goto plug_device;
 		}
 
 		if ((hwif->host->host_flags & IDE_HFLAG_SERIALIZE) &&