From mboxrd@z Thu Jan 1 00:00:00 1970 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 20E86C3DA7F for ; Fri, 26 Jul 2024 11:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=TIwIpUbFz/H6EUgJOJbGGmCMKXKf3g2zDSDRpYqEU2Y=; b=BfpxEjQ0ysVwIRBQV5rnxtJjEq Pt6AdVECfpv8vlwPb620cjOcIFrXzyhKB/05EGt4DUqLYzb9YY+ZPVAIXm5Hvh7/vGcaWy3yd9q1J 63ob/yjtq9Y7CyeODAaAWrlvVFL4w3Yro+XK4lKzdHwH3BcEDCmZ6XNzcN/6EYBJfkSGp4aNmarjg oi3AElWmJXM9Bp6/XecEhxTbTMVrtirR8m8DqyGwu0/Rp3ytO4jUwHQq2WIBrgYus6B5mKJIN7RF8 IjRWdiwa5Njf4mTDyk12gIwIFAtxoqiRvEu2UqWbWZvf1JnJDFafd2wVy7wQ2OcbL6ZFVaR4UMcJO Y73YbSow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXIvM-00000003gVD-1qVK; Fri, 26 Jul 2024 11:15:48 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sXIul-00000003gGk-1Hwj for linux-arm-kernel@lists.infradead.org; Fri, 26 Jul 2024 11:15:12 +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 DCE021007; Fri, 26 Jul 2024 04:15:33 -0700 (PDT) Received: from pluto (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E65EA3F73F; Fri, 26 Jul 2024 04:15:06 -0700 (PDT) Date: Fri, 26 Jul 2024 12:14:54 +0100 From: Cristian Marussi To: "Peng Fan (OSS)" Cc: sudeep.holla@arm.com, cristian.marussi@arm.com, mturquette@baylibre.com, sboyd@kernel.org, linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, arm-scmi@vger.kernel.org, Peng Fan Subject: Re: [PATCH] clk: scmi: add is_prepared hook Message-ID: References: <20240725090741.1039642-1-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240725090741.1039642-1-peng.fan@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240726_041511_460267_1974EE6A X-CRM114-Status: UNSURE ( 8.57 ) 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 On Thu, Jul 25, 2024 at 05:07:41PM +0800, Peng Fan (OSS) wrote: > From: Peng Fan > > Some clks maybe default enabled by hardware, so add is_prepared hook > to get the status of the clk. Then when disabling unused clks, those > unused clks but default hardware on clks could be in off state to save > power. > Hi Peng, seems a good addition to me, I forgot to add supporrt for non atomic scenarios like for clk enable/disable.... ...having said that, though, you basically copied the original ATOMIC version of this function and changed only the ATOMIC -> NON_ATOMIC param for the state_get() call... ...unless I am missing something, this sounds to me as needless duplication of code...please rework the original existing function to be an internal helper acceppting an additinal parameter (ATOMIC, NON_ATOMIC) and then build 2 wrappers omn top of it for the original and your new function... Thanks, Cristian