From owner-freebsd-current@FreeBSD.ORG Fri Jun 6 12:20:05 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 9E81D37B48B; Fri, 6 Jun 2003 12:20:05 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2592B43FBD; Fri, 6 Jun 2003 12:20:03 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.8/8.12.3) with ESMTP id h56JIdkA041456; Fri, 6 Jun 2003 13:18:39 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 06 Jun 2003 13:18:25 -0600 (MDT) Message-Id: <20030606.131825.130842849.imp@bsdimp.com> To: ticso@cicely.de, ticso@cicely12.cicely.de From: "M. Warner Losh" In-Reply-To: <20030606191316.GB1290@cicely12.cicely.de> References: <20030606.123654.96603092.imp@bsdimp.com> <20030606191316.GB1290@cicely12.cicely.de> X-Mailer: Mew version 2.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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:20:06 -0000 In message: <20030606191316.GB1290@cicely12.cicely.de> Bernd Walter writes: : On Fri, Jun 06, 2003 at 12:36:54PM -0600, 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. Also, we haven't : : Unless you find a reliable way to ask the BIOS how the board is wired, : whatelse would you do than trust the inline register? $PIR table does this for PCIBIOS. Other mechanisms do it for ACPI. Pre PCIBIOS machines you are SOL. Warner