From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E719C2D0A3 for ; Thu, 29 Oct 2020 12:17:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD38D20825 for ; Thu, 29 Oct 2020 12:17:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="C6oFt49c"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1LswGIWW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725879AbgJ2MRw (ORCPT ); Thu, 29 Oct 2020 08:17:52 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:33224 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726083AbgJ2MPh (ORCPT ); Thu, 29 Oct 2020 08:15:37 -0400 Date: Thu, 29 Oct 2020 12:15:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603973733; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9JJHeTF7XCwnAuhR9nLiAAZrI3yZ7G1esV9HDjFGiUE=; b=C6oFt49cBxytv+cH75UJtTmvmvajlydnyv1zk78jZ+7KsAlgrqxX8RpCGFuwDztRbr7yc4 919UKe7Tco/XzccOGd4TgFDhSndYGdNmy5tRXtdjXBedpKdPc9i0hb8aO4Mexh7I4vLpwR NF2liJJauI8H4TmsXiRZdzFMVkF3xY58SLW8SRBWXc9Yg/nY0rMD7/MkVe+bV8oca01wPW BR1MGwV1IV/u1K/Efaby6QRtCmeSVcIsdoORpmP+Feg4hbeUlbAXCBMDpuYeMyN9ihv59R evvNXUusfylxg8Ki13jhmLRoFpD0CTQXF9A9oSDB2173RDZofrNgfUob4t9WrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603973733; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9JJHeTF7XCwnAuhR9nLiAAZrI3yZ7G1esV9HDjFGiUE=; b=1LswGIWWRPZJ1D7r0noqv9z79mi2YG44XNMItl5jqPlXkC/28vk9ciMHa3D2jloixdWHkL Ds/ECuUaFDyPsDAg== From: "tip-bot2 for David Woodhouse" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/apic] x86/ioapic: Use irq_find_matching_fwspec() to find remapping irqdomain Cc: David Woodhouse , Thomas Gleixner , x86 , LKML In-Reply-To: <20201024213535.443185-29-dwmw2@infradead.org> References: <20201024213535.443185-29-dwmw2@infradead.org> MIME-Version: 1.0 Message-ID: <160397373251.397.133764854902256611.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/apic branch of tip: Commit-ID: b643128b917ca8f1c8b1e14af64ebdc81147b2d1 Gitweb: https://git.kernel.org/tip/b643128b917ca8f1c8b1e14af64ebdc81147b2d1 Author: David Woodhouse AuthorDate: Sat, 24 Oct 2020 22:35:28 +01:00 Committer: Thomas Gleixner CommitterDate: Wed, 28 Oct 2020 20:26:28 +01:00 x86/ioapic: Use irq_find_matching_fwspec() to find remapping irqdomain All possible parent domains have a select method now. Make use of it. Signed-off-by: David Woodhouse Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20201024213535.443185-29-dwmw2@infradead.org --- arch/x86/kernel/apic/io_apic.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index ea983da..443d2c9 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c @@ -2320,36 +2320,37 @@ out: static int mp_irqdomain_create(int ioapic) { - struct irq_alloc_info info; struct irq_domain *parent; int hwirqs = mp_ioapic_pin_count(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"; + struct irq_fwspec fwspec; if (cfg->type == IOAPIC_DOMAIN_INVALID) return 0; - init_irq_alloc_info(&info, NULL); - info.type = X86_IRQ_ALLOC_TYPE_IOAPIC_GET_PARENT; - info.devid = mpc_ioapic_id(ioapic); - parent = irq_remapping_get_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); + fn = irq_domain_alloc_named_id_fwnode("IO-APIC", ioapic); if (!fn) return -ENOMEM; } + fwspec.fwnode = fn; + fwspec.param_count = 1; + fwspec.param[0] = ioapic; + + parent = irq_find_matching_fwspec(&fwspec, DOMAIN_BUS_ANY); + if (!parent) { + if (!cfg->dev) + irq_domain_free_fwnode(fn); + return -ENODEV; + } + ip->irqdomain = irq_domain_create_linear(fn, hwirqs, cfg->ops, (void *)(long)ioapic);