Skip to contentSkip to conversation

IDE: Fix request handling with ide-default & ATAPI

PATCH New Benjamin Herrenschmidt 1 participant 1 message Sep 9, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IDE: Fix request handling with ide-default & ATAPI

Hi Bart & Linus !

This patch 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.

Linus, please apply (already validated with Bart)

drivers/ide/ide-default.c +8 -0
diff -urN linux-2.5/drivers/ide/ide-default.c linuxppc-2.5-benh/drivers/ide/ide-default.c
@@ -57,6 +57,14 @@
 			"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;
 }