Re: cdu31a cdrom-driver

Marty Leisner (leisner@sdsp.mc.xerox.com)
Fri, 10 Jul 1998 10:45:25 PDT


In message <98070912434702.03216@z2.n2480.f898.fidonet.org>, you write:
>On Wed, 08 Jul 1998, Marty Leisner wrote:
>
>>It hasn't worked in 2.1 for a long time...I posted some patches
>>several months ago (actually, I just enabled some debugging, which
>>must have effected the timing) and it worked consistently then...
>
> The same here.... adding some printk's does the trick. But why?
> I'm investigating this problem.
> BTW: Interrupts don't work here even with the printk's... It seems
> like the driver is waiting for interrupts that never arrive...
>
>--
>
>Servus,
> Daniel
>
>-

Here's my experience...

This is new:

Jul 9 23:02:33 compaq kernel: Uniform CD-ROM driver Revision: 2.12
Jul 9 23:02:44 compaq kernel: CDU31A: Invalid block status: 0x0
Jul 9 23:02:44 compaq kernel: cdu31a: Resetting drive on error
Jul 9 23:02:51 compaq kernel: CDU31A: unknown 0x03 error for block 68, nblock

Afterwards, it hung in mount (for several minutes...I had to reboot...
(kill -9 didn't work).

I'm using 2.1.108.

Previous versions responding after a long time (~1 minute) with
"mount failed"

The following patches (don't ask me to explain them) allows a mount
and to read the cdrom:

--- cdu31a.c 1998/06/14 20:54:13 1.1
+++ cdu31a.c 1998/06/14 20:55:21
@@ -864,7 +864,7 @@
}
if (is_busy() || (!(is_result_ready())))
{
-#if DEBUG
+#if 1
printk("CDU31A timeout out %d\n", __LINE__);
#endif
result_buffer[0] = 0x20;
@@ -923,7 +923,7 @@
}
if (!is_result_ready())
{
-#if DEBUG
+#if 1
printk("CDU31A timeout out %d\n", __LINE__);
#endif
result_buffer[0] = 0x20;
@@ -952,7 +952,7 @@
}
if (!is_result_ready())
{
-#if DEBUG
+#if 1
printk("CDU31A timeout out %d\n", __LINE__);
#endif
result_buffer[0] = 0x20;
@@ -1034,7 +1034,7 @@
}
if (is_busy())
{
-#if DEBUG
+#if 1
printk("CDU31A timeout out %d\n", __LINE__);
#endif
result_buffer[0] = 0x20;
@@ -1090,7 +1090,7 @@
volatile int val;


-#if 0*DEBUG
+#if DEBUG
printk("Entering handle_sony_cd_attention\n");
#endif
if (is_attention())
@@ -1171,7 +1171,7 @@
}

num_consecutive_attentions = 0;
-#if 0*DEBUG
+#if DEBUG
printk("Leaving handle_sony_cd_attention at %d\n", __LINE__);
#endif
return(0);
@@ -1328,7 +1328,7 @@
#endif
return(0);
}
-#if DEBUG
+#if DEBUG || 1
printk("Leaving start_request at %d\n", __LINE__);
#endif
}
@@ -1586,7 +1586,7 @@
}
else
{
-#if DEBUG
+#if DEBUG || 1
printk("CDU31A timeout out %d\n", __LINE__);
#endif
res_reg[0] = 0x20;
@@ -1611,7 +1611,7 @@

if (!is_result_ready())
{
-#if DEBUG
+#if DEBUG || 1
printk("CDU31A timeout out %d\n", __LINE__);
#endif
res_reg[0] = 0x20;
@@ -1840,7 +1840,7 @@
new one. */
else if (block != sony_next_block)
{
-#if DEBUG
+#if DEBUG || 1
printk("CDU31A Warning: Read for block %d, expected %d\n",
block,
sony_next_block);
@@ -1977,14 +1977,14 @@
No need to check session 0, since session 0 is the same as session
1; the command returns different information if you give it 0.
*/
-#if DEBUG
+#if DEBUG || 1
memset(&sony_toc, 0x0e, sizeof(sony_toc));
memset(&single_toc, 0x0f, sizeof(single_toc));
#endif
session = 1;
while (1)
{
-#if DEBUG
+#if DEBUG || 1
printk("Trying session %d\n", session);
#endif
parms[0] = session;
@@ -1994,7 +1994,7 @@
res_reg,
&res_size);

-#if DEBUG
+#if DEBUG || 1
printk("%2.2x %2.2x\n", res_reg[0], res_reg[1]);
#endif

@@ -2003,7 +2003,7 @@
/* An error reading the TOC, this must be past the last session. */
break;
}
-#if DEBUG
+#if DEBUG || 1
printk("Reading session %d\n", session);
#endif

@@ -2023,7 +2023,7 @@
set. */
return;
}
-#if DEBUG
+#if DEBUG
printk("add0 %01x, con0 %01x, poi0 %02x, 1st trk %d, dsktyp %x, dum0 %x\n",
single_toc.address0, single_toc.control0, single_toc.point0,
bcd_to_int(single_toc.first_track_num), single_toc.disk_type, single_toc.dummy0);
@@ -2097,8 +2097,6 @@
single_toc.dummyc0[5],
single_toc.dummyc0[6]);
#endif
-#undef DEBUG
-#define DEBUG 0

sony_toc.lead_out_start_msf[0] = bcd_to_int(single_toc.lead_out_start_msf[0]);
sony_toc.lead_out_start_msf[1] = bcd_to_int(single_toc.lead_out_start_msf[1]);

After this, a mount does:

Uniform CD-ROM driver Revision: 2.12
Trying session 1
00 00
Reading session 1
Trying session 2
20 11
VFS: Disk change detected on device 0f:00
CDU31A Warning: Read for block 68, expected 66
CDU31A Warning: Read for block 424, expected 70

marty

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html