Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25726
Modified Files:
gcn-di.c
Log Message:
Fix a case where original media accessed before a drive spin down would fail.
Index: gcn-di.c
===================================================================
RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/gcn-di.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- gcn-di.c 11 Jun 2005 22:51:15 -0000 1.4
+++ gcn-di.c 13 Jun 2005 22:55:45 -0000 1.5
@@ -1185,7 +1185,6 @@
mdelay(500);
}
-#if 0
/*
* Gets the current drive status.
*/
@@ -1202,7 +1201,6 @@
return drive_status;
}
-#endif
/*
* Enables the "privileged" command set.
@@ -1388,6 +1386,7 @@
static void di_spin_up_drive(struct di_device *ddev, u8 enable_extensions)
{
struct di_command cmd;
+ u32 drive_status;
/* first, make sure the drive is interoperable */
if (!(ddev->flags & DI_INTEROPERABLE)) {
@@ -1396,9 +1395,16 @@
/* this actually will reset and spin up the drive */
di_make_interoperable(ddev);
} else {
- /* assume enabled extensions */
- di_op_enableextensions(&cmd, ddev, enable_extensions);
- di_run_command_and_wait(&cmd);
+ /*
+ * We only re-enable the extensions if the drive is not
+ * in a peding read disk id state. Otherwise, we assume the
+ * drive has already accepted the disk.
+ */
+ drive_status = di_get_drive_status(ddev);
+ if (DI_STATUS(drive_status) != DI_STATUS_DISK_ID_NOT_READ) {
+ di_op_enableextensions(&cmd, ddev, enable_extensions);
+ di_run_command_and_wait(&cmd);
+ }
}
/* the spin motor command requires the privileged mode */
|