From patchwork Thu Feb 16 05:32:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 141496 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id ADE351008B5 for ; Thu, 16 Feb 2012 16:34:05 +1100 (EST) Received: from mail-iy0-f179.google.com (mail-iy0-f179.google.com [209.85.210.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id E2785B7002; Thu, 16 Feb 2012 16:32:48 +1100 (EST) Received: by iabz21 with SMTP id z21so2672617iab.38 for ; Wed, 15 Feb 2012 21:32:45 -0800 (PST) Received: by 10.50.189.137 with SMTP id gi9mr1223758igc.29.1329370365478; Wed, 15 Feb 2012 21:32:45 -0800 (PST) Received: from localhost (S0106d8b37715ee14.cg.shawcable.net. [68.146.14.168]) by mx.google.com with ESMTPS id uy10sm7590766igc.1.2012.02.15.21.32.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 15 Feb 2012 21:32:44 -0800 (PST) Received: by localhost (Postfix, from userid 1000) id 6ECA83E0537; Wed, 15 Feb 2012 22:32:43 -0700 (MST) Date: Wed, 15 Feb 2012 22:32:43 -0700 From: Grant Likely To: Shawn Guo Subject: Re: [PATCH v3 24/25] irq_domain: remove "hint" when allocating irq numbers Message-ID: <20120216053243.GM25779@ponder.secretlab.ca> References: <1327700179-17454-1-git-send-email-grant.likely@secretlab.ca> <1327700179-17454-25-git-send-email-grant.likely@secretlab.ca> <4F316848.4060100@atmel.com> <4F3BC97C.6030203@atmel.com> <20120215202145.GH25779@ponder.secretlab.ca> <20120215215001.GA30946@r65073-Latitude-D630> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120215215001.GA30946@r65073-Latitude-D630> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQkuOm34RZPHOIvKS/heZvWk0HEhzSkh6uP7ivdvF3XHnqWVMju7rHBcmyWGZ+WVyeZs/p8r Cc: Stephen Rothwell , devicetree-discuss@lists.ozlabs.org, Nicolas Ferre , linux-kernel@vger.kernel.org, Rob Herring , Milton Miller , Thomas Gleixner , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org On Wed, Feb 15, 2012 at 01:50:02PM -0800, Shawn Guo wrote: > On Wed, Feb 15, 2012 at 01:21:45PM -0700, Grant Likely wrote: > > On Wed, Feb 15, 2012 at 04:04:28PM +0100, Nicolas Ferre wrote: > > > On 02/07/2012 07:07 PM, Nicolas Ferre : > > > > On 01/27/2012 10:36 PM, Grant Likely : > > > >> The 'hint' used to try and line up irq numbers with hw irq numbers is > > > >> rather a hack and not very useful. Now that /proc/interrupts also outputs > > > >> the hwirq number, it is even less useful to keep around the 'hint' heuristic. > > > >> > > > >> This patch removes it. > > > > > > > > Grant, > > > > > > > > While trying your patch series in conjunction with Rob one, I do not > > > > find this patch in your irqdomain/next branch (and a couple of others). > > > > Can you tell me if this v3 series is available as a git tree? > > > > > > I am still interested by patch 24-25 of this series but still cannot > > > find them in your irqdomain/next branch: > > > Are they also expected to join the 3.4 merge window material? > > > > I've held off on putting them in irqdomain/next because they are a bit more > > risky than the other patches, and I want an explicit ack from Ben for patches > > 24 & 25. However, that shouldn't really cause any issues since the changes > > in 24 & 25 don't impact the irq_domain functionality or API. They are just > > optimizations. > > > I'm seeing that patch 24 does impact on irq_domain functionality > a little bit. On next tree which has no this patch yet, > irq_create_mapping can reasonably create virq in range 1..15, while > irq_find_mapping will only try to find the virq from 16 > (NUM_ISA_INTERRUPTS). This will result in that any hwirq that is < 16 > gets multiple entries in the mapping table with different virq numbers > mapped to the same one hwirq. That's a bug then. The implementation should work without patch 24. Does this patch fix it? diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 2c1d6f8..2d3dfff 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -516,8 +516,8 @@ unsigned int irq_find_mapping(struct irq_domain *domain, return irq_domain_legacy_revmap(domain, hwirq); /* Slow path does a linear search of the map */ - if (hint < NUM_ISA_INTERRUPTS) - hint = NUM_ISA_INTERRUPTS; + if (hint == 0) + hint = 1; i = hint; do { struct irq_data *data = irq_get_irq_data(i); @@ -525,7 +525,7 @@ unsigned int irq_find_mapping(struct irq_domain *domain, return i; i++; if (i >= irq_virq_count) - i = NUM_ISA_INTERRUPTS; + i = 1 } while(i != hint); return 0; }