From patchwork Sat Apr 8 10:45:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 81150 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp800541vqo; Sat, 8 Apr 2023 03:51:32 -0700 (PDT) X-Google-Smtp-Source: AKy350b8KYCuthklzi0VqPh53XeWZn3Dyn6vzLOFKplx9t5uUgGqO2bWeezp23QnEk954tUpQVsv X-Received: by 2002:a17:907:2da6:b0:930:3916:df17 with SMTP id gt38-20020a1709072da600b009303916df17mr1879175ejc.0.1680951091860; Sat, 08 Apr 2023 03:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680951091; cv=none; d=google.com; s=arc-20160816; b=DfR94pm2d/LNnMlhyqZxd6cAOU8dKYG3vqpV4AYQXy+wtQkcouvS6S5Okm5hz4z9od jYpeZPnAu75m2uz9YABBndmdWNnxE5CSspQokB6RvvXGPTvwFwfa0JBqLdNPA5v0q8nG z9KbJ9BRJddgghuIi5SdKcGybjo+neymmIaqiT1v/+rUFpuiaZ6Gvo/4XzFgjAoNOIGU +6jGxDjZcEdG0MEHIlq6NBlHhdHbOBtRyu2BlWMPnEk0kP1RpiC0AzyuMfLF+T2nS97g y5iZyoXqvItNH2wAjaE6okuZb5xDemVnyTFOHLWGUJi6x3KKWc+9w66wzErZuwqZaBjK X6xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=cBNvRMXwobqi73F+EfB/m1uKZ4QcY64VUGmbpJb00Jg=; b=uM0JG03epswzCCD8ZqoKJAntyBwLZSO9fXzscJFS2mRCqep9d1O0q5AB/kbJ+1rIG1 JuSsrshbgjLi31t8/l14/jPX61Iw2kPZb/l20Z8DjYJjDDal8fW8pJj0GHbZr3EfA+RV qSMV7v6th4R1Jm5GgR4wK/nryAkmdbSdaRo/cE0tID+tF++6QptnmS2b6GKoUGxIGwlT Kp5morHaXe4976L8b7AEWYrqfsfsesx3EzxQMzy1MOVLnzEBQ53DyFVkDdaHrq3ZrjoY Le0zs+fmuXipFd2oFkfbes3LDQDtrhelM3Q0JyP7Zw2TCwJ/FNqGKW0/OY++484jOjbY 47KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UMKsDvKA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8DaraoQG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sz21-20020a1709078b1500b0093429d37a34si5557476ejc.272.2023.04.08.03.51.07; Sat, 08 Apr 2023 03:51:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UMKsDvKA; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=8DaraoQG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjDHKrR (ORCPT + 99 others); Sat, 8 Apr 2023 06:47:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbjDHKrI (ORCPT ); Sat, 8 Apr 2023 06:47:08 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2BE0FF01; Sat, 8 Apr 2023 03:46:28 -0700 (PDT) Date: Sat, 08 Apr 2023 10:45:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1680950715; 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=cBNvRMXwobqi73F+EfB/m1uKZ4QcY64VUGmbpJb00Jg=; b=UMKsDvKAWCJyeU1QMIgWyYdf3IAYCWGr5eet+v+A/sbr+B/wxaIQV7/sAHkUWr6FlcS75A 10xS1QA6Ndp64hcoj4/K3SzqPcusQoNq3BZqf1W2o7mjSakP9Rta1NyprpxJX1MRCjRxrZ aGlKwtXjTVJ1CDw5poLVchkWGf9TjuMWE5iGlbyzPkLQATdQB1LZsISsI/7A042n3qe0lf G8KiPTJEUdO1Mqsud4GnKTieDS/g/P4wCTcF25MrPXmM8Ydzg66TcbSy0e1PM2f13g45i6 EE4WRIMqJE+FB+OZaqH7wrbypEzNbyDZ77761XZ1BRskT3YA4xrG5OuVMFZLrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1680950715; 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=cBNvRMXwobqi73F+EfB/m1uKZ4QcY64VUGmbpJb00Jg=; b=8DaraoQGXrICvk9vNQ8nyGDkpQCmjKztwZwZ2elcWKsNvYujsqpRn+/8vAhfVNlYijw8Xn /LYwCE3612XJVnBg== From: "irqchip-bot for Jianmin Lv" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/loongson-eiointc: Fix incorrect use of acpi_get_vec_parent Cc: stable@vger.kernel.org, Jianmin Lv , Marc Zyngier , tglx@linutronix.de In-Reply-To: <20230407083453.6305-3-lvjianmin@loongson.cn> References: <20230407083453.6305-3-lvjianmin@loongson.cn> MIME-Version: 1.0 Message-ID: <168095071548.404.13158828513094153969.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762506214112305004?= X-GMAIL-MSGID: =?utf-8?q?1762604972269834960?= The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 64cc451e45e146b2140211b4f45f278b93b24ac0 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/64cc451e45e146b2140211b4f45f278b93b24ac0 Author: Jianmin Lv AuthorDate: Fri, 07 Apr 2023 16:34:50 +08:00 Committer: Marc Zyngier CommitterDate: Sat, 08 Apr 2023 11:29:18 +01:00 irqchip/loongson-eiointc: Fix incorrect use of acpi_get_vec_parent In eiointc_acpi_init(), a *eiointc* node is passed into acpi_get_vec_parent() instead of a required *NUMA* node (on some chip like 3C5000L, a *NUMA* node means a *eiointc* node, but on some chip like 3C5000, a *NUMA* node contains 4 *eiointc* nodes), and node in struct acpi_vector_group is essentially a *NUMA* node, which will lead to no parent matched for passed *eiointc* node. so the patch adjusts code to use *NUMA* node for parameter node of acpi_set_vec_parent/acpi_get_vec_parent. Cc: stable@vger.kernel.org Signed-off-by: Jianmin Lv Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230407083453.6305-3-lvjianmin@loongson.cn --- drivers/irqchip/irq-loongson-eiointc.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 62a632d..d16ed64 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -280,9 +280,6 @@ static void acpi_set_vec_parent(int node, struct irq_domain *parent, struct acpi { int i; - if (cpu_has_flatmode) - node = cpu_to_node(node * CORES_PER_EIO_NODE); - for (i = 0; i < MAX_IO_PICS; i++) { if (node == vec_group[i].node) { vec_group[i].parent = parent; @@ -349,8 +346,16 @@ static int __init pch_pic_parse_madt(union acpi_subtable_headers *header, static int __init pch_msi_parse_madt(union acpi_subtable_headers *header, const unsigned long end) { + struct irq_domain *parent; struct acpi_madt_msi_pic *pchmsi_entry = (struct acpi_madt_msi_pic *)header; - struct irq_domain *parent = acpi_get_vec_parent(eiointc_priv[nr_pics - 1]->node, msi_group); + int node; + + if (cpu_has_flatmode) + node = cpu_to_node(eiointc_priv[nr_pics - 1]->node * CORES_PER_EIO_NODE); + else + node = eiointc_priv[nr_pics - 1]->node; + + parent = acpi_get_vec_parent(node, msi_group); if (parent) return pch_msi_acpi_init(parent, pchmsi_entry); @@ -379,6 +384,7 @@ int __init eiointc_acpi_init(struct irq_domain *parent, int i, ret, parent_irq; unsigned long node_map; struct eiointc_priv *priv; + int node; priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) @@ -421,8 +427,12 @@ int __init eiointc_acpi_init(struct irq_domain *parent, "irqchip/loongarch/intc:starting", eiointc_router_init, NULL); - acpi_set_vec_parent(acpi_eiointc->node, priv->eiointc_domain, pch_group); - acpi_set_vec_parent(acpi_eiointc->node, priv->eiointc_domain, msi_group); + if (cpu_has_flatmode) + node = cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE); + else + node = acpi_eiointc->node; + acpi_set_vec_parent(node, priv->eiointc_domain, pch_group); + acpi_set_vec_parent(node, priv->eiointc_domain, msi_group); ret = acpi_cascade_irqdomain_init(); return ret;