Update of /cvsroot/gc-linux/linux/drivers/block/gcn-di
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28670
Modified Files:
gcn-di.c
Log Message:
Added missing header for plaform related definitions (aa must for 2.6.15).
Fixed a race introduced by latest reordering of code.
Accept by default discs built using cubeboot-tools.
Index: gcn-di.c
===================================================================
RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-di/gcn-di.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- gcn-di.c 14 Nov 2005 19:38:41 -0000 1.11
+++ gcn-di.c 20 Nov 2005 20:23:04 -0000 1.12
@@ -23,6 +23,7 @@
#include <linux/delay.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
+#include <linux/platform_device.h>
#include <linux/blkdev.h>
#include <linux/fcntl.h>
#include <linux/hdreg.h>
@@ -1479,7 +1480,8 @@
di_op_readdiskid(&cmd, ddev, &disk_id);
di_run_command_and_wait(&cmd);
if (di_command_ok(&cmd)) {
- if (disk_id.id[0] && !di_accept_gods) {
+ if (disk_id.id[0] && strcmp(disk_id.id, "GBLPGL") &&
+ !di_accept_gods) {
di_print_disk_id(&disk_id);
di_printk(KERN_ERR, "sorry, gamecube media"
" support is disabled\n");
@@ -1651,6 +1653,21 @@
goto out;
}
+ /*
+ * If we have a pending command, that's a previously scheduled
+ * motor off. Wait for it to terminate before going on.
+ */
+ spin_lock_irqsave(&ddev->lock, flags);
+ if (ddev->cmd && ddev->ref_count == 0) {
+ cmd = ddev->cmd;
+ cmd->done_data = &complete;
+ cmd->done = di_wait_done;
+ spin_unlock_irqrestore(&ddev->lock, flags);
+ wait_for_completion(&complete);
+ } else {
+ spin_unlock_irqrestore(&ddev->lock, flags);
+ }
+
/* this will take care of validating the media */
check_disk_change(inode->i_bdev);
if (!ddev->nr_sectors) {
@@ -1667,19 +1684,6 @@
goto out_unlock;
}
- /*
- * If we have a pending command, that's a previously scheduled
- * motor off. Wait for it to terminate before going on.
- */
- if (ddev->cmd && ddev->ref_count == 0) {
- cmd = ddev->cmd;
- cmd->done_data = &complete;
- cmd->done = di_wait_done;
- spin_unlock_irqrestore(&ddev->queue_lock, flags);
- wait_for_completion(&complete);
- spin_lock_irqsave(&ddev->queue_lock, flags);
- }
-
if ((filp->f_flags & O_EXCL))
ddev->ref_count = -1;
else
|