]> git.hungrycats.org Git - linux/commitdiff
[PATCH] IDE: Fix request handling with ide-default & ATAPI
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 9 Sep 2003 05:09:32 +0000 (22:09 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 9 Sep 2003 05:09:32 +0000 (22:09 -0700)
This fixes a bug that happens when a request gets to the IDE layer for a
drive using ide-default (that is with no subdriver attached), like a
Power Management request.  In this case, the core will wait for the
device status to match drive->read_stat, but that field contains by
default a value that is not suitable for ATAPI devices.  This patch
fixes it.

drivers/ide/ide-default.c

index 0c251121a7407bbe9c4cd007b6c4f46994cfc07d..b16a4b42e5ccee0912becce3d9ab87183d33499e 100644 (file)
@@ -57,6 +57,14 @@ static int idedefault_attach (ide_drive_t *drive)
                        "driver with ide.c\n", drive->name);
                return 1;
        }
+       
+       /* For the sake of the request layer, we must make sure we have a
+        * correct ready_stat value, that is 0 for ATAPI devices or we will
+        * fail any request like Power Management
+        */
+       if (drive->media != ide_disk)
+               drive->ready_stat = 0;
+
        return 0;
 }