diff options
author | Elias Oltmanns <eo@nebensachen.de> | 2009-04-01 17:05:08 +0000 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2009-04-27 10:36:51 -0700 |
commit | eddabbbaa0f368e82e2a9ee26fa5610df722ac10 (patch) | |
tree | 7ef094e1c0dce0291390b3aa4eb0a9ca9eaa39e8 | |
parent | a30c3616547f64cb4d2de780dc8854202a5e8355 (diff) |
ide: Fix code dealing with sleeping devices in do_ide_request()
upstream commit: 9010941c5483a7a5bb1f7d97ee62491fb078bb51
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.
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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r-- | drivers/ide/ide-io.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index a9a6c208288..af7077765d5 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c @@ -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) && |