From patchwork Fri Mar 24 06:08:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5ZCV5bu65rCR?= X-Patchwork-Id: 74359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp405498vqo; Thu, 23 Mar 2023 23:13:29 -0700 (PDT) X-Google-Smtp-Source: AK7set8L83Hy+I/P+rF9ywODLutx56pigmjoAvWAmE1odwrasWDoKidVJgrARYYzksT48lkHr7Pg X-Received: by 2002:a05:6402:22eb:b0:4ea:a9b0:a518 with SMTP id dn11-20020a05640222eb00b004eaa9b0a518mr7812020edb.17.1679638409073; Thu, 23 Mar 2023 23:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679638409; cv=none; d=google.com; s=arc-20160816; b=d3rgki30VXKR1S3dwy5dPXnSUZ8XWb9C5AjW6e8IeLJoJtIZcogPtUpoUEk/+3f9/N p9n1P/3kewnGfRur8TGfVlQUv1gTnuRuKAeBNnJDOd8vlQUDLyHozXYSOiq7BdXLABGm E7unko1vEGQK1GhjHyi+QXNJO2PugpeupJaKBto02gDlS00yKXkgeIkdBWfe1/1386Vw W2XkLGM7Sz2tGIoPGAeU1RUerV6C8xyw2QWvjiJ+dv1iieYnZhdQcedQDBX6szUeViEO FfXjXDQP3vKGPqql4e+Y1mMofgq0o/KHDQKGyeMZrCJLSfoGobDcQOO+hOIgEEUClg41 7FxQ== 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=do/dQZUYtoPT2DIcsi1g1Nwcuh6fVqSgymoYxirmU5U=; b=y6QZYokIHvBiPIR8BmsROQSbVyqePfyAhNtoKoG9DulabEQw14ldFFou09EqUmnt/i 2Xhk8IZuvZ9QmZ3sRIMalCbdtPfNfb+a1NCovluhTuvlPe/EEINHGsSzeYZKnJjnfBTb xbewMSvT6q46elV+S7TCtyBIgIiH2Kct99DlBDpnQOkoE3wLXyUhsJSU+p7BKvQgKFf+ 8xJrswDa0WAT/LNO87vC/X+OSdaqRs2RseWVExpN70N20n5DSare9lw4vKCxfhynJtMP K6dQ1ncl9AGaJbUg2olw2nHFpKG/ruU31+6iWvDgOohdCzaNs3mdW29CwX+RP9TgrL0Y YyMA== 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 t26-20020aa7d4da000000b004acb712d32csi6711196edr.233.2023.03.23.23.13.05; Thu, 23 Mar 2023 23:13:29 -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 S231580AbjCXGJH (ORCPT + 99 others); Fri, 24 Mar 2023 02:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbjCXGJB (ORCPT ); Fri, 24 Mar 2023 02:09:01 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DB5361554F for ; Thu, 23 Mar 2023 23:08:59 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.153]) by gateway (Coremail) with SMTP id _____8DxUOV6Ph1kQZwQAA--.25232S3; Fri, 24 Mar 2023 14:08:58 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.153]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Axmr12Ph1kY_QKAA--.2874S3; Fri, 24 Mar 2023 14:08:58 +0800 (CST) From: Jianmin Lv To: Thomas Gleixner , Marc Zyngier Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, Lorenzo Pieralisi , Jiaxun Yang , Huacai Chen , loongson-kernel@lists.loongnix.cn Subject: [PATCH V1 1/5] irqchip/loongson-eiointc: Fix returned value on parsing MADT Date: Fri, 24 Mar 2023 14:08:50 +0800 Message-Id: <20230324060854.29375-2-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 X-CM-TRANSID: AQAAf8Axmr12Ph1kY_QKAA--.2874S3 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7trWkZF45Kw48uF4rtFWkJFb_yoW8Aryxpa y7ArZ8tr4Yy3yxCr1ktas8Xry5Z39xuayxtFWrG3yFvr1DCrWUJF4fA3Wj9rn2yFWUG3Wj vF4Fqa15ua15A3DanT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bSxYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_JFv_Jw1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW5JVW7JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v26r4UJVWxJr1l n4kS14v26r126r1DM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6x ACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r1q6rW5McIj6I8E 87Iv67AKxVW8JVWxJwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxV Aaw2AFwI0_JF0_Jw1l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxY O2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGV WUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_ Gr0_Xr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK8VAvwI8IcIk0rV WUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4U JbIYCTnIWIevJa73UjIFyTuYvjxUFwIDUUUUU 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761228524444107192?= X-GMAIL-MSGID: =?utf-8?q?1761228524444107192?= In pch_pic_parse_madt(), a NULL parent pointer will be returned from acpi_get_vec_parent() for second pch-pic domain related to second bridge while calling eiointc_acpi_init() at first time, where the parent of it has not been initialized yet, and will be initialized during second time calling eiointc_acpi_init(). So, it's reasonable to return zero so that failure of acpi_table_parse_madt() will be avoided, or else acpi_cascade_irqdomain_init() will return and initialization of followed pch_msi domain will be skipped. Although it does not matter when pch_msi_parse_madt() returns -EINVAL if no invalid parent is found, it's also reasonable to return zero for that. Change-Id: I4d278534999ec3e5c8db6d40155ba2665d9de86f Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-eiointc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index d15fd38c1756..62a632d73991 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -343,7 +343,7 @@ static int __init pch_pic_parse_madt(union acpi_subtable_headers *header, if (parent) return pch_pic_acpi_init(parent, pchpic_entry); - return -EINVAL; + return 0; } static int __init pch_msi_parse_madt(union acpi_subtable_headers *header, @@ -355,7 +355,7 @@ static int __init pch_msi_parse_madt(union acpi_subtable_headers *header, if (parent) return pch_msi_acpi_init(parent, pchmsi_entry); - return -EINVAL; + return 0; } static int __init acpi_cascade_irqdomain_init(void)