On SM8250 both the display and video clock controllers are powered up by
the MMCX power domain. Handle this by linking clock controllers to the
proper power domain, and using runtime power management to enable and
disable the MMCX power domain.
Dependencies:
https://lore.kernel.org/linux-pm/1628767642-4008-1-git-send-email-rnayak@codeaurora.org/
(pending inclusion into 5.15)
Changes since v6:
- Dropped dependency on Bjorn's patches
- Restored required-opps properties
- Held pm device state while gdsc is powered on, removing dependency on
genpd's power_on() powering the domain into required state.
Changes since v5:
- Dropped devm_pm_runtime_enable callback to remove extra dependency
Changes since v4:
- Dropped pm_runtime handling from drivers/clk/qcom/common.c Moved the
code into dispcc-sm8250.c and videocc-sm8250.c
Changes since v3:
- Wrap gdsc_enable/gdsc_disable into pm_runtime_get/put calls rather
than calling pm_runtime_get in gdsc_enabled and _put in gdsc_disable
- Squash gdsc patches together to remove possible dependencies between
two patches.
Changes since v2:
- Move pm_runtime calls from generic genpd code to the gdsc code for
now (as suggested by Ulf & Bjorn)
Changes since v1:
- Rebase on top of Bjorn's patches, removing the need for setting
performance state directly.
- Move runtime PM calls from GDSC code to generic genpd code.
- Always call pm_runtime_enable in the Qualcomm generic clock
controller code.
- Register GDSC power domains as subdomains of the domain powering the
clock controller if there is one.
----------------------------------------------------------------
Dmitry Baryshkov (8):
dt-bindings: clock: qcom,dispcc-sm8x50: add mmcx power domain
dt-bindings: clock: qcom,videocc: add mmcx power domain
clk: qcom: dispcc-sm8250: use runtime PM for the clock controller
clk: qcom: videocc-sm8250: use runtime PM for the clock controller
clk: qcom: gdsc: enable optional power domain support
arm64: dts: qcom: sm8250: remove mmcx regulator
clk: qcom: dispcc-sm8250: stop using mmcx regulator
clk: qcom: videocc-sm8250: stop using mmcx regulator
.../bindings/clock/qcom,dispcc-sm8x50.yaml | 13 ++++++
.../devicetree/bindings/clock/qcom,videocc.yaml | 13 ++++++
arch/arm64/boot/dts/qcom/sm8250.dtsi | 13 ++----
drivers/clk/qcom/dispcc-sm8250.c | 28 ++++++++++--
drivers/clk/qcom/gdsc.c | 51 ++++++++++++++++++++--
drivers/clk/qcom/gdsc.h | 2 +
drivers/clk/qcom/videocc-sm8250.c | 31 ++++++++++---
7 files changed, 130 insertions(+), 21 deletions(-)
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Use runtime PM calls to make sure that required power domain is
powered on while we access clock controller's registers.
Signed-off-by: Dmitry Baryshkov <redacted>
---
drivers/clk/qcom/dispcc-sm8250.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
On sm8250 videocc requires MMCX power domain to be powered up before
clock controller's registers become available. For now sm8250 was using
external regulator driven by the power domain to describe this
relationship. Switch into specifying power-domain and required opp-state
directly.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Reviewed-by: Rob Herring <robh@kernel.org>
---
.../devicetree/bindings/clock/qcom,videocc.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
@@ -47,6 +47,16 @@ properties:reg:maxItems:1+power-domains:+description:+A phandle and PM domain specifier for the MMCX power domain.+maxItems:1++required-opps:+description:+A phandle to an OPP node describing required MMCX performance point.+maxItems:1+required:-compatible-reg
On sm8250 dispcc requires MMCX power domain to be powered up before
clock controller's registers become available. For now sm8250 was using
external regulator driven by the power domain to describe this
relationship. Switch into specifying power-domain and required opp-state
directly.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Reviewed-by: Rob Herring <robh@kernel.org>
---
.../bindings/clock/qcom,dispcc-sm8x50.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
@@ -56,6 +56,16 @@ properties:reg:maxItems:1+power-domains:+description:+A phandle and PM domain specifier for the MMCX power domain.+maxItems:1++required-opps:+description:+A phandle to an OPP node describing required MMCX performance point.+maxItems:1+required:-compatible-reg
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Currently we use a regulator to enable this domain on demand,
however this has some consequences, as genpd code is not reentrant.
Make gdsc code also use pm_runtime calls to ensure that registers are
accessible during the gdsc_enable/gdsc_disable operations.
Signed-off-by: Dmitry Baryshkov <redacted>
---
drivers/clk/qcom/gdsc.c | 51 ++++++++++++++++++++++++++++++++++++++---
drivers/clk/qcom/gdsc.h | 2 ++
2 files changed, 50 insertions(+), 3 deletions(-)
@@ -50,6 +51,22 @@ enum gdsc_status {GDSC_ON};+staticintgdsc_pm_runtime_get(structgdsc*sc)+{+if(!sc->dev)+return0;++returnpm_runtime_resume_and_get(sc->dev);+}++staticintgdsc_pm_runtime_put(structgdsc*sc)+{+if(!sc->dev)+return0;++returnpm_runtime_put_sync(sc->dev);+}+/* Returns 1 if GDSC status is status, 0 if not, and < 0 on error */staticintgdsc_check_status(structgdsc*sc,enumgdsc_statusstatus){
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Use runtime PM calls to make sure that required power domain is
powered on while we access clock controller's registers.
Signed-off-by: Dmitry Baryshkov <redacted>
---
drivers/clk/qcom/videocc-sm8250.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
---
drivers/clk/qcom/dispcc-sm8250.c | 1 -
1 file changed, 1 deletion(-)
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdscs.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
---
drivers/clk/qcom/videocc-sm8250.c | 4 ----
1 file changed, 4 deletions(-)
On Sun, 29 Aug 2021 at 17:47, Dmitry Baryshkov
[off-list ref] wrote:
On SM8250 both the display and video clock controllers are powered up by
the MMCX power domain. Handle this by linking clock controllers to the
proper power domain, and using runtime power management to enable and
disable the MMCX power domain.
Dependencies:
https://lore.kernel.org/linux-pm/1628767642-4008-1-git-send-email-rnayak@codeaurora.org/
(pending inclusion into 5.15)
I think I already reviewed v6, but perhaps you made some bigger
changes. Anyway, feel free to add, for the series:
Reviewed-by: Ulf Hansson <redacted>
Kind regards
Uffe
Changes since v6:
- Dropped dependency on Bjorn's patches
- Restored required-opps properties
- Held pm device state while gdsc is powered on, removing dependency on
genpd's power_on() powering the domain into required state.
Changes since v5:
- Dropped devm_pm_runtime_enable callback to remove extra dependency
Changes since v4:
- Dropped pm_runtime handling from drivers/clk/qcom/common.c Moved the
code into dispcc-sm8250.c and videocc-sm8250.c
Changes since v3:
- Wrap gdsc_enable/gdsc_disable into pm_runtime_get/put calls rather
than calling pm_runtime_get in gdsc_enabled and _put in gdsc_disable
- Squash gdsc patches together to remove possible dependencies between
two patches.
Changes since v2:
- Move pm_runtime calls from generic genpd code to the gdsc code for
now (as suggested by Ulf & Bjorn)
Changes since v1:
- Rebase on top of Bjorn's patches, removing the need for setting
performance state directly.
- Move runtime PM calls from GDSC code to generic genpd code.
- Always call pm_runtime_enable in the Qualcomm generic clock
controller code.
- Register GDSC power domains as subdomains of the domain powering the
clock controller if there is one.
----------------------------------------------------------------
Dmitry Baryshkov (8):
dt-bindings: clock: qcom,dispcc-sm8x50: add mmcx power domain
dt-bindings: clock: qcom,videocc: add mmcx power domain
clk: qcom: dispcc-sm8250: use runtime PM for the clock controller
clk: qcom: videocc-sm8250: use runtime PM for the clock controller
clk: qcom: gdsc: enable optional power domain support
arm64: dts: qcom: sm8250: remove mmcx regulator
clk: qcom: dispcc-sm8250: stop using mmcx regulator
clk: qcom: videocc-sm8250: stop using mmcx regulator
.../bindings/clock/qcom,dispcc-sm8x50.yaml | 13 ++++++
.../devicetree/bindings/clock/qcom,videocc.yaml | 13 ++++++
arch/arm64/boot/dts/qcom/sm8250.dtsi | 13 ++----
drivers/clk/qcom/dispcc-sm8250.c | 28 ++++++++++--
drivers/clk/qcom/gdsc.c | 51 ++++++++++++++++++++--
drivers/clk/qcom/gdsc.h | 2 +
drivers/clk/qcom/videocc-sm8250.c | 31 ++++++++++---
7 files changed, 130 insertions(+), 21 deletions(-)
On SM8250 both the display and video clock controllers are powered up by
the MMCX power domain. Handle this by linking clock controllers to the
proper power domain, and using runtime power management to enable and
disable the MMCX power domain.
Dependencies:
https://lore.kernel.org/linux-pm/1628767642-4008-1-git-send-email-rnayak@codeaurora.org/
(pending inclusion into 5.15)
Gracious ping for this patch series.
Changes since v6:
- Dropped dependency on Bjorn's patches
- Restored required-opps properties
- Held pm device state while gdsc is powered on, removing dependency on
genpd's power_on() powering the domain into required state.
Changes since v5:
- Dropped devm_pm_runtime_enable callback to remove extra dependency
Changes since v4:
- Dropped pm_runtime handling from drivers/clk/qcom/common.c Moved the
code into dispcc-sm8250.c and videocc-sm8250.c
Changes since v3:
- Wrap gdsc_enable/gdsc_disable into pm_runtime_get/put calls rather
than calling pm_runtime_get in gdsc_enabled and _put in gdsc_disable
- Squash gdsc patches together to remove possible dependencies between
two patches.
Changes since v2:
- Move pm_runtime calls from generic genpd code to the gdsc code for
now (as suggested by Ulf & Bjorn)
Changes since v1:
- Rebase on top of Bjorn's patches, removing the need for setting
performance state directly.
- Move runtime PM calls from GDSC code to generic genpd code.
- Always call pm_runtime_enable in the Qualcomm generic clock
controller code.
- Register GDSC power domains as subdomains of the domain powering the
clock controller if there is one.
----------------------------------------------------------------
Dmitry Baryshkov (8):
dt-bindings: clock: qcom,dispcc-sm8x50: add mmcx power domain
dt-bindings: clock: qcom,videocc: add mmcx power domain
clk: qcom: dispcc-sm8250: use runtime PM for the clock controller
clk: qcom: videocc-sm8250: use runtime PM for the clock controller
clk: qcom: gdsc: enable optional power domain support
arm64: dts: qcom: sm8250: remove mmcx regulator
clk: qcom: dispcc-sm8250: stop using mmcx regulator
clk: qcom: videocc-sm8250: stop using mmcx regulator
.../bindings/clock/qcom,dispcc-sm8x50.yaml | 13 ++++++
.../devicetree/bindings/clock/qcom,videocc.yaml | 13 ++++++
arch/arm64/boot/dts/qcom/sm8250.dtsi | 13 ++----
drivers/clk/qcom/dispcc-sm8250.c | 28 ++++++++++--
drivers/clk/qcom/gdsc.c | 51 ++++++++++++++++++++--
drivers/clk/qcom/gdsc.h | 2 +
drivers/clk/qcom/videocc-sm8250.c | 31 ++++++++++---
7 files changed, 130 insertions(+), 21 deletions(-)
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Use runtime PM calls to make sure that required power domain is
powered on while we access clock controller's registers.
As I said on previous iterations, the clock framework will ensure that
the power domain is powered up around all calls back into the clock
driver, so for clocks this isn't needed.
But after digging some more, the gdsc registration needs this and I
don't mind keeping it on for the duration of the registration, rather
than having the clock framework turn it on and off.
As far as I can see the reset_controller won't actually access the
hardware during registration.
Reviewed-by: Bjorn Andersson <redacted>
That said, qcom_reset_{assert,deassert}() doesn't seem to be performed
under a pm_runtime_get() section, so I believe that should be addressed
as well. I don't see that we have a problem with this in practice as of
today, but it seems worthy to correct - unless I'm just missing
something.
Regards,
Bjorn
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Use runtime PM calls to make sure that required power domain is
powered on while we access clock controller's registers.
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Currently we use a regulator to enable this domain on demand,
however this has some consequences, as genpd code is not reentrant.
Make gdsc code also use pm_runtime calls to ensure that registers are
accessible during the gdsc_enable/gdsc_disable operations.
@@ -50,6 +51,22 @@ enum gdsc_status {GDSC_ON};+staticintgdsc_pm_runtime_get(structgdsc*sc)+{+if(!sc->dev)+return0;++returnpm_runtime_resume_and_get(sc->dev);+}++staticintgdsc_pm_runtime_put(structgdsc*sc)+{+if(!sc->dev)+return0;++returnpm_runtime_put_sync(sc->dev);+}+/* Returns 1 if GDSC status is status, 0 if not, and < 0 on error */staticintgdsc_check_status(structgdsc*sc,enumgdsc_statusstatus){
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
Regards,
Bjorn
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
quoted
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-13 19:51:00
Quoting Dmitry Baryshkov (2021-10-07 09:16:13)
On 07/10/2021 18:48, Bjorn Andersson wrote:
quoted
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
quoted
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
Sure it is.
What's the merge strategy? It goes through arm-soc?
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
quoted
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
Sure it is.
What's the merge strategy? It goes through arm-soc?
I think this should go through the clk tree. There is little chance of conflicts.
--
With best wishes
Dmitry
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-15 00:01:59
Quoting Dmitry Baryshkov (2021-10-14 02:53:41)
On 13/10/2021 22:50, Stephen Boyd wrote:
quoted
Quoting Dmitry Baryshkov (2021-10-07 09:16:13)
quoted
On 07/10/2021 18:48, Bjorn Andersson wrote:
quoted
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
quoted
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
Sure it is.
What's the merge strategy? It goes through arm-soc?
I think this should go through the clk tree. There is little chance of
conflicts.
Ok. So I take the first 6 through clk tree and then we wait for the last
two?
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-15 00:04:57
Quoting Dmitry Baryshkov (2021-10-14 02:53:41)
On 13/10/2021 22:50, Stephen Boyd wrote:
quoted
Quoting Dmitry Baryshkov (2021-10-07 09:16:13)
quoted
On 07/10/2021 18:48, Bjorn Andersson wrote:
quoted
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
quoted
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
Sure it is.
What's the merge strategy? It goes through arm-soc?
I think this should go through the clk tree. There is little chance of
conflicts.
The other thing that concerns me is that we don't have backwards
compat code. If things are going to start crashing that's not very nice.
Is there some way to make it work with old and new DTB for one release
so that we don't have to worry about this problem?
On Fri, 15 Oct 2021 at 03:04, Stephen Boyd [off-list ref] wrote:
Quoting Dmitry Baryshkov (2021-10-14 02:53:41)
quoted
On 13/10/2021 22:50, Stephen Boyd wrote:
quoted
Quoting Dmitry Baryshkov (2021-10-07 09:16:13)
quoted
On 07/10/2021 18:48, Bjorn Andersson wrote:
quoted
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
quoted
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
Sure it is.
What's the merge strategy? It goes through arm-soc?
I think this should go through the clk tree. There is little chance of
conflicts.
The other thing that concerns me is that we don't have backwards
compat code. If things are going to start crashing that's not very nice.
Is there some way to make it work with old and new DTB for one release
so that we don't have to worry about this problem?
I have to admit that I did not check that, but without the patch 7 the
dispcc and videocc would be compatible with the old DTB. The 'supply =
"mmcx"' would ensure that it is used if it is defined.
--
With best wishes
Dmitry
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-15 00:55:59
Quoting Dmitry Baryshkov (2021-08-29 08:47:50)
On sm8250 dispcc requires MMCX power domain to be powered up before
clock controller's registers become available. For now sm8250 was using
external regulator driven by the power domain to describe this
relationship. Switch into specifying power-domain and required opp-state
directly.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Reviewed-by: Rob Herring <robh@kernel.org>
---
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-15 00:56:12
Quoting Dmitry Baryshkov (2021-08-29 08:47:51)
On sm8250 videocc requires MMCX power domain to be powered up before
clock controller's registers become available. For now sm8250 was using
external regulator driven by the power domain to describe this
relationship. Switch into specifying power-domain and required opp-state
directly.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Reviewed-by: Rob Herring <robh@kernel.org>
---
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-15 00:56:16
Quoting Dmitry Baryshkov (2021-08-29 08:47:52)
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Use runtime PM calls to make sure that required power domain is
powered on while we access clock controller's registers.
Signed-off-by: Dmitry Baryshkov <redacted>
---
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-15 00:56:26
Quoting Dmitry Baryshkov (2021-08-29 08:47:53)
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Use runtime PM calls to make sure that required power domain is
powered on while we access clock controller's registers.
Signed-off-by: Dmitry Baryshkov <redacted>
---
From: Stephen Boyd <sboyd@kernel.org> Date: 2021-10-15 00:56:32
Quoting Dmitry Baryshkov (2021-08-29 08:47:54)
On sm8250 dispcc and videocc registers are powered up by the MMCX power
domain. Currently we use a regulator to enable this domain on demand,
however this has some consequences, as genpd code is not reentrant.
Make gdsc code also use pm_runtime calls to ensure that registers are
accessible during the gdsc_enable/gdsc_disable operations.
Signed-off-by: Dmitry Baryshkov <redacted>
---
On Sun, 29 Aug 2021 18:47:49 +0300, Dmitry Baryshkov wrote:
On SM8250 both the display and video clock controllers are powered up by
the MMCX power domain. Handle this by linking clock controllers to the
proper power domain, and using runtime power management to enable and
disable the MMCX power domain.
Dependencies:
https://lore.kernel.org/linux-pm/1628767642-4008-1-git-send-email-rnayak@codeaurora.org/
(pending inclusion into 5.15)
[...]
On Sun 29 Aug 08:47 PDT 2021, Dmitry Baryshkov wrote:
quoted
Now as the common qcom clock controller code has been taught about power
domains, stop mentioning mmcx supply as a way to power up the clock
controller's gdsc.
Signed-off-by: Dmitry Baryshkov <redacted>
Reviewed-by: Bjorn Andersson <redacted>
Once we merge these, I expect that the boards will start crashing if
the kernel is booted using an existing DTB?
Is it okay to just merge the first 6 patches in the series now and
postpone these two until we've had the dts change sitting for a while?
Bjorn, the changes 1-6 went into 5.15. I suppose it's time to merge the last two patches?