[5016] in RedHat Linux List
Re: 2.0.18 and Mitsumi CD-ROM
daemon@ATHENA.MIT.EDU (Michael K. Johnson)
Mon Nov 18 15:21:47 1996
To: redhat-list@redhat.com
From: "Michael K. Johnson" <johnsonm@redhat.com>
In-reply-to: Your message of "Sun, 17 Nov 1996 15:52:33 EST."
<XFMail.961117155421.cindybar@erols.com>
Date: Mon, 18 Nov 1996 15:13:09 -0500
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
Cindy Bartorillo writes:
>I tried recompiling the kernel. Disabled modules and compiled in
>the MCD driver and the MCDX driver (I don't know what this last
>one is, but it's Mitsumi, so I included it). With this setup I
>got an error message on bootup, and no improvement in CD usage.
Yeah, we install the kernel package off the cdrom, not the one
on the boot disk. In this case, that's not so good.
Here's the patch that I use; if you are comfortable patching the
kernel, go ahead and use this:
--- mcd.c.nodelay Fri Oct 25 14:44:07 1996
+++ mcd.c Wed Nov 13 11:10:16 1996
@@ -61,6 +61,10 @@
07 July 1995 Modifications by Andrew J. Kroll
Bjorn Ekwall <bj0rn@blox.se> added unregister_blkdev to mcd_init()
+
+ Michael K. Johnson <johnsonm@redhat.com> added retries on open
+ for slow drives which take a while to recognize that they contain
+ a CD.
*/
#include <linux/module.h>
@@ -1095,6 +1099,7 @@
mcd_open(struct inode *ip, struct file *fp)
{
int st;
+ int count = 0;
if (mcdPresent == 0)
return -ENXIO; /* no hardware */
@@ -1106,9 +1111,16 @@
mcd_invalidate_buffers();
- st = statusCmd(); /* check drive status */
- if (st == -1)
- return -EIO; /* drive doesn't respond */
+ do {
+ st = statusCmd(); /* check drive status */
+ if (st == -1)
+ return -EIO; /* drive doesn't respond */
+ if ((st & MST_READY) == 0) { /* no disk? wait a sec... */
+ current->state = TASK_INTERRUPTIBLE;
+ current->timeout = jiffies + HZ;
+ schedule();
+ }
+ } while (((st & MST_READY) == 0) && count++ < MCD_RETRY_ATTEMPTS);
if ((st & MST_READY) == 0) /* no disk in drive */
{
michaelkjohnson
"Ever wonder why the SAME PEOPLE make up ALL the conspiracy theories?"
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-Errata
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null