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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03823C7EE2D for ; Thu, 25 May 2023 23:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241746AbjEYXjy (ORCPT ); Thu, 25 May 2023 19:39:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241637AbjEYXjv (ORCPT ); Thu, 25 May 2023 19:39:51 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3975B134 for ; Thu, 25 May 2023 16:39:49 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2af1c884b08so3355271fa.1 for ; Thu, 25 May 2023 16:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685057987; x=1687649987; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=J3ShwMSx7Uo4NT4nhrrIA5wjOwvMR7I73Ygk+ShVDI8=; b=g/i9fav5m2QDxpBgCAs52QBCggiW5t0N9Dl9y/a81ODrgx+XfMQvxqdKQdFJaQu0Rg f+ZAqBVd3HsY4l2IPebxNmeh04i5EEUQkkimcZH3uSLbw9nZ1V5AS+rItivqKzsZzCNc g50hOyRJ5xlXA6uBhLhJe+Mc3DIqveib01Z2dxHFC17Xa5rnQvN9zdYyNeQHd0CQgBvq 2RYxtBtIxDEOUXwmGhIh+46FYhnHvJLa13uyaBTylvDK3x4B+6y+sxxSo6A+ZiQgsn6K ht4UeTu68dge2pqM03orfXkr5C8tC13NVRqzS4ZmvkO5Wf0AnaMZ27eysq92e7cAEeYo YqOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685057987; x=1687649987; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J3ShwMSx7Uo4NT4nhrrIA5wjOwvMR7I73Ygk+ShVDI8=; b=OPtVBqOZIjMJZKojIo7SbGT87SOR4r+9Cdp9HzBBMIlBMsTo1xqlR7+6asuLESiP/e dOazXkDHDY3e8gltyQyIuV7NeHj5mjjr1uJJ8zfygZVDBSf4CVPaOfaXopWNGAoOYWQw 5XfrNgQf+Qjd23KmDB5iKl3/iGNkgnBj7mt256I2UT9Of0QFWKP2evrqn8zqibkqCTDV XBcVKc+rCZ8SvWW/VmfjeyHvUBVKs7xduU/NKtMnnmHNJk2GF64RfFL/ziVPVfezrrGl V6ZrWElpjfEmwVyai2WKsIcoV+AIlkp0aEBAsfcmy8/HhcSYg5RR8ZX0ejFIs7hWry5p VO0w== X-Gm-Message-State: AC+VfDw3d8kZ3DlcCO4u6uoe0zjwp94B1wRQNKu3K8mLYsbiZWeuL1CJ 7O1r1+KUBFHWOExXjyKoSX8+bw== X-Google-Smtp-Source: ACHHUZ4dG/us25PBxwby+47FvpimKaqgiXwMzX9fQaa/ANCtEgtlZuH7c4RAlNOPbmyNzbTmM6As/Q== X-Received: by 2002:a2e:b625:0:b0:2ad:9edd:4e2 with SMTP id s5-20020a2eb625000000b002ad9edd04e2mr1273646ljn.20.1685057987456; Thu, 25 May 2023 16:39:47 -0700 (PDT) Received: from [192.168.1.101] (abyj77.neoplus.adsl.tpnet.pl. [83.9.29.77]) by smtp.gmail.com with ESMTPSA id s24-20020a2e9c18000000b002a8ae16ac8csm437988lji.18.2023.05.25.16.39.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 May 2023 16:39:47 -0700 (PDT) Message-ID: Date: Fri, 26 May 2023 01:39:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH 8/8] arm64: dts: qcom: msm8916-pm8916: Mark always-on regulators Content-Language: en-US To: Stephan Gerhold , Bjorn Andersson Cc: Andy Gross , Srinivas Kandagatla , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht References: <20230510-msm8916-regulators-v1-0-54d4960a05fc@gerhold.net> <20230510-msm8916-regulators-v1-8-54d4960a05fc@gerhold.net> From: Konrad Dybcio In-Reply-To: <20230510-msm8916-regulators-v1-8-54d4960a05fc@gerhold.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 17.05.2023 20:48, Stephan Gerhold wrote: > Some of the regulators must be always-on to ensure correct operation of > the system, e.g. PM8916 L2 for the LPDDR RAM, L5 for most digital I/O > and L7 for the CPU PLL (strictly speaking the CPU PLL might only need > an active-only vote but this is not supported for regulators in > mainline currently). Would you be interested in implementing this? Ancient downstream defines a second device (vregname_ao) and basically seems to select QCOM_SMD_(ACTIVE/SLEEP)_STATE based on that.. Looks like `struct regulator` stores voltage in an array that wouldn't you know it, depends on the PM state. Perhaps that could be something to explore! Konrad > > The RPM firmware seems to enforce that internally, these supplies stay > on even if we vote for them to power off (and there is no other > processor running). This means it's pointless to keep sending > enable/disable requests because they will just be ignored. > Also, drivers are much more likely to get a wrong impression of the > regulator status, because regulator_is_enabled() will return false when > there are no users, even though the regulator is always on. > > Describe this properly by marking the regulators as always-on. > > Signed-off-by: Stephan Gerhold > --- > arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 5 ----- > arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi | 5 +++++ > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts > index ab8dfd858025..1c5d55854893 100644 > --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dts > +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dts > @@ -358,11 +358,6 @@ pm8916_l17: l17 { > }; > }; > > -&pm8916_s4 { > - regulator-always-on; > - regulator-boot-on; > -}; > - > &sdhc_1 { > status = "okay"; > > diff --git a/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi > index b38eecbd6253..64d7228bee07 100644 > --- a/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi > +++ b/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi > @@ -72,11 +72,13 @@ pm8916_rpm_regulators: regulators { > pm8916_s3: s3 { > regulator-min-microvolt = <1250000>; > regulator-max-microvolt = <1350000>; > + regulator-always-on; /* Needed for L2 */ > }; > > pm8916_s4: s4 { > regulator-min-microvolt = <1850000>; > regulator-max-microvolt = <2150000>; > + regulator-always-on; /* Needed for L5/L7 */ > }; > > /* > @@ -93,6 +95,7 @@ pm8916_s4: s4 { > pm8916_l2: l2 { > regulator-min-microvolt = <1200000>; > regulator-max-microvolt = <1200000>; > + regulator-always-on; /* Needed for LPDDR RAM */ > }; > > /* pm8916_l3 is managed by rpmpd (MSM8916_VDDMX) */ > @@ -102,6 +105,7 @@ pm8916_l2: l2 { > pm8916_l5: l5 { > regulator-min-microvolt = <1800000>; > regulator-max-microvolt = <1800000>; > + regulator-always-on; /* Needed for most digital I/O */ > }; > > pm8916_l6: l6 { > @@ -112,6 +116,7 @@ pm8916_l6: l6 { > pm8916_l7: l7 { > regulator-min-microvolt = <1800000>; > regulator-max-microvolt = <1800000>; > + regulator-always-on; /* Needed for CPU PLL */ > }; > > pm8916_l8: l8 { >