Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 1999 01:57:30 +0800
From:      Peter Wemm <peter@netplex.com.au>
To:        John Hay <jhay@mikom.csir.co.za>
Cc:        dfr@nlsystems.com (Doug Rabson), current@freebsd.org
Subject:   Re: newbus and isa auto irq 
Message-ID:  <19990419175732.49D401F5E@spinner.netplex.com.au>
In-Reply-To: Your message of "Sat, 19 Apr 1999 19:38:31 %2B0200." <199904191738.TAA97791@zibbi.mikom.csir.co.za> 

next in thread | previous in thread | raw e-mail | index | archive | help
John Hay wrote:
[..]
> Apr 19 19:22:28 orca /kernel.doug: ppc0: interrupting at irq 7
> Apr 19 19:22:28 orca /kernel.doug: ed0 at port 0x280-0x29f on isa0
> Apr 19 19:22:28 orca /kernel.doug: ed0: address 00:00:c0:1d:43:db, type SMC82
    16/
> SMC8216C (16 bit) 
> Apr 19 19:22:28 orca /kernel.doug: Intel Pentium detected, installing workaro
    und
>  for F00F bug
> --------
> 
> > -			if (dvp->id_irq != (1 << isa_get_irq(dev)))
> > +			if (dvp->id_irq != (1 << isa_get_irq(dev))) {
> > +printf("isa_compat_probe: old irq=%d, new mask=%x, new irq=%d\n",
> > +       irq_get_irq(dev), dvp->id_irq, ffs(dvp->id_irq) - 1);
> >  				isa_set_irq(dev, ffs(dvp->id_irq) - 1);
> > +			}
> 
> I assume the irq_get_irq() should be isa_get_irq().
> 
> I have tried the patch that Luoqi posted and that works for me. Although
> even with that the the userconfig by booting with -c don't work. It just
> plain ignores what you do there.

An additional datapoint...  We have:

        dvp->id_maddr = (void *)isa_get_maddr(dev);
[..]
                void *maddr;
                isa_compat_alloc_resources(dev, &res);
                if (res.memory)  
                        maddr = rman_get_virtual(res.memory);
                else
                        maddr = 0;
                dvp->id_maddr = maddr;
                portsize = dvp->id_driver->probe(dvp);
                isa_compat_release_resources(dev, &res);
                if (portsize != 0) {
                        if (portsize > 0)
                                isa_set_portsize(dev, portsize);
                        if (dvp->id_iobase != isa_get_port(dev))
                                isa_set_port(dev, dvp->id_iobase);
                        if (dvp->id_irq != (1 << isa_get_irq(dev)))
                                isa_set_irq(dev, ffs(dvp->id_irq) - 1);
                        if (dvp->id_drq != isa_get_drq(dev))
                                isa_set_drq(dev, dvp->id_drq);
                        if (dvp->id_maddr != maddr)
                                isa_set_maddr(dev,
                                              (int) dvp->id_maddr - KERNBASE);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        if (dvp->id_msize != isa_get_msize(dev))
                                isa_set_msize(dev, dvp->id_msize);

There is the problem..  isa_compat_release_resources() is clearing the
hints.  The only reason it works for the other devices is things like:
                       if (dvp->id_iobase != isa_get_port(dev))
                                isa_set_port(dev, dvp->id_iobase);
.. ie: if (id_iobase != <freshly cleared value>)
          reset_hint(id_iobase);
.. etc.
This is not happening for the maddr stuff.   
I suspect this would do better:

                        if (portsize > 0)
                                isa_set_portsize(dev, portsize);
                        if (dvp->id_iobase >= 0)
                                isa_set_port(dev, dvp->id_iobase);
                        if (dvp->id_irq != 0)
                                isa_set_irq(dev, ffs(dvp->id_irq) - 1);
                        if (dvp->id_drq != -1)
                                isa_set_drq(dev, dvp->id_drq);
                        if (dvp->id_maddr != 0)
                                isa_set_maddr(dev,
                                              (int) dvp->id_maddr - KERNBASE);
                        if (dvp->id_msize != 0)
                                isa_set_msize(dev, dvp->id_msize);
I'm not sure about the "nothing" value for id_drq though, it might need to
be 0 - but that's a valid dma channel.

IMHO, isa_release_resources() clearing of the default values for the probe
hints is a timebomb...  I thought about adding a seperate store for the
"hint" values rather than using the id_foo[0] entries, and leaving the
tracked resource entries for alloc/free without risking the hints.

Cheers,
-Peter



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990419175732.49D401F5E>