Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1733385rdb; Mon, 2 Oct 2023 21:45:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHw9yInL5uxBKPE8xYv6xAfZhzgcKFkA0RqoihcZ/xplQg9regKG7TEZbgWZURNbhB7Wc0H X-Received: by 2002:a05:6358:9992:b0:13a:1e90:4813 with SMTP id j18-20020a056358999200b0013a1e904813mr13067737rwb.29.1696308307370; Mon, 02 Oct 2023 21:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696308307; cv=none; d=google.com; s=arc-20160816; b=SonS0j1Z8mMwzs7MTPaajE6upioaecdLD0zA/6QkNhh6JnNy17jdniHvZP2u7AXc3F OT64faS6hnWz0ITU1Yu+o3sv8COduTps2i/OxR6aJvrAn2GhyAiBjSj6JrW3VskBMqvt GjGPFxjtlgzHdxXvj+iZucICrCzz0MmoKliEg22WVvugJ+7E/jI8XABsnasoksreshrd nLvVVYob6SbMru7jGWieCHtbrAx91scrLsWDkbQgua1ZfG3mNGYuadQXzLr5PJkZgQs/ /gd7ZUbWN4ewOr0zBKyt8NxaRpb0K8sj0bfYzhf0mAyEwyQE4BUyJjffgPEcpl6ZVl7E Nyig== 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 :dkim-signature; bh=VOj9ECaB96rIjjnLWcT6tpDdCA0D2GI5mFoVxJymrv0=; fh=ZYtQOaPQ3bv/nEoeNBBJi+8gjEgXnsUn5nizHK4ZU74=; b=ieo4lmtcszUAcOepkPsR0vs+yErgd6w/0h+QF5hD0AU6ykWdTZ4Sn8Isf6oL9Qnh1b 6EzZen/e475gwIYNGmv/0e8U/nP/fFgBC1tb+cF2k3rprlXlGCwwC0jJq61FnXoVUsP3 77J84gUQONTh6PHTMz6ggATLx1TBovxhgSG+KHFql2CsKwmidVmoXpdOozFdxwHNs97e xnDxSwhPzul2No9hlf5xd6zlvOseola6g2yXREy4VmhOYCdCWWlYHrmUlErg3JtBLtCr ZhsBrsoFV6Ez2A9s0X5jSdo3nIByIWgDSYwoN6cc+v4qwdQHYPSmVa6mwyPDvjVLpZC+ E60w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OUIhVTg0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id cn5-20020a056a00340500b006933caa6f03si622532pfb.165.2023.10.02.21.45.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 21:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=OUIhVTg0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 307B78215AE1; Mon, 2 Oct 2023 21:45:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239116AbjJCEpD (ORCPT + 99 others); Tue, 3 Oct 2023 00:45:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239107AbjJCEo6 (ORCPT ); Tue, 3 Oct 2023 00:44:58 -0400 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ACF6F0 for ; Mon, 2 Oct 2023 21:44:54 -0700 (PDT) Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-565e395e7a6so254508a12.0 for ; Mon, 02 Oct 2023 21:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696308293; x=1696913093; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VOj9ECaB96rIjjnLWcT6tpDdCA0D2GI5mFoVxJymrv0=; b=OUIhVTg0w3otEiz9JTv35uLP4rCDXwqmTVC9TLZZLxpZSds3ylqEsc0otktFPMXBux BWNwGSTcITMP+EOZT9LrvPRI5kTENgMy6s7wx7ar25T+C6rrAHDBG6RjhwTo2cqyFWDh 98rIC8Tqi5A6cNG8uc93TvngDHYCqt+HQnPm5JKUFu/Q5x5JdZMmZPD6ZSYgLQuFC2Fs HblaY3qkc1wm9GrV9oj026WnZbXJ0oyTl4PnYG+kd82rjl9UsIiSnW/r8THYuRy/UU1I xGmDGeB+DFK/XH+XUU5XwmZHHBoc7cSjhKsbf6GPQVI6gvpbnkhUs60AILAxMccjjYxU qiNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696308293; x=1696913093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VOj9ECaB96rIjjnLWcT6tpDdCA0D2GI5mFoVxJymrv0=; b=IsFLFvvP4toTEY0/UeuwAYNEiVl07Ffm58Zg5Cj6mOy6FfU4x5a6xWWfjTxDyNEMs8 +TXlInEsY0VZwHgpG0g8XoKrCxu0SqM8aNLFUsz9r16x/kUBNwviuGsMCqNhW/aHyfc3 WiQiwB5B09kmMHS0a3i1NFwBImMAXSzAxpVVYD19sHrLR2n5P5eT/HUxiKTZymcHDpJW lkME6SjkN8D9ma2pa750ySyj/bzxXt9+7s8tF/pBD2qbbBpVTzvFel5xjsgdB9hXwoZF TBn5AKX2fMKZ/T1dhiREeqQ64erfXPZyN3sFcD9xFd5VD8srO7pC5BKzZ8AMLxZgsIE5 gF4Q== X-Gm-Message-State: AOJu0YwZbmvS294w4OQmOJ77aKqMbKlVW+RBArBTCeEFSjYEGSvcUpPq zbQ18F/SADxJWmCFQpWUE13w1w== X-Received: by 2002:a05:6a21:81a0:b0:15d:ae4a:9a72 with SMTP id pd32-20020a056a2181a000b0015dae4a9a72mr11250884pzb.61.1696308293211; Mon, 02 Oct 2023 21:44:53 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([171.76.84.132]) by smtp.gmail.com with ESMTPSA id h9-20020aa786c9000000b0068e49cb1692sm346421pfo.1.2023.10.02.21.44.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 21:44:52 -0700 (PDT) From: Anup Patel To: Palmer Dabbelt , Paul Walmsley , Thomas Gleixner , Marc Zyngier , Rob Herring , Krzysztof Kozlowski , Frank Rowand , Conor Dooley Cc: Atish Patra , Andrew Jones , Sunil V L , Saravana Kannan , Anup Patel , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Anup Patel Subject: [PATCH v10 04/15] irqchip/sifive-plic: Fix syscore registration for multi-socket systems Date: Tue, 3 Oct 2023 10:13:52 +0530 Message-Id: <20231003044403.1974628-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003044403.1974628-1-apatel@ventanamicro.com> References: <20231003044403.1974628-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 02 Oct 2023 21:45:06 -0700 (PDT) On multi-socket systems, we will have a separate PLIC in each socket so we should register syscore operation only once for multi-socket systems. Fixes: e80f0b6a2cf3 ("irqchip/irq-sifive-plic: Add syscore callbacks for hibernation") Signed-off-by: Anup Patel --- drivers/irqchip/irq-sifive-plic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/irqchip/irq-sifive-plic.c b/drivers/irqchip/irq-sifive-plic.c index e1484905b7bd..5b7bc4fd9517 100644 --- a/drivers/irqchip/irq-sifive-plic.c +++ b/drivers/irqchip/irq-sifive-plic.c @@ -532,17 +532,18 @@ static int __init __plic_init(struct device_node *node, } /* - * We can have multiple PLIC instances so setup cpuhp state only - * when context handler for current/boot CPU is present. + * We can have multiple PLIC instances so setup cpuhp state + * and register syscore operations only when context handler + * for current/boot CPU is present. */ handler = this_cpu_ptr(&plic_handlers); if (handler->present && !plic_cpuhp_setup_done) { cpuhp_setup_state(CPUHP_AP_IRQ_SIFIVE_PLIC_STARTING, "irqchip/sifive/plic:starting", plic_starting_cpu, plic_dying_cpu); + register_syscore_ops(&plic_irq_syscore_ops); plic_cpuhp_setup_done = true; } - register_syscore_ops(&plic_irq_syscore_ops); pr_info("%pOFP: mapped %d interrupts with %d handlers for" " %d contexts.\n", node, nr_irqs, nr_handlers, nr_contexts); -- 2.34.1