From patchwork Wed Sep 14 16:28:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Gondois X-Patchwork-Id: 12976396 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 286E9ECAAD3 for ; Wed, 14 Sep 2022 16:31:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BQmWeIEnRZJMbUW37o8rQbIGq7/H2Vf1rLpkZIHEYzM=; b=UrrxGC33BZYKvF 7nhJFkrcraQ/MMuCoW5rEux6zP3NdZN5Zu8hXLWGOPBzvxJKfRmw1GOkf9LBUvogIphTwYFMzM/EX y1VxZU27fq9lbIFUcjVOZeX0P52tFgDwDh3BpCKXrXQANsekw2xQZpfg9+3SsFseTF+qBj2KUCVxC 3wexHCcOL2q8d1RwcShrl8xkeVgvkuRD7KOsSfhE1xicou8tfagRdQPEGqd63AK++VHFhTKch140g lqx77NsB4bzQlk4wrbXUR/pYN/xIYiz/SDEByrABoDBeEIP5sO4+8Ckkmd4p3skQhBsvCZN2hdg9f 6kB2dzGbp4fr6U+0L1TA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYVHE-0059G3-Lz; Wed, 14 Sep 2022 16:30:16 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oYVGs-0058pX-4y for linux-arm-kernel@lists.infradead.org; Wed, 14 Sep 2022 16:29:56 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 445D81576; Wed, 14 Sep 2022 09:29:54 -0700 (PDT) Received: from pierre123.arm.com (unknown [10.57.78.24]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id B97853F73D; Wed, 14 Sep 2022 09:29:45 -0700 (PDT) From: Pierre Gondois To: linux-kernel@vger.kernel.org Cc: Pierre Gondois , Daniel Lezcano , "Rafael J. Wysocki" , Abhyuday Godhasara , Michal Simek , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/2] Save cpuhp dynamic state Date: Wed, 14 Sep 2022 18:28:13 +0200 Message-Id: <20220914162815.1954866-1-pierre.gondois@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220914_092954_308999_BBD90214 X-CRM114-Status: UNSURE ( 6.61 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Requesting a CPUHP_AP_ONLINE_DYN cpuhp state reserves a state among the range [CPUHP_AP_ONLINE_DYN:CPUHP_AP_ONLINE_DYN_END]. The reserved state must be saved in order to remove it later. Cf. __cpuhp_setup_state_cpuslocked() documentation: Return: On success: Positive state number if @state is CPUHP_AP_ONLINE_DYN; 0 for all other states Indeed, the following: cpuhp_remove_state(CPUHP_AP_ONLINE_DYN); removes the first dynamic states added to the cpuhp state machine. Patches were tested as: - powercap/drivers/dtpm: on a Juno-r2, using a late_initcall() to init and exit the dtpm framework. - driver: soc: xilinx: the patch was only compile tested due to missing hardware. Pierre Gondois (2): driver: soc: xilinx: Save cpuhp dynamic state powercap/drivers/dtpm: Save cpuhp dynamic state drivers/powercap/dtpm_cpu.c | 7 ++++++- drivers/soc/xilinx/xlnx_event_manager.c | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-)