Message ID | 20230324060854.29375-4-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 b10csp405528vqo; Thu, 23 Mar 2023 23:13:34 -0700 (PDT) X-Google-Smtp-Source: AKy350ZgGx1w2oTM0JXHPACHbHHmRNBNyasvoElvvYeFfW/9OJ6b6XhBpzHVf/HMm/w39kKr465R X-Received: by 2002:a17:907:7784:b0:930:e2c:ddc3 with SMTP id ky4-20020a170907778400b009300e2cddc3mr1524811ejc.72.1679638414041; Thu, 23 Mar 2023 23:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679638414; cv=none; d=google.com; s=arc-20160816; b=ZPRRxpyv69VkHAKfGBWtH7MP5ihmzL3nZWkvT1KzBEM8FzX4hBUXSY1kYmD+SutV52 f2N4wvKPs9Q8yoqiCWujQwuEo5uffklh3vlX1l9+/7fAl6p/B7zgix4nTHmwdTsnmZrT tFSU7jWMh8lsSaGCnABjYMM9nrQDjAKVpomwvhrhatLNjSEmeCukSZlezUH8E/XPsbJ0 wAvsJ7D1LtBwEdULapVLgsz9BBcLLfzdUtIfnOLiNRii+wucqy2HyCEQ6/j4W81PXOae uey9aqnTK+LZqEuZm/PLtyN4EBPgqetFsNXyIgU5UfQTlIKyhdhhNBNgi6IueXTxvad1 /NwQ== 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=RDki23orJ9JWp6vA5SJQV5DIAflDaWr+Uc3ZsvdcxUs=; b=ir5heAxycng1FmbTZrjpuXY3hyravPIDkWWj5jNIDur2+nrIQ/XD1qkvzPSvb5c6bq C3ZmeHx7OTyhJzzPF+hvkFTpuJQFDj41jjVSDQMGbD4oMateobUp7P7jU91WMYdQIK7o 5BuSI7EfJFOS5KdR/R0Ak9SrrCgFfAbQ1a6SNhlRqKGm9DPlsvl0qR+NeayUq3Bo9Cnu OPNXEoaWgfu74U7D6ImpyrpQLiQ24JGhZnlsogrxRrqNtATG7WEhdLKTG8IavKYEb+VO ss/IVOo7C/O3ydgeGPT3pf+x5DeJ5tWX35P8CRvFNcCmGN88vP8NmzEHmj5Z91YDKjaO VrDA== 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 kz9-20020a17090777c900b008c35025ce33si19347537ejc.838.2023.03.23.23.13.10; Thu, 23 Mar 2023 23:13:34 -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 S231625AbjCXGJK (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Fri, 24 Mar 2023 02:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231161AbjCXGJC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 24 Mar 2023 02:09:02 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 43C1215881 for <linux-kernel@vger.kernel.org>; Thu, 23 Mar 2023 23:09:00 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.153]) by gateway (Coremail) with SMTP id _____8Bxedl7Ph1kTJwQAA--.25109S3; Fri, 24 Mar 2023 14:08:59 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.153]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Axmr12Ph1kY_QKAA--.2874S5; Fri, 24 Mar 2023 14:08:58 +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 Subject: [PATCH V1 3/5] irqchip/loongson-pch-pic: Fix pch_pic_acpi_init calling Date: Fri, 24 Mar 2023 14:08:52 +0800 Message-Id: <20230324060854.29375-4-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230324060854.29375-1-lvjianmin@loongson.cn> References: <20230324060854.29375-1-lvjianmin@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Axmr12Ph1kY_QKAA--.2874S5 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7tw17uw1xJw4DGF1UCFy7Awb_yoW8urWDpF Wag39Iyr48JryxCFZ7C3y5XryfAwnxu3y2gF4rC3yFvr4qkas5Gr4xta1UCrWkCrsrJF4a vr4FqF1j93WUAaDanT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bSxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l n4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E 87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxV Aaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxY O2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ Xr0_Ar1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4U JbIYCTnIWIevJa73UjIFyTuYvjxU4Xo7DUUUU 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?1761228529560936284?= X-GMAIL-MSGID: =?utf-8?q?1761228529560936284?= |
Series |
Fix some issues of irq controllers for dual-bridges scenario
|
|
Commit Message
吕建民
March 24, 2023, 6:08 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 corresponding
to parsing two eiointc entrys in MADT under
dual-bridges scenario*/
acpi_cascade_irqdomain_init(in pch_pic 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 entrys 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.
Change-Id: Iacba57be83dcbfe7f61b94632d472bccfaaddc22
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 437f1af693d0..e3c698ca11e9 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -403,6 +403,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);