From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932468AbVKUXUe (ORCPT ); Mon, 21 Nov 2005 18:20:34 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932476AbVKUXUd (ORCPT ); Mon, 21 Nov 2005 18:20:33 -0500 Received: from ozlabs.org ([203.10.76.45]:12526 "EHLO ozlabs.org") by vger.kernel.org with ESMTP id S932468AbVKUXUd (ORCPT ); Mon, 21 Nov 2005 18:20:33 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17282.22077.670148.356981@cargo.ozlabs.ibm.com> Date: Tue, 22 Nov 2005 10:20:29 +1100 From: Paul Mackerras To: Linus Torvalds Cc: Ingo Molnar , Matthew Wilcox , David Howells , Andrew Morton , linux-kernel@vger.kernel.org, Russell King , Ian Molton , Benjamin Herrenschmidt Subject: Re: [PATCH 4/5] Centralise NO_IRQ definition In-Reply-To: References: <24299.1132571556@warthog.cambridge.redhat.com> <20051121121454.GA1598@parisc-linux.org> <20051121190632.GG1598@parisc-linux.org> <20051121194348.GH1598@parisc-linux.org> <20051121211544.GA4924@elte.hu> <17282.15177.804471.298409@cargo.ozlabs.ibm.com> X-Mailer: VM 7.19 under Emacs 21.4.1 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Linus Torvalds writes: > On all PC hardware, having a zero in the PCI irq register basically means > that no irq is enabled. That's a _fact_. It's a fact however much you may > not like it. It's how the hardware comes up, and it's how the BIOS leaves > it. So "0" absolutely does mean "not allocated". First, are you talking about the interrupt pin register or the interrupt line register? Secondly, I would say that any driver that looks at either of those registers is broken. Drivers should be looking at dev->irq, which is set up by platform code, and may be quite different from what is in the interrupt line register. So the question of what PCI devices do with the value in the interrupt line register is pretty much irrelevant. Those few devices that can control their interrupt routing (such as cardbus bridges) don't use the interrupt line register for that AFAIK. I think all we need is for the convention for drivers to be that they test for whether the device has an interrupt is to test (dev->irq != NO_IRQ). Then x86 can have NO_IRQ = 0 and PPC can have NO_IRQ = -1 and I think everyone is happy (well, nearly everyone, anyway :). Paul.