Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5488486rwl; Tue, 21 Mar 2023 20:26:21 -0700 (PDT) X-Google-Smtp-Source: AK7set9JMOBjSg4ejCVKfUoAMjScjw9yB2b4qSzszD2qheCurEnWKc9g00hYTXUg5oslisqqrw2c X-Received: by 2002:a17:90b:3ec7:b0:23e:feef:38ef with SMTP id rm7-20020a17090b3ec700b0023efeef38efmr1837078pjb.41.1679455467195; Tue, 21 Mar 2023 20:24:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679455467; cv=none; d=google.com; s=arc-20160816; b=NVLpxyCEyOI2ZE/rjmkwcSPnQ1XVmza4e8r+RBN9WT7wCwxQi6S1ujyA9HtgN8f5Uu d0L0QzpJpPv43eKKxPx2cpJsLjNC85gU45VSVtkm0jY+gbEP8gXiYEAoPVwX5R6L6RWW 5nTM0H2GsqZ60+eAg/136SmZmbl+iLyMJLl3ihNavDj7P/RfBqOgTpu0XpX72zeJNRVM 8a4Ra2dD+kEBFQqxdVgwc7kNBAho/a21dq9O6/M1T8OfF1XiD+1TTU9xG6oEYgReHKmF b/wCDjv9L9DRZUZCSjH7FnsJh3hDGdB5RM5/dbeWJgMjWJz4oAhWkRz2waWxG+4DOB9J sTvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+aRWn4YECSjTw7Z0lqgLB8Ba8cI6BEONoh06UDZ1qsc=; b=yGCGW7FlK05dRoVstCM5cP1RdHpd5m6hvq8d6H/KRN4XjgJtqDnGGWrSvbGi+jYzWv CSKj+HrpnTr/wJZ8jWAWh6UVG7aRRymswe5bb9t5WQlyESTc1iFoXPtapXb+nZ1Sc0hN migcNl17vhygbkgJTVAy6Qa3/H6NjTycX5oVQ7n3rEuC+Yar29y8ogeuXw5ITKdf5S05 byHkhtJTZb3ODGHZqGJKkMZOVhTo4/1hE3NZieqCYrJVxnav40pukhmj2VlIPNOXkXqV Lae+5FD3wN6KwSzkwL7S6WKwpN5BUO39mRO8mJsa2wLxhDAsxVsYewGrq11SkD1aGoqb lQKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fBKnxxoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a17090ad81500b0023c06116a1esi19999316pjv.36.2023.03.21.20.24.14; Tue, 21 Mar 2023 20:24:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fBKnxxoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230030AbjCVDTy (ORCPT + 99 others); Tue, 21 Mar 2023 23:19:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230101AbjCVDTw (ORCPT ); Tue, 21 Mar 2023 23:19:52 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BACE54A1D5; Tue, 21 Mar 2023 20:19:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5689B61F2A; Wed, 22 Mar 2023 03:19:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D079AC433D2; Wed, 22 Mar 2023 03:19:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679455189; bh=Ll4mdzz4ZdDA497jhdQvJ5RZFR2hipZ/r4YfSaeeXsk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fBKnxxoqNQJDCu2RDkv3SLcGtXxuun0U2yEbvI2ts3QrsqE5DeLK5pmQOqIgsZlGv /0Il16S4ft3Sjy2fcmZDKjwbFCz+5D0U1ytzUH0MUTQUarNscxBWai4Mlj8MBjJF+b ybJAVqj5K4friyXgB8rR9E7ivGJEzy8rDOYnUPWAbQ/F+bVsLVieEI+DOqMbhWBozG o1Smt9Q5mO86twMIg7wOc9EYMX6sI9naRP/u4UYGECFAMIrkB5UhHwVShSxWYIzTqv 5aFnmTDxPIHjO3BRcLfcpM1LEjeUmjhyyVpSstkxB+JD6ZrGGJEWrZmj2YxzdOUJuE +sx2qEAHsBzNw== Date: Tue, 21 Mar 2023 20:23:02 -0700 From: Bjorn Andersson To: Konrad Dybcio Cc: Andy Gross , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , devicetree@vger.kernel.org Subject: Re: [PATCH RFT v2 01/14] dt-bindings: clock: qcom,rpmcc: Add a way to enable unused clock cleanup Message-ID: <20230322032302.objqdzryhq2mbljf@ripper> References: <20230303-topic-rpmcc_sleep-v2-0-ae80a325fe94@linaro.org> <20230303-topic-rpmcc_sleep-v2-1-ae80a325fe94@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230303-topic-rpmcc_sleep-v2-1-ae80a325fe94@linaro.org> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 08, 2023 at 10:35:17PM +0100, Konrad Dybcio wrote: > Disabling RPMCC clocks can be a bit touchy. If we can't guarantee all > (or at least most) of the oneline peripherals ask the interconnect > framework to keep their buses online and guarantee enough bandwidth, > we're relying on bootloader defaults to keep the said buses alive through > RPM requests and rate setting on RPM clocks. > > Without that in place, the RPM clocks are never enabled in the CCF, which > qualifies them to be cleaned up, since - as far as Linux is concerned - > nobody's using them and they're just wasting power. Doing so will end > tragically, as within miliseconds we'll get *some* access attempt on an > unlocked bus which will cause a platform crash. > > On the other hand, if we want to save power and put well-supported > platforms to sleep, we should be shutting off at least some of these > clocks (this time with a clear distinction of which ones are *actually* > not in use, coming from the interconnect driver). > > To differentiate between these two cases while not breaking older DTs, > introduce an opt-in property to correctly mark RPM clocks as enabled > after handoff (the initial max freq vote) and hence qualify them for the > common unused clock cleanup. > > Signed-off-by: Konrad Dybcio > --- > Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml > index 2a95bf8664f9..386153f61971 100644 > --- a/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml > +++ b/Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml > @@ -58,6 +58,12 @@ properties: > minItems: 1 > maxItems: 2 > > + qcom,clk-disable-unused: This is a Linux implementation detail, not a description of the hardware. So it unfortunately doesn't belong here. > + type: boolean > + description: > + Indicates whether unused RPM clocks can be shut down with the common > + unused clock cleanup. Requires a functional interconnect driver. This is an interesting aspect though, there's a lot of things that will break if any one of these building blocks are missing, for any reason. Regards, Bjorn > + > required: > - compatible > - '#clock-cells' > > -- > 2.39.2 >