Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp562840rwl; Fri, 7 Apr 2023 01:35:44 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5nqQ7zmr7uinum61SuSYUU40mQnaBeBUnZAobuP2v98xbKLQO9ej6QkbtMlvucZjyWUz0 X-Received: by 2002:a05:6a20:7b05:b0:d9:f1dc:c23e with SMTP id s5-20020a056a207b0500b000d9f1dcc23emr1460941pzh.21.1680856543944; Fri, 07 Apr 2023 01:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680856543; cv=none; d=google.com; s=arc-20160816; b=p3cPbnh6LCNmJ991m6W6mzruGJ18e4BE1By2zT50pqXHAKuKzD7J/pBFstDp4IBN9n s6Dt2zxS3dU9bXm2K2gepNasYDPlh5H1hielBpbWJyWgEE7VMRBjGBlXjBrdmhcChzZd 327jJx7OuK+tbMxIxmriDA9opyBicqt8i28khyMSYpCtTJgR8PBrGJJTfUfOVJL3V3Hc OKOC66GLf6r0+wEBP3j/AfEb7cqLRDXaiqEzCdTIFpEIr2XvZPdrgPiun8E9BWipYNHn e60KawKmby+VkAyAFlWPGyMZHoifrPYyQ7FLbbnUzRp81fzO9qIrzytMQos8NaBYuq8F PVkQ== 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=WmIfHkGkRoe3Vzw6TMsVVlYetRZvZfGBoB86Uhyvw2c=; b=ddPYiT64dZH/LbdrL9fgIuxknrFNq5UUC7zozwk62ReYRhjgUgE8LXZ4FhK49JaQft xeoIWoyvWBAjICxYlpdTVPOYg6E2l65kLXCjK+EELVM8d6GyWV3I/I9yk47l/GvyCzrX kXizUsDaOWAOmHEJOCB3wfrj6Ifiay92bZLpmwdHnwruNkC9t5QodpkFHytEQYjbZeG7 +0tw3T5vKdl2II/7YqMqZ9cnJuLcOArZCUsEdXfaQaXA/D/zAjrdtn5e+CIQ33yVPM/T 64LwB8FPVmOJzuu04BQMHe7Q+Y26kAiQ1UohHN4o9T9RDVqTmRdAwmn9EQJ6XORj/+mT BYXg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a6566d4000000b00513b2388cdasi3105693pgw.576.2023.04.07.01.35.30; Fri, 07 Apr 2023 01:35:43 -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 S239768AbjDGIfU (ORCPT + 99 others); Fri, 7 Apr 2023 04:35:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239506AbjDGIfO (ORCPT ); Fri, 7 Apr 2023 04:35:14 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AF7894218; Fri, 7 Apr 2023 01:35:09 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.153]) by gateway (Coremail) with SMTP id _____8AxJAy81S9ktscXAA--.36621S3; Fri, 07 Apr 2023 16:35:08 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.153]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxGL2t1S9kKRwYAA--.21995S5; Fri, 07 Apr 2023 16:35:07 +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, stable@vger.kernel.org Subject: [PATCH V3 3/5] irqchip/loongson-eiointc: Fix registration of syscore_ops Date: Fri, 7 Apr 2023 16:34:51 +0800 Message-Id: <20230407083453.6305-4-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--.21995S5 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvJXoW7ZFW7XFyrJF1kWrWDJFWrZrb_yoW8Xw13p3 y8Ca4jgr4rWa48Cr9IqFyDZFy5Awn5ZrW7JFWrJayavF98Gwn8CF1FyF1q9FWqkw4DGF1j 9F40qr4UCa15Aw7anT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bfAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s 1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxSw2x7M28EF7xv wVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwA2z4 x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2kK e7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUtVWrXwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkF7I0En4 kS14v26r126r1DMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI 1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_Jr Wlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26ryj 6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr 0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUv cSsGvfC2KfnxnUUI43ZEXa7IU8_gA5UUUUU== 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 When support suspend/resume for loongson-eiointc, the syscore_ops is registered twice in dual-bridges machines where there are two eiointc IRQ domains. Repeated registration of an same syscore_ops broke syscore_ops_list. Also, cpuhp_setup_state_nocalls is only needed to call for once. So the patch will corret them. Fixes: a90335c2dfb4 ("irqchip/loongson-eiointc: Add suspend/resume support") Cc: stable@vger.kernel.org Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-eiointc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index d16ed64feb3d..90181c42840b 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -422,10 +422,12 @@ int __init eiointc_acpi_init(struct irq_domain *parent, parent_irq = irq_create_mapping(parent, acpi_eiointc->cascade); irq_set_chained_handler_and_data(parent_irq, eiointc_irq_dispatch, priv); - register_syscore_ops(&eiointc_syscore_ops); - cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_LOONGARCH_STARTING, + if (nr_pics == 1) { + register_syscore_ops(&eiointc_syscore_ops); + cpuhp_setup_state_nocalls(CPUHP_AP_IRQ_LOONGARCH_STARTING, "irqchip/loongarch/intc:starting", eiointc_router_init, NULL); + } if (cpu_has_flatmode) node = cpu_to_node(acpi_eiointc->node * CORES_PER_EIO_NODE); -- 2.31.1