Subject: Re: Missing atapibus target 1
To: Gary Duzan <gary@duzan.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: current-users
Date: 10/14/2003 22:44:53
--6c2NcOVqGQ03X4Wi
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Tue, Oct 14, 2003 at 07:59:12AM -0400, Gary Duzan wrote:
> In Message <20031013200141.GD2781@antioche.eu.org> ,
>    Manuel Bouyer <bouyer@antioche.eu.org> wrote:
> 
> =>On Sun, Oct 12, 2003 at 10:52:30PM -0400, Gary Duzan wrote:
> =>> pciide0:1:0: after reset, sc=0x1 sn=0x1 cl=0x14 ch=0xeb
> =>> pciide0:1:1: after reset, sc=0x7f sn=0x7f cl=0x7f ch=0x7f
> =>
> =>OK, so we have the same thing here.
> =>Hum, I don't know why charles added this 0x7f mask in the code here; probably
> =>because his CD behaves the same way, and he found his laptop would boot
> =>quickier this way.
> =>Can you try the attached patch ?
> 
>    Here it is with the patch. Still no wd1:
> 
> ===========================================================================
> viaide0 at pci0 dev 9 function 0
> viaide0: NVIDIA nForce2 IDE Controller (rev. 0xa2)
> viaide0: bus-master DMA support present
> viaide0: primary channel configured to compatibility mode
> viaide0: primary channel interrupting at irq 14
> atabus0 at viaide0 channel 0
> viaide0: secondary channel configured to compatibility mode
> viaide0: secondary channel interrupting at irq 15
> atabus1 at viaide0 channel 1
> [ ... ]
> viaide0:0: before reset, st0=0x50, st1=0x0
> viaide0:1: before reset, st0=0x50, st1=0x50
> viaide0:1:0: after reset, sc=0x1 sn=0x1 cl=0x14 ch=0xeb
> viaide0:1:1: after reset, sc=0x7f sn=0x7f cl=0x7f ch=0x7f
> viaide0:1: wdcwait_reset() end, st0=0x0 er0=0x1, st1=0x7f er1=0x7f

Sorry, I forgot another test. Please try attached patch.

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

--6c2NcOVqGQ03X4Wi
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.140
diff -u -r1.140 wdc.c
--- wdc.c	2003/10/12 19:28:50	1.140
+++ wdc.c	2003/10/14 20:43:24
@@ -618,9 +618,9 @@
 		    chp->wdc ? chp->wdc->sc_dev.dv_xname : "wdcprobe",
 		    chp->channel, st0, st1), DEBUG_PROBE);
 
-		if ((st0 & 0x7f) == 0x7f || st0 == WDSD_IBM)
+		if (st0 == 0xff || st0 == WDSD_IBM)
 			ret_value &= ~0x01;
-		if ((st1 & 0x7f) == 0x7f || st1 == (WDSD_IBM | 0x10))
+		if (st1 == 0xff || st1 == (WDSD_IBM | 0x10))
 			ret_value &= ~0x02;
 		/* Register writability test, drive 0. */
 		if (ret_value & 0x01) {
@@ -1188,8 +1188,6 @@
 end:
 	if (er0 != 0x01 && er0 != 0x81)
 		drv_mask &= ~0x01;
-	if (er1 != 0x01)
-		drv_mask &= ~0x02;
 	WDCDEBUG_PRINT(("%s:%d:0: after reset, sc=0x%x sn=0x%x "
 	    "cl=0x%x ch=0x%x\n",
 	     chp->wdc ? chp->wdc->sc_dev.dv_xname : "wdcprobe",

--6c2NcOVqGQ03X4Wi--