From owner-freebsd-current Fri Nov 12 2: 5:14 1999 Delivered-To: freebsd-current@freebsd.org Received: from herring.nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (Postfix) with ESMTP id DEF5814BDC for ; Fri, 12 Nov 1999 02:05:07 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id KAA38677; Fri, 12 Nov 1999 10:07:02 GMT (envelope-from dfr@nlsystems.com) Date: Fri, 12 Nov 1999 10:07:02 +0000 (GMT) From: Doug Rabson To: Mark Newton Cc: peter.jeremy@alcatel.com.au, current@freebsd.org Subject: Re: panic: nexus_setup_intr: NULL irq resource! In-Reply-To: <199911120214.MAA21794@gizmo.internode.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 12 Nov 1999, Mark Newton wrote: > Peter Jeremy wrote: > > > Since your patch effectively turns isa_setup_intr() into a nop for > > this case, a better patch would seem to be to skip the call to > > BUS_SETUP_INTR() (and presumably bus_alloc_resource()) at the end > > of sioattach() when you're attaching a slave SIO port. > > Absolutely true. :-) Something like this should work: Index: sio.c =================================================================== RCS file: /home/ncvs/src/sys/isa/sio.c,v retrieving revision 1.273 diff -u -r1.273 sio.c --- sio.c 1999/10/28 05:06:12 1.273 +++ sio.c 1999/11/12 10:06:15 @@ -903,6 +903,7 @@ u_int flags = device_get_flags(dev); int rid; struct resource *port; + u_long junk; rid = 0; port = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, @@ -1112,12 +1113,19 @@ com->pps.ppscap = PPS_CAPTUREASSERT | PPS_CAPTURECLEAR; pps_init(&com->pps); - rid = 0; - com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1, - RF_SHAREABLE | RF_ACTIVE); - BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, - INTR_TYPE_TTY | INTR_TYPE_FAST, - siointr, com, &ih); + /* + * Only setup the irq if there is one (in multiport, only the + * master has an irq. + */ + if (bus_get_resource(dev, SYS_RES_IRQ, &junk, &junk) == 0) { + rid = 0; + com->irqres = bus_alloc_resource(dev, SYS_RES_IRQ, + &rid, 0ul, ~0ul, 1, + RF_SHAREABLE | RF_ACTIVE); + BUS_SETUP_INTR(device_get_parent(dev), dev, com->irqres, + INTR_TYPE_TTY | INTR_TYPE_FAST, + siointr, com, &ih); + } return (0); } -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 181 442 9037 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message