From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756519Ab1F0J0a (ORCPT ); Mon, 27 Jun 2011 05:26:30 -0400 Received: from gate.crashing.org ([63.228.1.57]:47303 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757195Ab1F0JYi (ORCPT ); Mon, 27 Jun 2011 05:24:38 -0400 Subject: Re: [RFC PATCH] irq: add irq_domain translation infrastructure From: Benjamin Herrenschmidt To: Sebastian Andrzej Siewior Cc: Grant Likely , devicetree-discuss@lists.ozlabs.org, linux-kernel@vger.kernel.org, Andres Salomon , Thomas Gleixner In-Reply-To: <20110627090059.GA31287@linutronix.de> References: <20110526065438.23444.69386.stgit@ponder> <20110627090059.GA31287@linutronix.de> Content-Type: text/plain; charset="UTF-8" Date: Mon, 27 Jun 2011 19:24:19 +1000 Message-ID: <1309166659.32158.380.camel@pasglop> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2011-06-27 at 11:00 +0200, Sebastian Andrzej Siewior wrote: > * Grant Likely | 2011-05-26 00:54:38 [-0600]: > > >diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c > >index 39645b6..9891cd4 100644 > >--- a/arch/x86/kernel/devicetree.c > >+++ b/arch/x86/kernel/devicetree.c > >@@ -371,36 +321,49 @@ static struct of_ioapic_type of_ioapic_type[] = > > }, > > }; > > > >-static int ioapic_xlate(struct irq_domain *id, const u32 *intspec, u32 intsize, > >- u32 *out_hwirq, u32 *out_type) > >+static int ioapic_dt_translate(struct irq_domain *domain, > >+ struct device_node *controller, > >+ const u32 *intspec, u32 intsize, > >+ irq_hw_number_t *out_hwirq, u32 *out_type) > > { > >- struct mp_ioapic_gsi *gsi_cfg; > > struct io_apic_irq_attr attr; > > struct of_ioapic_type *it; > > u32 line, idx, type; > >+ int rc; > > > >- if (intsize < 2) > >+ if (controller != domain->of_node) > > return -EINVAL; > > Is there a reason not havining the (controller != domain->of_node) check > in irq_create_of_mapping()? Not all domains are associated with a single OF node. Take xics, where there can be quite a few "source controllers" which act as device-tree interrupt parents but there's a single global domain. Cheers, Ben. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Benjamin Herrenschmidt Subject: Re: [RFC PATCH] irq: add irq_domain translation infrastructure Date: Mon, 27 Jun 2011 19:24:19 +1000 Message-ID: <1309166659.32158.380.camel@pasglop> References: <20110526065438.23444.69386.stgit@ponder> <20110627090059.GA31287@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20110627090059.GA31287-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Sebastian Andrzej Siewior Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, Thomas Gleixner , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andres Salomon List-Id: devicetree@vger.kernel.org On Mon, 2011-06-27 at 11:00 +0200, Sebastian Andrzej Siewior wrote: > * Grant Likely | 2011-05-26 00:54:38 [-0600]: > > >diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c > >index 39645b6..9891cd4 100644 > >--- a/arch/x86/kernel/devicetree.c > >+++ b/arch/x86/kernel/devicetree.c > >@@ -371,36 +321,49 @@ static struct of_ioapic_type of_ioapic_type[] = > > }, > > }; > > > >-static int ioapic_xlate(struct irq_domain *id, const u32 *intspec, u32 intsize, > >- u32 *out_hwirq, u32 *out_type) > >+static int ioapic_dt_translate(struct irq_domain *domain, > >+ struct device_node *controller, > >+ const u32 *intspec, u32 intsize, > >+ irq_hw_number_t *out_hwirq, u32 *out_type) > > { > >- struct mp_ioapic_gsi *gsi_cfg; > > struct io_apic_irq_attr attr; > > struct of_ioapic_type *it; > > u32 line, idx, type; > >+ int rc; > > > >- if (intsize < 2) > >+ if (controller != domain->of_node) > > return -EINVAL; > > Is there a reason not havining the (controller != domain->of_node) check > in irq_create_of_mapping()? Not all domains are associated with a single OF node. Take xics, where there can be quite a few "source controllers" which act as device-tree interrupt parents but there's a single global domain. Cheers, Ben.