Skip to content

Commit

Permalink
ide: Fix code dealing with sleeping devices in do_ide_request()
Browse files Browse the repository at this point in the history
Unfortunately, I missed a catch when reviewing the patch committed as
201bffa. 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.

Reported-by: Christian Thaeter <ct@pipapo.org>
Cc: stable@kernel.org
Signed-off-by: Elias Oltmanns <eo@nebensachen.de>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Elias Oltmanns authored and Bartlomiej Zolnierkiewicz committed Mar 31, 2009
1 parent e1c5024 commit 9010941
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions drivers/ide/ide-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,11 +481,10 @@ void do_ide_request(struct request_queue *q)
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) &&
Expand Down

0 comments on commit 9010941

Please sign in to comment.