linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control
@ 2023-06-28 10:56 Abel Vesa
  2023-06-28 10:56 ` [PATCH 1/2] PM: domains: Allow devices attached to genpd to be managed by HW Abel Vesa
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Abel Vesa @ 2023-06-28 10:56 UTC (permalink / raw)
  To: Rafael J . Wysocki, Kevin Hilman, Ulf Hansson, avel Machek,
	Len Brown, Greg Kroah-Hartman, Bjorn Andersson, Andy Gross,
	Konrad Dybcio, Mike Turquette, Stephen Boyd, Taniya Das
  Cc: linux-pm, Linux Kernel Mailing List, linux-arm-msm

This is just a resend of [1]. This resend just adds the back story behind
the need for such a generic API as a cover letter. Also added my SoB tag
to Ulf's patch.

Some of the newer Qualcomm platforms support handing of the control of
some of the GDSCs (implemented as power domains in Linux) to some device
firmware. The idea behind such approach is that the firmware knows best
when such a power domain can be powered off or not and leads most of the
time to better power consumption.

At this point, if such GDSC provides HW control support, the current
implementation is switching to HW control right after the GDSC gets
powered on and it is left in HW control mode until right before the
request for power off is done. This needs to remain as is for now, as we
do not know for sure what each firmware expects from its related GDSCs.
For example, the venus driver expects the codec GDSCs to remain always
in HW control mode, otherwise the firmware would crush.

But in some cases, the consumer driver needs to switch back and forth.
And the explanation for such case is when a driver needs to interract
with the device (e.g. reading status bits) and the firmware doesn't
guarantee the GDSC will be enabled when in HW mode. Therefore, the
consumer would need to switch back to SW mode, do its thing, and then
switch again back to HW mode.

This is where the patch from Ulf comes in. It allows consumers that
actually need to control the HW/SW mode to do so.

The GDSC patch just implemets the set_hwmode op and sets it for each
GDSC that provides HW control mode.

[1] https://lore.kernel.org/all/20230627104033.3345659-1-abel.vesa@linaro.org/

Abel Vesa (1):
  clk: qcom: gdsc: Add support for set_hwmode_dev

Ulf Hansson (1):
  PM: domains: Allow devices attached to genpd to be managed by HW

 drivers/base/power/domain.c | 66 +++++++++++++++++++++++++++++++++++++
 drivers/clk/qcom/gdsc.c     | 22 +++++++++++++
 include/linux/pm_domain.h   | 15 +++++++++
 3 files changed, 103 insertions(+)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-17 11:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-28 10:56 [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control Abel Vesa
2023-06-28 10:56 ` [PATCH 1/2] PM: domains: Allow devices attached to genpd to be managed by HW Abel Vesa
2023-06-28 10:56 ` [PATCH 2/2] clk: qcom: gdsc: Add support for set_hwmode_dev Abel Vesa
2023-06-28 17:18   ` Konrad Dybcio
2023-07-10  4:10     ` Taniya Das
2023-07-17 11:08       ` Abel Vesa
2023-07-10  4:11   ` Taniya Das
2023-06-28 17:15 ` [PATCH 0/2] PM: domains: Add control for switching back and forth to HW control Rafael J. Wysocki
2023-06-28 21:55   ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).