NEC CD-ROM problem...

Rainer Mager (
Tue, 27 Jun 1995 15:03:08 +0900 (JST)

Hello all,

After getting a new Dell Optiplex XMT 5120 and running into a
lot of problems with its CD ROM drive (NEC), I tracked down the
problem in the kernel to the place marked "/* HERE */" in the code
snipets below.
What happens is that it prints my debug message right before
the offending line, and then dies (hitting the reset button is the
only cure). This does not happen every time it reaches this line,
that is, I can use my CD ok, but if I access it too fast (read a
largeish file as fast as the computer can) it tends to die.
I tried to trace the 'insw' function, but it was made of nasty
macros in /usr/src/linux/include/asm-i386/io.h. After seeing those, I
didn't try to go any further.

I suspect the problem has to do with my CPU being a P120, and
perhaps being to fast in some cases. I say this for two reasons.
One, I've heard from other people with the same exact system (except
slower CPUs) with no problems. And two, the io.h file mentions stuff
about slowing down i/o.

So, if anyone who know things about this stuff could help I'd
really appreciate it. If I need to do more debugging, please tell me
and I'll do my best.

All of this debugging was done on the 1.2.10 kernel, but the
problem is there in 1.3.3 as well.

Thank you,

------------- /usr/src/linux/drivers/block/ide-cd.c ------------------
[...opening comments deleted...]

#if 1 /* "old" method */
#define OUT_WORDS(b,n) outsw (IDE_PORT (HD_DATA, dev->hwif), (b), (n))
#define IN_WORDS(b,n) insw (IDE_PORT (HD_DATA, dev->hwif), (b), (n))
#else /* "new" method -- should really fix each instance instead of this */
#define OUT_WORDS(b,n) output_ide_data(dev,b,(n)/2)
#define IN_WORDS(b,n) input_ide_data(dev,b,(n)/2)

[...code deleted...]

* Interrupt routine. Called when a read request has completed.
static void cdrom_read_intr (ide_dev_t *dev)
[...code deleted...]
/* Now loop while we still have data to read from the drive. */
while (sectors_to_transfer > 0)
[...code deleted...]
/* Read this_transfer sectors into the current buffer. */
while (this_transfer > 0)
printk (" -> "); /* MY DEBUGGING */
/* HERE */ IN_WORDS (rq->buffer, SECTOR_SIZE / 2);
rq->buffer += SECTOR_SIZE;
printk (" <-\n"); /* MY DEBUGGING */
printk (" <-\n"); /* MY DEBUGGING */

/* Done moving data!
Wait for another interrupt. */
ide_handler[dev->hwif] = cdrom_read_intr;
printk ("<- cdrom_read_intr\n"); /* MY DEBUGGING */
[ of code deleted...]


Rainer Mager FORE Systems Japan, Inc. Systems Engineer

3-1-4 Nishi-Shinjuku Headquarters:
Shinjuku-ku 174 Thorn Hill Road
Tokyo 160 Japan Warrendale, PA 15086-7535
TEL: 81-3-3346-2781 TEL: +1 412 772-6600
FAX: 81-3-3346-2782 FAX: +1 412 772-6500