From owner-freebsd-arch@FreeBSD.ORG Fri Jan 2 08:31:41 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9793616A4CE for ; Fri, 2 Jan 2004 08:31:41 -0800 (PST) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id C372643D2D for ; Fri, 2 Jan 2004 08:31:39 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 3184 invoked from network); 2 Jan 2004 16:31:39 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 2 Jan 2004 16:31:39 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i02GVNM0002423; Fri, 2 Jan 2004 11:31:23 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20040101.033444.103565788.imp@bsdimp.com> Date: Fri, 02 Jan 2004 11:31:23 -0500 (EST) From: John Baldwin To: "M. Warner Losh" X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp) cc: rosti_bsd@yahoo.com cc: freebsd-arch@freebsd.org Subject: Re: IRQ 2 problem X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jan 2004 16:31:41 -0000 On 01-Jan-2004 M. Warner Losh wrote: > In message: <1072952198.3233.24.camel@herring.nlsystems.com> > Doug Rabson writes: >: On Wed, 2003-12-31 at 20:25, M. Warner Losh wrote: >: > In message: >: > John Baldwin writes: >: > : >: > : On 31-Dec-2003 Rostislav Krasny wrote: >: > : > --- "M. Warner Losh" wrote: >: > : >> In message: <20031230.190927.108191769.imp@bsdimp.com> >: > : >> "M. Warner Losh" writes: >: > : >> : The reason that it iasn't been committed is because it is >: > : >> incorrect. >: > : >> : >: > : >> : >: > : >> >: > : > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=15473+0+archive/2003/freebsd-arch/20030831.fre >: > : > ebsd-ar >: > : > ch >: > : >> : >: > : >> : has the particulars. >: > : >> >: > : >> Does your machine have an APIC? My laptop doesn't seem to exhibit >: > : >> the problem. >: > : > >: > : > No, it doesn't seem to have an APIC. This is Pentium MMX 200MHz machine >: > : > based on Intel's 430TX chipset. >: > : > >: > : > What is the correct way to fix this IRQ 2 problem? I can help to test it. >: > : >: > : IRQ 2 in FreeBSD is spelled IRQ 9. If a PNP device wants to use IRQ 2, it >: > : can be set to IRQ 2 in hardware, but it must use IRQ 9 when doing the >: > : bus_alloc_resource() and bus_setup_intr(). >: > >: > Actually the problem appears to be that the hardware wants 9 too. '2' >: > shouldn't be used at all, nor given out in allocation when we're using >: > AT PIC because that's the chaining IRQ. That's the current problem. >: > Eg, the isa bus is handing out '2' when it has no buisness doing so. >: >: The original fix for this which has been lost over the years was to >: exclude IRQ2 from the set of available interrupts. When the PnP code >: attempted to allocate an irq for the device, it would try for 2, not get >: it and settle for 9. >: >: At some point, IRQ2 was added back into the set but the PIC driver was >: fixed to allocate IRQ2 itself as early as possible. This matches the way >: the hardware is wired together and has a certain 'rightness' to it. >: Unfortunately the PIC driver doesn't seem to allocate IRQ2 for itself >: any more which makes it available for broken PnP devices. > > It looks like IRQ2 isn't registered as an interrupt source, so when we > create the resource map, it looks like we skip it and shouldn't be > handing it out... Yes, it doesn't exist as a valid IRQ in the irq map anymore. Oh, but you know what, the resource manager is really buggy in this respect. For example, on my system here: Interrupt request lines: 0x0 (root0) 0x1 (atkbd0) 0x2 (root0) 0x3 (sio1) 0x4 (sio0) 0x5-0x8 (root0) 0x9 (acpi0) 0xa-0xb (root0) 0xc (psm0) 0xd (npx0) 0xe (ata0) 0xf (ata1) 0x10 (uhci0) 0x11 (sis0) 0x12 (uhci2) 0x13 (uhci1) 0x14 (fxp0) 0x15-0x17 (root0) Note that the nexus didn't add IRQ 2 as a possible resource, but the resource manager went ahead and added it anyway when the adjacent regions were added. Someone should fix the resource manager code perhaps. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/