All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abel Vesa <abel.vesa@linaro.org>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	 Kevin Hilman <khilman@kernel.org>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	 Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Bjorn Andersson <andersson@kernel.org>,
	Andy Gross <agross@kernel.org>,
	 Konrad Dybcio <konrad.dybcio@linaro.org>,
	 Michael Turquette <mturquette@baylibre.com>,
	 Stephen Boyd <sboyd@kernel.org>,
	 Stanimir Varbanov <stanimir.k.varbanov@gmail.com>,
	 Vikash Garodia <quic_vgarodia@quicinc.com>,
	 Bryan O'Donoghue <bryan.odonoghue@linaro.org>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Taniya Das <quic_tdas@quicinc.com>,
	Jagadeesh Kona <quic_jkona@quicinc.com>,
	 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	 linux-media@vger.kernel.org, Abel Vesa <abel.vesa@linaro.org>
Subject: [PATCH v4 4/5] clk: qcom: Use HW_CTRL_TRIGGER flag to switch video GDSC to HW mode
Date: Mon, 22 Jan 2024 10:47:04 +0200	[thread overview]
Message-ID: <20240122-gdsc-hwctrl-v4-4-9061e8a7aa07@linaro.org> (raw)
In-Reply-To: <20240122-gdsc-hwctrl-v4-0-9061e8a7aa07@linaro.org>

From: Jagadeesh Kona <quic_jkona@quicinc.com>

The current HW_CTRL flag switches the video GDSC to HW control mode as
part of GDSC enable itself, and HW can disable the GDSC right after the
GDSC is moved to HW mode. This can lead to subsequent video clock enable
failures that are dependent on the GDSC if GDSC is collapsed by HW. Also,
while few video hardware registers are being programmed by TZ, GDSC
should be in non collapsed state which can be achieved by keeping
it in SW mode.

Use HW_CTRL_TRIGGER flag instead which allows consumer drivers to switch
the video GDSC to HW/SW control modes at runtime using
dev_pm_genpd_set_hwmode API as per the requirement.

Signed-off-by: Jagadeesh Kona <quic_jkona@quicinc.com>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 drivers/clk/qcom/videocc-sc7280.c | 2 +-
 drivers/clk/qcom/videocc-sm8250.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/qcom/videocc-sc7280.c b/drivers/clk/qcom/videocc-sc7280.c
index 615695d82319..3d07b1e95986 100644
--- a/drivers/clk/qcom/videocc-sc7280.c
+++ b/drivers/clk/qcom/videocc-sc7280.c
@@ -236,7 +236,7 @@ static struct gdsc mvs0_gdsc = {
 		.name = "mvs0_gdsc",
 	},
 	.pwrsts = PWRSTS_OFF_ON,
-	.flags = HW_CTRL | RETAIN_FF_ENABLE,
+	.flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE,
 };
 
 static struct gdsc mvsc_gdsc = {
diff --git a/drivers/clk/qcom/videocc-sm8250.c b/drivers/clk/qcom/videocc-sm8250.c
index ad46c4014a40..c1b73d852f1c 100644
--- a/drivers/clk/qcom/videocc-sm8250.c
+++ b/drivers/clk/qcom/videocc-sm8250.c
@@ -293,7 +293,7 @@ static struct gdsc mvs0_gdsc = {
 	.pd = {
 		.name = "mvs0_gdsc",
 	},
-	.flags = HW_CTRL,
+	.flags = HW_CTRL_TRIGGER,
 	.pwrsts = PWRSTS_OFF_ON,
 };
 
@@ -302,7 +302,7 @@ static struct gdsc mvs1_gdsc = {
 	.pd = {
 		.name = "mvs1_gdsc",
 	},
-	.flags = HW_CTRL,
+	.flags = HW_CTRL_TRIGGER,
 	.pwrsts = PWRSTS_OFF_ON,
 };
 

-- 
2.34.1


  parent reply	other threads:[~2024-01-22  8:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  8:47 [PATCH v4 0/5] PM: domains: Add control for switching back and forth to HW control Abel Vesa
2024-01-22  8:47 ` [PATCH v4 1/5] PM: domains: Allow devices attached to genpd to be managed by HW Abel Vesa
2024-01-23 12:53   ` Ulf Hansson
2024-01-31  1:09   ` Bjorn Andersson
2024-01-31 12:12     ` Ulf Hansson
2024-02-01 23:51       ` Bjorn Andersson
2024-02-02 12:29         ` Ulf Hansson
2024-02-13 13:10           ` Jagadeesh Kona
2024-02-13 13:51             ` Ulf Hansson
2024-02-14  4:29               ` Jagadeesh Kona
2024-02-15 16:27                 ` Ulf Hansson
2024-02-16  8:00                   ` Jagadeesh Kona
2024-02-28 14:53                     ` Ulf Hansson
2024-03-01 11:24                       ` Jagadeesh Kona
2024-01-22  8:47 ` [PATCH v4 2/5] PM: domains: Add the domain HW-managed mode to the summary Abel Vesa
2024-01-22  8:47 ` [PATCH v4 3/5] clk: qcom: gdsc: Add set and get hwmode callbacks to switch GDSC mode Abel Vesa
2024-01-30 23:00   ` Bjorn Andersson
2024-01-31  0:19     ` Bjorn Andersson
2024-02-13 13:08       ` Jagadeesh Kona
2024-02-13 13:04     ` Jagadeesh Kona
2024-01-22  8:47 ` Abel Vesa [this message]
2024-01-22  8:47 ` [PATCH v4 5/5] venus: pm_helpers: Use dev_pm_genpd_set_hwmode " Abel Vesa
2024-01-31  1:05   ` Bjorn Andersson
2024-02-13 13:06     ` Jagadeesh Kona
2024-01-23 13:00 ` [PATCH v4 0/5] PM: domains: Add control for switching back and forth to HW control Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240122-gdsc-hwctrl-v4-4-9061e8a7aa07@linaro.org \
    --to=abel.vesa@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=bryan.odonoghue@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=khilman@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=pavel@ucw.cz \
    --cc=quic_jkona@quicinc.com \
    --cc=quic_tdas@quicinc.com \
    --cc=quic_vgarodia@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=stanimir.k.varbanov@gmail.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.