Subject: Cranky PCMCIA CD-ROM drive on a Sony Vaio
To: None <>
From: Ken Hornstein <>
List: current-users
Date: 09/02/1998 00:01:36
So, as mentioned before, I've been playing around with NetBSD on a
Sony Vaio.  So far, it's been running well ... except for the PCMCIA
CD-ROM drive, which stubbornly has refused to work.

>From other clues on the net, I was convinced that it was an ATAPI
PCMCIA adapter (Linux knows about the CIS entry, which annoyingly
doesn't have the generic atapi code ... all it has is "NinjaATA").
However, when I hacked wdc_pcmcia.c to know about it, all I would
get is "wdc1: reset failed".

A billion kernel compiles and wdc.c iterations later, I figured
out what was happening.  It turns out that this "NinjaATA" PCMCIA
ATAPI card (which seems to be a TEAC card) only allows ONE reset
per insertion.  (By "reset" I mean toggling the ATA reset bit on
the controller).  You can reset it once fine, and it will do all
of the right things ...  however, reset it _more_ than once, and
it goes casters up, the status and error registers return ff, and
you can't do anything with it until you reboot/reinsert (I suspect
resetting the PCMCIA socket at this point would unstick it, but I
didn't try that).

Once I ifdef'd out all of the of wdcreset calls (other than the first
one), it came right up, and I was able to mount a CD-ROM off of the
drive without a problem.

So, now that we know that .... what's the right way to fix this
dang thing?  A quick look at Linux seems to show that it doesn't
do nearly the number of resets that we do ... you can tell it to
do a reset after the probe, but by default it doesn't.  And from
the research I did, it seems that Linux works just fine with the
drive "out of the box".  I know that people much smarter than I
have been hacking on the WDC driver far longer than I have, but
I'm wondering why we do so many resets ... and are they all necessary?
Yes, the card _should_ work when you do this,, but it seems that
we're one of the few OSs that do more than one wdcreset per "session",
so maybe we're doing the wrong thing here.

If they are necessary, would setting a flag in the wdc_softc saying,
essentially, "Don't reset this device all of the time" be the right
thing to do?  Or does anyone else have any better ideas?