Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp563055rwl; Fri, 7 Apr 2023 01:36:01 -0700 (PDT) X-Google-Smtp-Source: AKy350ZVRblVpXdfPByPoUvTQUdgHzjhnWz7L4khzJUGnG5pDhEERLMLrSQlkwNG/4cCO2sJEp9y X-Received: by 2002:a17:90b:1d8a:b0:23f:9fac:6b35 with SMTP id pf10-20020a17090b1d8a00b0023f9fac6b35mr1605096pjb.39.1680856561690; Fri, 07 Apr 2023 01:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680856561; cv=none; d=google.com; s=arc-20160816; b=TLnng8Dp2fp6gGr4tzfmBIdYMQEq1kYIx/W7KmlgYw4Nsulq13VT0/adESJQ68foiI ksaOF98z+b0ZqRFT7pv2wPuWiY6UI+9ODQnMYpirnQDNtMyw+8e6yLIVzXaL8YZmitG0 LFy61WQ+DNwgBU0xlkXlfkmPFbC86G110fEUtT+mvOEXB8Ks1+q/euIzNW1XGA2H+Gip L+agCGiN4dEKLvZOT6YphLnfaP46JX8WK27ehjJKgtew5CV0WWh+xw1LDFhHvO0tDDsM sgjeWuoiaWzC9/95SR2jKIFuqNH0q1lqITj+O9eIuaS3tKmDCoq72ItLMSaoDN4oW4Tn xbKw== 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=njZ8azFzq0H3aO5U6fDdMOyvjHP52NQ5XL/KqMFg4wI=; b=Ww5qPGymCxUsAuT+igWVb8d1roym88inWd+abks/eZfx4BM+zKNWCROU99e0C2PQzM UO91iUEvOrAvDHtz2tPrw3RcpayYF6qnFdU9ZZovfwARr5dpy2s1XIElipkiWuwy+MGe /Q6l4W+LVHDARUDCmGdHeP+PW+M11nRhBJM2zhM0p+7ilXKeR9n/kSc3ov5IwJivXpSh n2Ax2i0GYQdDwdbthE7hIJV+NXpfG+7Anqd1dT+aStLgmRdyPO9mb613kgFXYTlc9VBi 5HzLkAFqqXuo0P2lVNiLPfdKRCg0Y+pcH/DH0UnYtjfGgkFF44Cr7xRlsAOASB0YZxgN 7deA== 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 s10-20020a17090ad48a00b00244993e3e6esi2884401pju.50.2023.04.07.01.35.50; Fri, 07 Apr 2023 01:36:01 -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 S240204AbjDGIf0 (ORCPT + 99 others); Fri, 7 Apr 2023 04:35:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232635AbjDGIfO (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 25B1510A; Fri, 7 Apr 2023 01:35:09 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.153]) by gateway (Coremail) with SMTP id _____8AxYcy91S9kvscXAA--.36974S3; 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--.21995S6; Fri, 07 Apr 2023 16:35:08 +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 4/5] irqchip/loongson-pch-pic: Fix registration of syscore_ops Date: Fri, 7 Apr 2023 16:34:52 +0800 Message-Id: <20230407083453.6305-5-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--.21995S6 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvdXoW7Xr43Xr4UCFyUAryDuFy8Zrb_yoWkXFcEgr yIqa9rA348Zr1Uu3yfZr15ZF4aqa1UWFn5uFZ8KF9xJ3yrX34fJr12yrn8Cw47Ga4rAFnx C395Wr9akryxCjkaLaAFLSUrUUUUnb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY A7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwA2z4 x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2kK e7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkF7I0En4 kS14v26r126r1DMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI 1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_Jr Wlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26ryj 6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr 0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUv cSsGvfC2KfnxnUUI43ZEXa7IU0_WrPUUUUU== 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-pch-pic, the syscore_ops is registered twice in dual-bridges machines where there are two pch-pic IRQ domains. Repeated registration of an same syscore_ops broke syscore_ops_list, so the patch will corret it. Fixes: 1ed008a2c331 ("irqchip/loongson-pch-pic: Add suspend/resume support") Cc: stable@vger.kernel.org Signed-off-by: Jianmin Lv --- drivers/irqchip/irq-loongson-pch-pic.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-loongson-pch-pic.c b/drivers/irqchip/irq-loongson-pch-pic.c index 437f1af693d0..64fa67d4ee7a 100644 --- a/drivers/irqchip/irq-loongson-pch-pic.c +++ b/drivers/irqchip/irq-loongson-pch-pic.c @@ -311,7 +311,8 @@ static int pch_pic_init(phys_addr_t addr, unsigned long size, int vec_base, pch_pic_handle[nr_pics] = domain_handle; pch_pic_priv[nr_pics++] = priv; - register_syscore_ops(&pch_pic_syscore_ops); + if (nr_pics == 1) + register_syscore_ops(&pch_pic_syscore_ops); return 0; -- 2.31.1