diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-01-04 16:03:48 +0000 |
commit | 78c388aed2b7184182c08428db1de6c872d815f5 (patch) | |
tree | 4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /drivers/cdrom/sbpcd.c | |
parent | eb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff) |
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'drivers/cdrom/sbpcd.c')
-rw-r--r-- | drivers/cdrom/sbpcd.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/cdrom/sbpcd.c b/drivers/cdrom/sbpcd.c index 11b99e645..8c7592146 100644 --- a/drivers/cdrom/sbpcd.c +++ b/drivers/cdrom/sbpcd.c @@ -336,6 +336,7 @@ #include <linux/string.h> #include <linux/vmalloc.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <asm/system.h> #include <asm/io.h> @@ -842,8 +843,7 @@ static void sbp_sleep(u_int time) { sti(); current->state = TASK_INTERRUPTIBLE; - current->timeout = jiffies + time; - schedule(); + schedule_timeout(time); sti(); } /*==========================================================================*/ @@ -1487,13 +1487,14 @@ static int cmd_out(void) if (flags_cmd_out&f_putcmd) { + unsigned long flags; for (i=0;i<7;i++) sprintf(&msgbuf[i*3], " %02X", drvcmd[i]); msgbuf[i*3]=0; msg(DBG_CMD,"cmd_out:%s\n", msgbuf); - cli(); + save_flags(flags); cli(); for (i=0;i<7;i++) OUT(CDo_command,drvcmd[i]); - sti(); + restore_flags(flags); } if (response_count!=0) { @@ -4824,7 +4825,7 @@ static void DO_SBPCD_REQUEST(void) INIT_REQUEST; req=CURRENT; /* take out our request so no other */ CURRENT=req->next; /* task can fuck it up GTL */ - sti(); + spin_unlock_irq(&io_request_lock); /* FIXME!!!! */ down(&ioctl_read_sem); if (req->rq_status == RQ_INACTIVE) @@ -4869,6 +4870,7 @@ static void DO_SBPCD_REQUEST(void) xnr, req, req->sector, req->nr_sectors, jiffies); #endif sbpcd_end_request(req, 1); + spin_lock_irq(&io_request_lock); /* FIXME!!!! */ goto request_loop; } @@ -4908,6 +4910,7 @@ static void DO_SBPCD_REQUEST(void) xnr, req, req->sector, req->nr_sectors, jiffies); #endif sbpcd_end_request(req, 1); + spin_lock_irq(&io_request_lock); /* FIXME!!!! */ goto request_loop; } } @@ -4922,6 +4925,7 @@ static void DO_SBPCD_REQUEST(void) #endif sbpcd_end_request(req, 0); sbp_sleep(0); /* wait a bit, try again */ + spin_lock_irq(&io_request_lock); /* FIXME!!!! */ goto request_loop; } /*==========================================================================*/ @@ -5098,13 +5102,11 @@ static int sbp_data(struct request *req) { msg(DBG_INF,"sbp_data: CDi_status timeout (timed_out_data) (%02X).\n", j); error_flag++; - break; } if (try==0) { msg(DBG_INF,"sbp_data: CDi_status timeout (try=0) (%02X).\n", j); error_flag++; - break; } if (!(j&s_not_result_ready)) { @@ -5119,10 +5121,10 @@ static int sbp_data(struct request *req) msg(DBG_INF, "CD contains no data tracks.\n"); else msg(DBG_INF, "sbp_data: DATA_READY timeout (%02X).\n", j); error_flag++; - break; } SBPCD_STI; - error_flag=0; + if (error_flag) break; + msg(DBG_000, "sbp_data: beginning to read.\n"); p = D_S[d].sbp_buf + frame * CD_FRAMESIZE; if (sbpro_type==1) OUT(CDo_sel_i_d,1); |