From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752918AbdFVQsG (ORCPT ); Thu, 22 Jun 2017 12:48:06 -0400 Received: from terminus.zytor.com ([65.50.211.136]:57829 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbdFVQsF (ORCPT ); Thu, 22 Jun 2017 12:48:05 -0400 Date: Thu, 22 Jun 2017 09:43:26 -0700 From: tip-bot for Thomas Gleixner Message-ID: Cc: peterz@infradead.org, keith.busch@intel.com, linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, mpe@ellerman.id.au, axboe@kernel.dk, tglx@linutronix.de, hch@lst.de, marc.zyngier@arm.com Reply-To: tglx@linutronix.de, axboe@kernel.dk, hch@lst.de, marc.zyngier@arm.com, linux-kernel@vger.kernel.org, peterz@infradead.org, keith.busch@intel.com, mpe@ellerman.id.au, hpa@zytor.com, mingo@kernel.org In-Reply-To: <20170619235443.752782603@linutronix.de> References: <20170619235443.752782603@linutronix.de> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] x86/ioapic: Create named irq domain Git-Commit-ID: 1b604745c8474c76e5fd1682ea5b7da0a1c6d440 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 1b604745c8474c76e5fd1682ea5b7da0a1c6d440 Gitweb: http://git.kernel.org/tip/1b604745c8474c76e5fd1682ea5b7da0a1c6d440 Author: Thomas Gleixner AuthorDate: Tue, 20 Jun 2017 01:37:07 +0200 Committer: Thomas Gleixner CommitDate: Thu, 22 Jun 2017 18:21:09 +0200 x86/ioapic: Create named irq domain Use the fwnode to create a named domain so diagnosis works, but only when the the ioapic is not device tree based. Signed-off-by: Thomas Gleixner Cc: Jens Axboe Cc: Marc Zyngier Cc: Michael Ellerman Cc: Keith Busch Cc: Peter Zijlstra Cc: Christoph Hellwig Link: http://lkml.kernel.org/r/20170619235443.752782603@linutronix.de Signed-off-by: Thomas Gleixner --- arch/x86/kernel/apic/io_apic.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 347bb9f..444ae92 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2223,6 +2223,8 @@ static int mp_irqdomain_create(int ioapic) struct ioapic *ip = &ioapics[ioapic]; struct ioapic_domain_cfg *cfg = &ip->irqdomain_cfg; struct mp_ioapic_gsi *gsi_cfg = mp_ioapic_gsi_routing(ioapic); + struct fwnode_handle *fn; + char *name = "IO-APIC"; if (cfg->type == IOAPIC_DOMAIN_INVALID) return 0; @@ -2233,9 +2235,25 @@ static int mp_irqdomain_create(int ioapic) parent = irq_remapping_get_ir_irq_domain(&info); if (!parent) parent = x86_vector_domain; + else + name = "IO-APIC-IR"; + + /* Handle device tree enumerated APICs proper */ + if (cfg->dev) { + fn = of_node_to_fwnode(cfg->dev); + } else { + fn = irq_domain_alloc_named_id_fwnode(name, ioapic); + if (!fn) + return -ENOMEM; + } + + ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops, + (void *)(long)ioapic); + + /* Release fw handle if it was allocated above */ + if (!cfg->dev) + irq_domain_free_fwnode(fn); - ip->irqdomain = irq_domain_add_linear(cfg->dev, hwirqs, cfg->ops, - (void *)(long)ioapic); if (!ip->irqdomain) return -ENOMEM;