Subject: wd driver and power management on a laptop
To: None <port-i386@NetBSD.ORG>
From: David Carrel <carrel@cisco.com>
List: port-i386
Date: 03/23/1995 13:23:13
I've gotten NetBSD running on my GATEWAY 2000 Liberty laptop, but I still
have one problem that is bugging me.  My original problems were that the wd
driver got confused whenever the machine came out of suspend mode or when
the disk spun down.  

I solved the problem for the first case by calling wdcunwedge() from
wdcintr() whenever wdc->sc_errors == WDIORETRIES - 1.  This reliably brings
me out of suspend mode.  (I use this opportunity to reset the clock too,
since I have no other indication that I have come out of suspend.)

However, if I don't go into suspend mode, but the disk spins down, I am
unable to restore the driver/controller/drive (??) to a working state.  The
symptoms are that wdcstart() is queing commands, but the drive/controller
is never interrupting so wdctimeout() is called with the ACTIVE flag set.
I have tried calling wdcunwedge() at this point, and I tried calling
wdcreset() and reinitializing the controller, but nothing works.

If someone who understands IDE controllers better than I, could give me
suggestions as to where to continue debugging this, I would greatly
appreciate it.  If anyone is really interested, I can give more details
about what I have done so far.

Thanks

Dave

P.S.  Does anyone know if there are standard BIOS calls for reading battery
levels.  After I get the drive controller working, having a battery tool
is my last "necessary" project for this baby.  I have SystemSoft BIOS.

P.P.S.  Having the idle loop in Locore.s call halt really saves on the
battery usage.  NetBSD seems to run about 50% longer on a single charge
than DOS does.  And DOS is spinning down the disk, whereas under NetBSD, I
have a process running to keep the disk from spinning down.