Subject: kern/9985: IDE controller should have a power hook
To: None <gnats-bugs@gnats.netbsd.org>
From: None <thorpej@zembu.com>
List: netbsd-bugs
Date: 04/26/2000 09:35:02
>Number:         9985
>Category:       kern
>Synopsis:       IDE controller should have a power hook
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 26 09:35:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Jason R. Thorpe
>Release:        April 25, 2000
>Organization:
Zembu Labs, Inc.
>Environment:
	
System: NetBSD dr-evil 1.4X NetBSD 1.4X (DR-EVIL) #11: Wed Apr 26 08:54:12 PDT 2000 thorpej@dr-evil:/u1/netbsd/src/sys/arch/i386/compile/DR-EVIL i386


>Description:
	On a Dell Inspiron 3800 laptop, a resume from suspend causes the
	IDE driver to downgrade transfer mode:

pciide0:0:0: lost interrupt
        type: ata tc_bcount: 3072 tc_skip: 0
pciide0:0:0: intr with DRQ (st=0x58)
wd0: transfer error, downgrading to Ultra-DMA mode 1
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 1 (using DMA data transfers)
wd0a: device timeout writing fsbn 259280 of 259280-259285 (wd0 bn 13127345; cn 13023 tn 2 sn 35), retrying
wd0: soft error (corrected)

	This could be avoided by catching APM suspends in a power hook,
	marking that the channel is busy, and waiting for the current
	transfer to finish before returning from the power hook.  Upon
	resume, the power hook would reset the controller (quietly :-),
	re-initialize any state, and then unfreeze the queue, allowing
	the queued up transfers to continue along.

>How-To-Repeat:
	Suspend and resume a Dell Inspiron 3800 laptop.  This is probably
	not isolated to this laptop model, but it may have been uncovered
	by the faster processor (this one is a 500MHz P-III; suspends happen
	quite quickly).

>Fix:
	Not supplied.  I will likely not have time to implement this,
	but I would be happy to test any code that Manuel writes :-)
>Release-Note:
>Audit-Trail:
>Unformatted: