Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3353481rdb; Wed, 13 Sep 2023 09:27:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUmy/QcaxGv0fDApaHoXC8H/djsQGyIEsO+wFq4dfgTe41w4/1FskRHn34UJW2AzqlZiZ4 X-Received: by 2002:a05:6808:15a4:b0:3ac:a376:707d with SMTP id t36-20020a05680815a400b003aca376707dmr1667986oiw.3.1694622421984; Wed, 13 Sep 2023 09:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694622421; cv=none; d=google.com; s=arc-20160816; b=RI2BZ63ADkX+7eQ/dBPRdoTjQnmFQVDUXbM8L6pICgykND7MaeSGOqYloJnADUzTv8 Md6kMs1UT78+YeJTKiezSlJIvNiYqze01Q11wEX73+IIWM/XyQ5d6JKgDJFlBk5HpXoT 3f/OUP+oBUtx/4boSkzX3c0QDZAqo4P/eU7ZEPL40c3GXQMDG+O8XliVJjng25YPSh+C JfDc7FWvlTl56p8Yh9dT5PhRQVCrogtassDyPsu24KHk4pzLdxtVQoyOgHOwsBYCQlHZ rhWefjgwavISbcBa62a0IO9euwsdkmaTyDLiyFqMzJA8sYk5ir3ui4yqpOej7URAe2Zf I6GA== 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=KCVa9hJzP2APKbmQpyeCR0W7lcMtt7PzRbdh31HXulM=; fh=ZYtQOaPQ3bv/nEoeNBBJi+8gjEgXnsUn5nizHK4ZU74=; b=sarwSGxwuIfmUSBYbU2YA8+TNfFqPaaQoFrPQ+rcIHTEZH1XkU1bFgm63j5e2M8B92 2H5y/X7qpN1K/UXufBYIA7cbOfAINbtlZPFBtJxaNtJINQb0ahxhckwFV3W9jdAfXZ65 QiOHW4RXy+uY62SWNr5YF5rPGH20a2z8I+nFcqGJK5wjyRzvYxu5FCflWZMuhfu+olFJ 1m+LoHDusPy2dCJ8MPnBE6OqicnCgp8N0kp59+8FJXnuvfISv5W12uxAW4d4Dc8wphIg 3bic+ZLsuhQyOvKyp3kCSo1HPiU3K+8aPjm9FN+6HYjAE+O8kOfccnCiLYHRDGSXQzyC degA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="J/HhH35/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id k189-20020a6384c6000000b00565f4fb0999si9902711pgd.610.2023.09.13.09.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 09:27:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="J/HhH35/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 B5F3C8254A83; Tue, 12 Sep 2023 10:50:59 -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 S236885AbjILRvA (ORCPT + 99 others); Tue, 12 Sep 2023 13:51:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236934AbjILRux (ORCPT ); Tue, 12 Sep 2023 13:50:53 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7318710F6 for ; Tue, 12 Sep 2023 10:50:49 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c1e780aa95so40604855ad.3 for ; Tue, 12 Sep 2023 10:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1694541049; x=1695145849; 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=KCVa9hJzP2APKbmQpyeCR0W7lcMtt7PzRbdh31HXulM=; b=J/HhH35/a0s/pYGuGN46/ZdMOfdSLAEHJcR2bFhimQDzbQUvGBOrwnHWnBODOVzQuA kU9qdnajPm28W9yJXa/02zm0UJqh6bSNi+jhVoW/5tvAIM0QGZ3D32d3nsIPVBGer5vI JCx0XsKO8xElDpqiqB7BYfVzt9mn2MxicA0gmkcAoD3pfB29bBjrgxQSEcW7gnmXhH5B JitwDEvCyy02rWu/fzQR2smgwl+kG61WY3/5szSmdTQLNk69nnedMLvsFohtw1WenPEs ADfoRD9RX4Hwti5o61hGjgDZ2LCGMH55QWKKPmKRjWAFF9dN+lyp4xk8TxHEm1RQemxn 5KAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694541049; x=1695145849; 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=KCVa9hJzP2APKbmQpyeCR0W7lcMtt7PzRbdh31HXulM=; b=P/xnvh0uecqp6T/s/pTmJy3NdVEhid/o9GFrLzE4bdixUhRVJF7kfRA+5cwe13CtZC WB/QEgxXZ4qZrBuu/iH2764/KDMdklBtdJvp2dAFxSZCmU0qCPA7uG3DhgknDhWYlZNw 3nLnW8Z0gw8vpA72XlbbXD/fGsRo7KCHiqAiTO/cXLgySwlu2mCRpWblDOt/7kawOY/W B/pwrm+2fp523ti3ctJRaP3riDHd+Ay+QDaSuPdt9nCqaJv61m033dnIgtlMTaeSXnaK Go0ERseCO4OmPWIpwY5Zb4coSt8j5D3EFkCpT2t2n6RkPhyMx1wApmFgglrAo8yXY4fG GIDQ== X-Gm-Message-State: AOJu0Yx1W23Ylhal6njScAH4anoDWxdPTLFtscqICVa9Zh2KcBn8kUo0 hyDlWspcMZYDSbdYA6Ca8U2AGA== X-Received: by 2002:a17:902:ec89:b0:1c3:9632:f144 with SMTP id x9-20020a170902ec8900b001c39632f144mr578158plg.31.1694541048828; Tue, 12 Sep 2023 10:50:48 -0700 (PDT) Received: from localhost.localdomain ([171.76.81.83]) by smtp.gmail.com with ESMTPSA id p12-20020a170902a40c00b001b891259eddsm8691440plq.197.2023.09.12.10.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 10:50:48 -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 v8 05/16] irqchip/sifive-plic: Fix syscore registration for multi-socket systems Date: Tue, 12 Sep 2023 23:19:17 +0530 Message-Id: <20230912174928.528414-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230912174928.528414-1-apatel@ventanamicro.com> References: <20230912174928.528414-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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]); Tue, 12 Sep 2023 10:51:00 -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 56b0544b1f27..62ba27553cc3 100644 --- a/drivers/irqchip/irq-sifive-plic.c +++ b/drivers/irqchip/irq-sifive-plic.c @@ -533,17 +533,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