Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1874341rwl; Sat, 8 Apr 2023 03:49:08 -0700 (PDT) X-Google-Smtp-Source: AKy350ZP7pY2SdFpi2n6r7TfQEg/Yb7Jgpz7mtWuolQCMhkYGLDwqHcBrEeFH0p7I2hSXgb2S+nK X-Received: by 2002:a05:6a00:238d:b0:594:1f1c:3d3a with SMTP id f13-20020a056a00238d00b005941f1c3d3amr6203898pfc.15.1680950948352; Sat, 08 Apr 2023 03:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680950948; cv=none; d=google.com; s=arc-20160816; b=npXiaWO+7ZieKBWZlcOnnjPMVNCpu6dQ/8gZjV8Aekta7KeYtdsHidGnIt2pGRsEPt fhkkppV3gjhtYRn/OkiLxjy+SB6MNPnw8nuPea0NbblHxTpde8d8RNT9X3mGgEomqYSa IEky+KcLpv8u6dOP/iD9TpiySZ5MZgoay7iuHz4OHuoA8BPCE8nXbtDHrDIXyD7CSGmt XlyW0DAZpZZ1c1wkIGv/yCEiUublqYLVVTyNeMtVPWD22kbTdJP07/2PFk6Q5OhYMa6c lmdcRYJKI1O2EVhpyFO6YMiNbcNXjmwLDjv6gX1KSDU/oATWZKWDRKUJrGrn12wSOPK2 bhiw== 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; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x184-20020a6386c1000000b004a1b205441dsi2377689pgd.121.2023.04.08.03.48.56; Sat, 08 Apr 2023 03:49:08 -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; 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 S230045AbjDHKrQ (ORCPT + 99 others); Sat, 8 Apr 2023 06:47:16 -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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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;