From owner-freebsd-current Mon Apr 19 11: 0: 6 1999 Delivered-To: freebsd-current@freebsd.org Received: from spinner.netplex.com.au (spinner.netplex.com.au [202.12.86.3]) by hub.freebsd.org (Postfix) with ESMTP id 89AA215311 for ; Mon, 19 Apr 1999 10:59:58 -0700 (PDT) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by spinner.netplex.com.au (Postfix) with ESMTP id 49D401F5E; Tue, 20 Apr 1999 01:57:30 +0800 (WST) (envelope-from peter@netplex.com.au) X-Mailer: exmh version 2.0.2 2/24/98 To: John Hay Cc: dfr@nlsystems.com (Doug Rabson), current@freebsd.org Subject: Re: newbus and isa auto irq In-reply-to: Your message of "Sat, 19 Apr 1999 19:38:31 +0200." <199904191738.TAA97791@zibbi.mikom.csir.co.za> Date: Tue, 20 Apr 1999 01:57:30 +0800 From: Peter Wemm Message-Id: <19990419175732.49D401F5E@spinner.netplex.com.au> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 != ) 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