From patchwork Tue Oct 3 04:43:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 147618 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp1853620vqb; Mon, 2 Oct 2023 21:45:46 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGCXRk6ko+TrT/K66QAXI7pY09MRfCPsQxO6NjFprnb55GwcwOv5EzbGBrSOubC3Xn8Dz6q X-Received: by 2002:a05:6a00:134c:b0:690:b8b1:7b9e with SMTP id k12-20020a056a00134c00b00690b8b17b9emr13231850pfu.0.1696308346326; Mon, 02 Oct 2023 21:45:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696308346; cv=none; d=google.com; s=arc-20160816; b=xGo20F8jsKq1QrISqbpJc0kt8/qzoeeSJ0q73AYX+LN5I88iVQQdJqP5SJqV5Pq9ku TomlaEQsAyzTWBn+9tsbwQZBo9HDqHv0qfnoZlj70zg9XF73Yx2ICWfvNRcJevY2gqS+ xw8AMTI35ry0z9cjqL2vBZSbjvD2t1g7imVzIr2BO5lRoqSU86m6dgYCYHRLLwCFxA+J HhGGVoYlpIa/LWFPQadhFtlmwXFqarCFaSUM2qzJUsoE5XwVqqptMX3RHWyh5EG3vs60 QwG3gY9MLNmviS8s3z2u88V/w3ilWxWKaZWgY2p2v3FeSK1TeeMWXDA8jpb2LuyRrPNy H/qg== 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 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ct23-20020a056a000f9700b006880a2ca0fasi599728pfb.312.2023.10.02.21.45.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 21:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; 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 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 42770801BAFF; Mon, 2 Oct 2023 21:45:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239122AbjJCEpE (ORCPT + 18 others); Tue, 3 Oct 2023 00:45:04 -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 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Mon, 02 Oct 2023 21:45:33 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778708220542019865 X-GMAIL-MSGID: 1778708220542019865 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);