Subject: Re: Secondary IDE channel no longer detected
To: None <current-users@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: current-users
Date: 10/12/2003 19:08:10
--KsGdsel6WgEHnImy
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

[ Sorry for being late on this; I've been busy in the last 2 weeks ]

On Fri, Sep 26, 2003 at 09:28:02PM -0500, Dave Huang wrote:
> On Fri, Sep 26, 2003 at 08:43:22PM +0200, Manuel Bouyer wrote:
> > Can you boot with wdcdebug_probe set to 0x10 ?
> 
> wdcdebug_mask, right?
> 
> It didn't show anything useful about wdc1; wdcprobe() was only being
> called for pciide. I added some printf()s to wdc_isa.c, and found that
> the call to bus_space_map() fails:
> 
> 	if (bus_space_map(ch.cmd_iot, ia->ia_io[0].ir_addr,
> 	    WDC_ISA_REG_NPORTS, 0, &ch.cmd_ioh))
> 		goto out;
> 
> ia->io[0].ir_addr is 0x170, and WDC_ISA_REG_NPORTS is 8, which looks
> correct to me. Perhaps the problem is that pciide is mapping those
> ports, and not unmapping them after it decides that it shouldn't
> control them?

Yes, that's the problem.
Can you try the attached patch ?

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

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

Index: pciide_common.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/pciide_common.c,v
retrieving revision 1.1
diff -u -r1.1 pciide_common.c
--- pciide_common.c	2003/10/08 11:51:59	1.1
+++ pciide_common.c	2003/10/12 17:07:05
@@ -865,6 +865,11 @@
 			    sc->sc_wdcdev.sc_dev.dv_xname, cp->name,
 			    failreason);
 			cp->wdc_channel.ch_flags |= WDCF_DISABLED;
+			bus_space_unmap(cp->wdc_channel.cmd_iot,
+			    cp->wdc_channel.cmd_ioh, cmdsize);
+			bus_space_unmap(cp->wdc_channel.ctl_iot,
+			    cp->wdc_channel.ctl_ioh, ctlsize);
+
 		}
 	}
 

--KsGdsel6WgEHnImy--