Message ID | 20230331113900.9105-6-lvjianmin@loongson.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp498898vqo; Fri, 31 Mar 2023 04:46:59 -0700 (PDT) X-Google-Smtp-Source: AKy350b17tgFBjBnI3TUUhiV7jgOEbl4AWHWC7Mm5jfQES2QYgr3zHh6IMfjonTJh98lGNX3X4ew X-Received: by 2002:aa7:d14e:0:b0:4fa:3b3:c867 with SMTP id r14-20020aa7d14e000000b004fa03b3c867mr22296981edo.17.1680263219100; Fri, 31 Mar 2023 04:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680263219; cv=none; d=google.com; s=arc-20160816; b=Aw5a/rW07WIKlgPIjqwxX3V12oAj/l+2dVXmSsoP6E1GqLyDc+hqt6zdENUr4agE9N 1Sa5FLBxTGsd3MNZ1d4egYKk1B37MkEfrMfqDb1iDJ0Pb+PoWebCnNbXkxqYpVNW8fdn D3fUfS73W18YmxRWUrnbOXWn+kfaTHbHuFBJw06otzTwrGgkZqPTtvvmdw+F/Wo1AdkQ DbxGkM9LDBKS64JN0jD7LldLhAcnMS73OrNNdMHi6kj0agkh+84e9n3WelH5n+eCAaKe gE4LG07Ot1mSn9m9MZ6pcqnjVEwmDIWifUi7S1VNCxGK/SKwhv0FEl44erjF6m23KAwl t8Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JH3vzSId4DOr2PrqSk1DMZFNbz/Q/vq8Fgz8K+jYIEo=; b=O40MwpqviKLfgPupvtu1tqB0+JUgPVBy2ipZwlZJV3LxrvCLxVmqQp6OM2yXO0LjFQ k54ku//lmwj77kpOVA4fgEpNZ0NzNpNlOifik95wqrP0+tIxqvNc6oGb3bgSpSfSJJpT p7URvGRO9vDkIGAzxyAYZHJhORCqFbZ3d4TlIF/GpQpSIjotJY4gxu7HvPeGG2kjs9iz 943pMJLUc2F3WqzMgUHqEHyZBtmaoV+886TI8ngbwmk8bXvFxE1I4vVputmPiaGl1t0i Qcu/eiRGbw67HQUhwFMx/GQeluJSVd1gP0jm3ixHbxPGuwmpqiCngHmLghl6N26n0Ns5 K/oQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020aa7d649000000b004af6a815065si2027510edr.592.2023.03.31.04.46.34; Fri, 31 Mar 2023 04:46:59 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232069AbjCaLjT (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Fri, 31 Mar 2023 07:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231722AbjCaLjE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 31 Mar 2023 07:39:04 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id ADB351A454; Fri, 31 Mar 2023 04:39:02 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.153]) by gateway (Coremail) with SMTP id _____8BxMMxVxiZkRu0UAA--.32260S3; Fri, 31 Mar 2023 19:39:01 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.153]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bx57xUxiZkmwASAA--.12675S7; Fri, 31 Mar 2023 19:39:01 +0800 (CST) From: Jianmin Lv <lvjianmin@loongson.cn> To: Thomas Gleixner <tglx@linutronix.de>, Marc Zyngier <maz@kernel.org> Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Huacai Chen <chenhuacai@loongson.cn>, loongson-kernel@lists.loongnix.cn, stable@vger.kernel.org Subject: [PATCH V2 5/5] irqchip/loongson-pch-pic: Fix pch_pic_acpi_init calling Date: Fri, 31 Mar 2023 19:39:00 +0800 Message-Id: <20230331113900.9105-6-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230331113900.9105-1-lvjianmin@loongson.cn> References: <20230331113900.9105-1-lvjianmin@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Bx57xUxiZkmwASAA--.12675S7 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7tw17uw1xJw4DGF1UCFy7Awb_yoW8Zw1kpF Waq39Iyr48JryxCFZ2k3y5XryfA3sxC3y2gF4Fk3yrZr4qka4kCr4Iya1UCr4kCFsrGa1a vF4FqF1jk3W5AaDanT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bS8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26F4UJVW0owAa w2AFwI0_JF0_Jw1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqjxCEc2xF0cIa020Ex4CE44 I27wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E2Ix0cI8IcVAFwI0_Wrv_ZF1lYx0Ex4A2 jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262 kKe7AKxVWUAVWUtwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwCFI7km 07C267AKxVWUAVWUtwC20s026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r 1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVW7 JVWDJwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r 1j6r1xMIIF0xvEx4A2jsIE14v26r4j6F4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1U YxBIdaVFxhVjvjDU0xZFpf9x07j6rWOUUUUU= X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_HELO_PASS,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761883685158929801?= X-GMAIL-MSGID: =?utf-8?q?1761883685158929801?= |
Series |
Fix some issues of irq controllers for dual-bridges scenario
|
|
Commit Message
吕建民
March 31, 2023, 11:39 a.m. UTC
For dual-bridges scenario, pch_pic_acpi_init() will be called
in following path:
cpuintc_acpi_init
acpi_cascade_irqdomain_init(in cpuintc driver)
acpi_table_parse_madt
eiointc_parse_madt
eiointc_acpi_init /* this will be called two times
correspondingto parsing two
eiointc entries in MADT under
dual-bridges scenario*/
acpi_cascade_irqdomain_init(in eiointc driver)
acpi_table_parse_madt
pch_pic_parse_madt
pch_pic_acpi_init /* this will be called depend
on valid parent IRQ domain
handle for one or two times
corresponding to parsing
two pchpic entries in MADT
druring calling
eiointc_acpi_init() under
dual-bridges scenario*/
During the first eiointc_acpi_init() calling, the
pch_pic_acpi_init() will be called just one time since only
one valid parent IRQ domain handle will be found for current
eiointc IRQ domain.
During the second eiointc_acpi_init() calling, the
pch_pic_acpi_init() will be called two times since two valid
parent IRQ domain handles will be found. So in pch_pic_acpi_init(),
we must have a reasonable way to prevent from creating second same
pch_pic IRQ domain.
The patch matches gsi base information in created pch_pic IRQ
domains to check if the target domain has been created to avoid the
bug mentioned above.
Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
---
drivers/irqchip/irq-loongson-pch-pic.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index 64fa67d4ee7a..e5fe4d50be05 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -404,6 +404,9 @@ int __init pch_pic_acpi_init(struct irq_domain *parent, int ret, vec_base; struct fwnode_handle *domain_handle; + if (find_pch_pic(acpi_pchpic->gsi_base) >= 0) + return 0; + vec_base = acpi_pchpic->gsi_base - GSI_MIN_PCH_IRQ; domain_handle = irq_domain_alloc_fwnode(&acpi_pchpic->address);