Message ID | 20230407083453.6305-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 b10csp142714vqo; Fri, 7 Apr 2023 01:45:41 -0700 (PDT) X-Google-Smtp-Source: AKy350buuIa797/7ZnQnNSOb5avYqD1bFD4+ZYu4J3d/hkYyxTGCP3MtJkGqVQozIyEGEM9CmBFd X-Received: by 2002:a17:907:1184:b0:948:c047:477d with SMTP id uz4-20020a170907118400b00948c047477dmr1607844ejb.22.1680857141207; Fri, 07 Apr 2023 01:45:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680857141; cv=none; d=google.com; s=arc-20160816; b=UIifLWdXJ3TgGvEpcPnL5yWhfM4Yn0BGo19HR+WeawfTxKGx42t+ucTIBw5ue137pL LfzB38LnwnVVISVtpiO0kBch7hYd1R+ZVQNT7k6Ctz4bPsGOS4YsL6e22fPLOYnc0YQi XY3rJMlkYzINFJCnWYo/nwZRmMg1VHjr5Edk3z7VllnFKo5vQ0To6Xdu1vVsfxFC3F3h vagGl+H7kpsW0j9iEVhYmP2lHvdOrlO6KtogKYKFfQ6xvxasQHG+ytpu4kQxWsk3Ms+P G7B1nQKOB3ho+8kuNurxHJ729MopC9f4fMUWTBPglzVGTVwQGP1jh8sja12BgRMDLW3O D6CQ== 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=R58cIFpTdw4qaaE9ppr5w/TrdrqpVGec7HSCBpNts74=; b=fwxgicDHl9U08W5IGnozs18TwHT+JGZFnnPQkAqQLliYP5fQ6EdwGIozj3RbFag8N1 igV6i2Y8EvBUMjwtmzSE7lPfHhN+K1DI6HS71pLk256J4y0k7+Qqtm/HQMvTJ3/6/YEk 3G4EarXTmUmPDfFX5B923cG1Zbdv4xhCTF7H8IS5aG9nBZsnyH8ks1EIs/mxX/fLCCGF uRW7WOjGC2KNUJugu/M4FXmAq6kLNxd209M3OKTqhZH5+/ppk7hF6FcpHYIKyzYLw6SQ xC/qr8cGICKa0E3GKJO60FQSFUc5K8ZgBpzN4pE6NFk0Po3Wn7oKpadE9Uwi3teall3t Cy7g== 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 wf6-20020a170907d68600b009186b84c076si3013505ejc.738.2023.04.07.01.45.11; Fri, 07 Apr 2023 01:45:41 -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 S239975AbjDGIfa (ORCPT <rfc822;a1648639935@gmail.com> + 99 others); Fri, 7 Apr 2023 04:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239379AbjDGIfP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 7 Apr 2023 04:35:15 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C162F46B0; Fri, 7 Apr 2023 01:35:10 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.153]) by gateway (Coremail) with SMTP id _____8DxEzS91S9kxccXAA--.37008S3; Fri, 07 Apr 2023 16:35:09 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.153]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxGL2t1S9kKRwYAA--.21995S7; Fri, 07 Apr 2023 16:35:08 +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 V3 5/5] irqchip/loongson-pch-pic: Fix pch_pic_acpi_init calling Date: Fri, 7 Apr 2023 16:34:53 +0800 Message-Id: <20230407083453.6305-6-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230407083453.6305-1-lvjianmin@loongson.cn> References: <20230407083453.6305-1-lvjianmin@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8AxGL2t1S9kKRwYAA--.21995S7 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7tw17uw1xJw4DGF1UCFy7Awb_yoW8ur47pF W2q39Iyr48JFyxCFZ2kw45Xry3A3sxC3y2gF4rC3yrZr4qka4kCr1xAa1Uur4kCFsrGF4a vF4FqF1jk3WUAaDanT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bS8YFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1l84 ACjcxK6I8E87Iv67AKxVWxJr0_GcWl84ACjcxK6I8E87Iv6xkF7I0E14v26F4UJVW0owAa 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?1762506457278035601?= X-GMAIL-MSGID: =?utf-8?q?1762506457278035601?= |
Series |
Fix some issues of irq controllers for dual-bridges scenario
|
|
Commit Message
吕建民
April 7, 2023, 8:34 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.
Cc: stable@vger.kernel.org
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);