Skip to content

Commit 2a93c6c

Browse files
quic-bjorandestorulf
authored andcommitted
pmdomain: qcom: rpmhpd: Fix enabled_corner aggregation
Commit 'e3e56c050ab6 ("soc: qcom: rpmhpd: Make power_on actually enable the domain")' aimed to make sure that a power-domain that is being enabled without any particular performance-state requested will at least turn the rail on, to avoid filling DeviceTree with otherwise unnecessary required-opps properties. But in the event that aggregation happens on a disabled power-domain, with an enabled peer without performance-state, both the local and peer corner are 0. The peer's enabled_corner is not considered, with the result that the underlying (shared) resource is disabled. One case where this can be observed is when the display stack keeps mmcx enabled (but without a particular performance-state vote) in order to access registers and sync_state happens in the rpmhpd driver. As mmcx_ao is flushed the state of the peer (mmcx) is not considered and mmcx_ao ends up turning off "mmcx.lvl" underneath mmcx. This has been observed several times, but has been painted over in DeviceTree by adding an explicit vote for the lowest non-disabled performance-state. Fixes: e3e56c0 ("soc: qcom: rpmhpd: Make power_on actually enable the domain") Reported-by: Johan Hovold <johan@kernel.org> Closes: https://lore.kernel.org/linux-arm-msm/ZdMwZa98L23mu3u6@hovoldconsulting.com/ Cc: <stable@vger.kernel.org> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Reviewed-by: Stephen Boyd <swboyd@chromium.org> Tested-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20240226-rpmhpd-enable-corner-fix-v1-1-68c004cec48c@quicinc.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent eb5555d commit 2a93c6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/pmdomain/qcom/rpmhpd.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ static int rpmhpd_aggregate_corner(struct rpmhpd *pd, unsigned int corner)
692692
unsigned int active_corner, sleep_corner;
693693
unsigned int this_active_corner = 0, this_sleep_corner = 0;
694694
unsigned int peer_active_corner = 0, peer_sleep_corner = 0;
695+
unsigned int peer_enabled_corner;
695696

696697
if (pd->state_synced) {
697698
to_active_sleep(pd, corner, &this_active_corner, &this_sleep_corner);
@@ -701,9 +702,11 @@ static int rpmhpd_aggregate_corner(struct rpmhpd *pd, unsigned int corner)
701702
this_sleep_corner = pd->level_count - 1;
702703
}
703704

704-
if (peer && peer->enabled)
705-
to_active_sleep(peer, peer->corner, &peer_active_corner,
705+
if (peer && peer->enabled) {
706+
peer_enabled_corner = max(peer->corner, peer->enable_corner);
707+
to_active_sleep(peer, peer_enabled_corner, &peer_active_corner,
706708
&peer_sleep_corner);
709+
}
707710

708711
active_corner = max(this_active_corner, peer_active_corner);
709712

0 commit comments

Comments
 (0)