From owner-freebsd-current@FreeBSD.ORG Fri Jun 6 12:04:45 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 744AD37B401 for ; Fri, 6 Jun 2003 12:04:45 -0700 (PDT) Received: from mail.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id B937643FA3 for ; Fri, 6 Jun 2003 12:04:44 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 3718 invoked from network); 6 Jun 2003 19:04:44 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 6 Jun 2003 19:04:44 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h56J4gp0014454; Fri, 6 Jun 2003 15:04:42 -0400 (EDT) (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: <20030606.123654.96603092.imp@bsdimp.com> Date: Fri, 06 Jun 2003 15:04:43 -0400 (EDT) From: John Baldwin To: "M. Warner Losh" cc: current@FreeBSD.org Subject: Re: [PATCH] Tweak re-routing of PCI interrupts X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2003 19:04:45 -0000 On 06-Jun-2003 M. Warner Losh wrote: > In message: > John Baldwin writes: >: I have a small tweak to the PCI code that re-routes PCI interrupts. >: Basically, it does two things, 1) make the comment less ia64-specific >: and 2) if the interrupt route returns an invalid IRQ (i.e. 255), then >: we don't change the intline. In other words, if we can't route the >: interrupt, we just assume that the firmware knows more than we do and >: go with the value it stuck in the register. 1) is a no-brainer, but >: I wonder what people think about 2). Patch below: > > I think #2 isn't so good. #1 is a no-brainer :-) > >: #if ... > ... >: + irq = PCIB_ROUTE_INTERRUPT(pcib, dev, cfg->intpin); >: + if (PCI_INTERRUPT_VALID(irq)) >: + cfg->intline = irq; >: + else >: #endif >: + irq = cfg->intline; >: + resource_list_add(rl, SYS_RES_IRQ, 0, irq, irq, 1); >: } >: } > > The part I don't like is that if we can't route an interrupt, we > assume that the interrupt that was written there before is good and > routed. This strikes me as an unwise assumption. I don't strongly disagree. Hence my request for comments. I've been of both minds on this one and just want to see what the consensus is. > Also, we haven't > recorded our info in the underlying pci register. Don't know if that > will matter for other OSes that are booted after we are. Don't think it matters as far as reboots, but I do think that this code should write the updated intpin to the actual config register. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/