Subject: Re: Strange 30-second pause with atabus1 on APM resume under NetBSD 3.0_BETA
To: Brian de Alwis <bsd@cs.ubc.ca>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-users
Date: 11/16/2005 21:02:31
--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Thu, Nov 10, 2005 at 11:47:04AM -0800, Brian de Alwis wrote:
> One unwelcome change noticed since upgrading to 3.0_BETA on my
> laptop is a 30-second pause when resuming from suspend.  This didn't
> happen previously under 2.x.
> 
> Following is an extract from my /var/log/messages with ATADEBUG
> and atadebug_mask=0xFFFF upon resuming.  You can see the 30-second
> wait for atabus1 -- but I don't have anything on atabus1!  I'm not
> sure why atabus0 and atabus1 have different things happening either.
> (Note: I stuck the "resuming done" printfs to see completion.)
> [...]

Hi,
can you try the attached patch (I have other changes in wdc.c so offset may
be wrong. The function to be patched is __wdcwait_reset()) ?
The reset function doesn't handle the case of a channel without device
connected ...

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--zhXaljGHf11kAtnf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: wdc.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/wdc.c,v
retrieving revision 1.230
diff -u -r1.230 wdc.c
--- wdc.c	29 Aug 2005 19:30:07 -0000	1.230
+++ wdc.c	16 Nov 2005 20:00:04 -0000
@@ -1055,6 +1048,10 @@
 				/* No master, slave is ready, it's done */
 				goto end;
 			}
+			if ((drv_mask & 0x02) == 0) {
+				/* No master, no slave: it's done */
+				goto end;
+			}
 		} else if ((drv_mask & 0x02) == 0) {
 			/* no slave */
 			if ((drv_mask & 0x01) != 0 && (st0 & WDCS_BSY) == 0) {

--zhXaljGHf11kAtnf--