Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp934660rwl; Fri, 31 Mar 2023 04:41:22 -0700 (PDT) X-Google-Smtp-Source: AKy350aC2Y+oynTImf9lZcP1oXgbiftbnAAZPzqh5tLJEVNscomKnatPn71sU/DxnhgESlCVi++A X-Received: by 2002:aa7:86d1:0:b0:62d:e32a:8b5a with SMTP id h17-20020aa786d1000000b0062de32a8b5amr2283086pfo.2.1680262881955; Fri, 31 Mar 2023 04:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680262881; cv=none; d=google.com; s=arc-20160816; b=Aa+7M7m+coT41FnFTNCzrNY3cq1V8q7kA9C2lARbKOL7lmdTDUMu1/mmJEIukAP5TZ h2ZVoex/tyM6UAkSK2x5omXfl+JtA8pkn8KgxDN3VKLRzDcSAyinm4IbqTRjYw0ROJ4m piVsxyQF6xf9Ou3YqFLMbSVJsjk4AuoNOYQfGluF2dq5duU8jQVfjN1gGCzThT5W6qiO q48lCaM7vykdL55ppaJGbz7BIW1RVa/g/HH+u8Ab6izEZzDz7kue6ujTXqwZGZSSLOh8 QuVPkmHHhiursAPrzUUzjDTEr3ds9R0afA0VJsbV25n1r34qTdO1Mu30gZ5qchYwUKZG FZjw== 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=iOvlDZHlAzMjvwBqyJ2YfXfaeUut/3zr5NKLadv0jyQ=; b=JAL9LcUMFVUDNffaCyyY0xu/z6AR0EmdepXXksXLNkiQB7yhBT0nci8Ad7+ucaInYx 0W9EXTfs1qqgbsjZalYHAViQCNjLe5vvMvH3BlHnA6ThuTqVgXUNAbR09fAk4o80Cha+ MOa4CiCMWMJV2O/EO1DDYYw/7iZ4CxRPT3jnYlW/i1d6DAPDogS6nG9Q/yKqeXlwNVBe RRP+04TsKdba4udMsiMA1XG8MLyL9GEztgpzRMGYlG3+xYGiCCcLTnSVZYbm+U7nxmNv AA/T2s5VSq6pxFhClr2+oS5qGXKUpEfrgbr+9mBP0iIL1LdvOKjIyd4VOp/ouQlfujYB Ab3Q== 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 u70-20020a638549000000b0050be5c11c34si2294918pgd.840.2023.03.31.04.41.10; Fri, 31 Mar 2023 04:41:21 -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 S231904AbjCaLjP (ORCPT + 99 others); Fri, 31 Mar 2023 07:39:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231685AbjCaLjE (ORCPT ); Fri, 31 Mar 2023 07:39:04 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3AB951A453; Fri, 31 Mar 2023 04:39:02 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.153]) by gateway (Coremail) with SMTP id _____8DxAf9VxiZkP+0UAA--.32481S3; Fri, 31 Mar 2023 19:39:01 +0800 (CST) Received: from loongson-pc.loongson.cn (unknown [10.20.42.153]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Bx57xUxiZkmwASAA--.12675S6; Fri, 31 Mar 2023 19:39:00 +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 V2 4/5] irqchip/loongson-pch-pic: Fix registration of syscore_ops Date: Fri, 31 Mar 2023 19:38:59 +0800 Message-Id: <20230331113900.9105-5-lvjianmin@loongson.cn> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230331113900.9105-1-lvjianmin@loongson.cn> References: <20230331113900.9105-1-lvjianmin@loongson.cn> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Bx57xUxiZkmwASAA--.12675S6 X-CM-SenderInfo: 5oymxthqpl0qxorr0wxvrqhubq/ X-Coremail-Antispam: 1Uk129KBjvdXoW7Xr43Xr4UCFyUAryDuFy8Zrb_yoWkJrbEgr yIqFsrJw18Zr1Uu3y3Zr15XF43ta1UWFn5uFZ8KF9xJ3yrX34fJr12yrn8Cw47Ga48AFnx G398WrnakryxCjkaLaAFLSUrUUUUnb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY A7kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUAVWUZwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Cr1j6rxdM2kK e7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI 0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWrXVW3AwAv7VC2z280 aVAFwI0_Gr0_Cr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkF7I0En4 kS14v26r126r1DMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMxCIbckI 1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_Jr Wlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26ryj 6F1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42IY6xAIw20EY4v20xvaj40_Jr 0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUv cSsGvfC2KfnxnUUI43ZEXa7IU0XzstUUUUU== 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") 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