Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3049119rdh; Thu, 28 Sep 2023 00:29:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEM7zRDjsb3ky3FeC5yFAL2KciKnfWoCXgWxZbBXgIF1k+IkrPoXlfDg88ee7vB8XROFG9o X-Received: by 2002:a05:6358:785:b0:142:f9dd:5aa with SMTP id n5-20020a056358078500b00142f9dd05aamr550948rwj.0.1695886177992; Thu, 28 Sep 2023 00:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695886177; cv=none; d=google.com; s=arc-20160816; b=UAuxzYsySqpIGnz39t0V28HFyC4Lr/l2F94j+6NYMrADCnnfQkJ9AUvlT0cd+cOn5/ xQhnvzxfUnll79C2eRAaEUo7uEciwIcxTY2eWv9I7dqJ9NYjRJfIDq++TGmd84H/S9cg uMVTASVCJg6az8RK0BYnVnggDffO8dLoArPKDKzDjHINuQnuvAzMBy12LlJByl2Hboiq p5wSb/JknBtmi3XwpF5QC0Hpp6rfjIgjgOiE5TlRb9i2KIaYwmpOMxbhcI9lHLV4sbaI /p4tuyqmng+sySXLDi0Nc+e6zIL2ZyfJ+sA1MBonlvRaxObkj3Omc8t7r/rxKnpUJk0P zvdg== 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=MLiLQ5jhvy2n6XKOO1Zhu44OYozqnQvTSnGBoHSvlwooUM0m0OOZNLppqnn8jbBXKr 4DlRQfSFldJXzIijq1WYzIFL4J1NTM4K1IQRCInhGN2Ol3r/DwvEAG2jtk/dRWenlr4K 1RB56eZYVEU1NxzNFiXhhWChMChNXNdRR1r+9Rl9tBt7jQfQk7zVc8szvjyipIYx2ttE g6072zB4Btyz/HZRST8QeT2WA7g17X7eY2urbb7zKuH4c9cM4uD7VrzDoiRYyS8hjEKb LBz09wTpGwk0GI7whoMqBrISVgoDa1y6421ROOVlkzLJl9O7ccVP9lzYj4kumaS/i6jI PR9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=QlHD7M2V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id e190-20020a6369c7000000b005660335e26fsi17391876pgc.485.2023.09.28.00.29.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 00:29:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=QlHD7M2V; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 28BED801B18F; Wed, 27 Sep 2023 23:13:14 -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 S230274AbjI1GNE (ORCPT + 99 others); Thu, 28 Sep 2023 02:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230271AbjI1GM4 (ORCPT ); Thu, 28 Sep 2023 02:12:56 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBCDEBE for ; Wed, 27 Sep 2023 23:12:54 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id e9e14a558f8ab-35133097583so30269785ab.1 for ; Wed, 27 Sep 2023 23:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695881574; x=1696486374; 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=QlHD7M2VCWNWRy8yCsO63G7PVAUPZfZfl1R8TD9paYKLMAXr65yWcF6OeC4jAaT+RH IfK4q9cL0IY3DPEYSPUu8ArtKc276PmJu8axDXLiKDpB0Xqa+xySl7+l1PB6hk6eLaTm xFmeaDNyc+genFrQKHcCPQiAFfrVFs8Ec2Mz3SB8FJaTD6PBXBnJSn2BQiX1xAt8NjiV pCCHZzm7jv6d6Qrst1lDNahmb/z1DLcMkQ+NA0E4moWuTPKbcr+V55ZFEuEhFG6QP/Mw RsrGGhHqUSPNZ9uZlYGpKXmf2wGA4D2ONma9Q57iZYrVI+Phkw1y8Xo3KMR1OF4m6lzb pTKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695881574; x=1696486374; 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=KZj/aFC+inYnIRTQqUM2pLfcNcMUUBBE3Uu9ZgaP1+o17MFhdGAnF+xAalw4X/BTs+ 4zSh8o5h8aouqsz7+qdNt6wIViMEzpGcLGmA5lgINVRm0iYD3p/oJMpScu2uS/8y+Bwf V3fHZ1XjqiXw0JMpvIYYZY/xJrR+/8C4t/BlBXY7TXf6qOW2xRdvSy6a/mPHiWuOKlyV gKtY3fjgmoY1Uh55qfUkGb6jt/RH0r7MeXp7AOI//y/JRJ5JlOpDw7iOFJN6xxCXcpYN 5ohBhKKgdu05Wb8fcJoB3VJQSBpdZEgKrlWRmtwpg/tNt75YFscEThlYp519WroDhR61 y5Qg== X-Gm-Message-State: AOJu0YyN7jurS70QFwQo9r9TmCllj70+O6qBouTNSnI3evpi+NPYjPxl 27xliihbTO0buiNyRpzgSO19Fw== X-Received: by 2002:a05:6e02:1c22:b0:351:4b68:ec3d with SMTP id m2-20020a056e021c2200b003514b68ec3dmr232692ilh.16.1695881574077; Wed, 27 Sep 2023 23:12:54 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id x6-20020a92d306000000b003506f457d70sm4774467ila.63.2023.09.27.23.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 23:12:53 -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 v9 04/15] irqchip/sifive-plic: Fix syscore registration for multi-socket systems Date: Thu, 28 Sep 2023 11:41:56 +0530 Message-Id: <20230928061207.1841513-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230928061207.1841513-1-apatel@ventanamicro.com> References: <20230928061207.1841513-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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]); Wed, 27 Sep 2023 23:13:14 -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