Skip to contentSkip to conversation

clk: qcom: videocc-sm8350: use HW_CTRL_TRIGGER for vcodec GDSCs

PATCH Applied Johan Hovold 4 participants 4 messages Sep 1, 2024 – Oct 16, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: qcom: videocc-sm8350: use HW_CTRL_TRIGGER for vcodec GDSCs

A recent change in the venus driver results in a stuck clock on the Lenovo ThinkPad X13s, for example, when streaming video in firefox:

	video_cc_mvs0_clk status stuck at 'off'
	WARNING: CPU: 6 PID: 2885 at drivers/clk/qcom/clk-branch.c:87 clk_branch_wait+0x144/0x15c
	...
	Call trace:
	 clk_branch_wait+0x144/0x15c
	 clk_branch2_enable+0x30/0x40
	 clk_core_enable+0xd8/0x29c
	 clk_enable+0x2c/0x4c
	 vcodec_clks_enable.isra.0+0x94/0xd8 [venus_core]
	 coreid_power_v4+0x464/0x628 [venus_core]
	 vdec_start_streaming+0xc4/0x510 [venus_dec]
	 vb2_start_streaming+0x6c/0x180 [videobuf2_common]
	 vb2_core_streamon+0x120/0x1dc [videobuf2_common]
	 vb2_streamon+0x1c/0x6c [videobuf2_v4l2]
	 v4l2_m2m_ioctl_streamon+0x30/0x80 [v4l2_mem2mem]
	 v4l_streamon+0x24/0x30 [videodev]

using the out-of-tree sm8350/sc8280xp venus support. [1]

Update also the sm8350/sc8280xp GDSC definitions so that the hw control mode can be changed at runtime as the venus driver now requires.

Fixes ec9a652e5149 ("venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC mode on V6")
Cc Jagadeesh Kona <[email protected]>
Cc Taniya Das <[email protected]>
Cc Abel Vesa <[email protected]>
Cc Konrad Dybcio <[email protected]>
---
 drivers/clk/qcom/videocc-sm8350.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/videocc-sm8350.c +2 -2
index 5bd6fe3e1298..874d4da95ff8 100644
@@ -452,7 +452,7 @@ static struct gdsc mvs0_gdsc = {
 	.pd = {
 		.name = "mvs0_gdsc",
 	},
-	.flags = HW_CTRL | RETAIN_FF_ENABLE,
+	.flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE,
 	.pwrsts = PWRSTS_OFF_ON,
 };
 
@@ -461,7 +461,7 @@ static struct gdsc mvs1_gdsc = {
 	.pd = {
 		.name = "mvs1_gdsc",
 	},
-	.flags = HW_CTRL | RETAIN_FF_ENABLE,
+	.flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE,
 	.pwrsts = PWRSTS_OFF_ON,
 };
 
Signature · 1 line
2.44.2
Tested-by on v1 1/1
#1 lore raw

Hi Johan,

Quoted 60 lines · Johan Hovold

A recent change in the venus driver results in a stuck clock on the Lenovo ThinkPad X13s, for example, when streaming video in firefox:

        video_cc_mvs0_clk status stuck at 'off'
        WARNING: CPU: 6 PID: 2885 at drivers/clk/qcom/clk-branch.c:87 clk_branch_wait+0x144/0x15c
        ...
        Call trace:
         clk_branch_wait+0x144/0x15c
         clk_branch2_enable+0x30/0x40
         clk_core_enable+0xd8/0x29c
         clk_enable+0x2c/0x4c
         vcodec_clks_enable.isra.0+0x94/0xd8 [venus_core]
         coreid_power_v4+0x464/0x628 [venus_core]
         vdec_start_streaming+0xc4/0x510 [venus_dec]
         vb2_start_streaming+0x6c/0x180 [videobuf2_common]
         vb2_core_streamon+0x120/0x1dc [videobuf2_common]
         vb2_streamon+0x1c/0x6c [videobuf2_v4l2]
         v4l2_m2m_ioctl_streamon+0x30/0x80 [v4l2_mem2mem]
         v4l_streamon+0x24/0x30 [videodev]

using the out-of-tree sm8350/sc8280xp venus support. [1]

Update also the sm8350/sc8280xp GDSC definitions so that the hw control mode can be changed at runtime as the venus driver now requires.

Fixes ec9a652e5149 ("venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC mode on V6")
Cc Jagadeesh Kona <[email protected]>
Cc Taniya Das <[email protected]>
Cc Abel Vesa <[email protected]>
Cc Konrad Dybcio <[email protected]>
---
 drivers/clk/qcom/videocc-sm8350.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/qcom/videocc-sm8350.c +2 -3
index 5bd6fe3e1298..874d4da95ff8 100644
@@ -452,7 +452,7 @@ static struct gdsc mvs0_gdsc = {
        .pd = {
                .name = "mvs0_gdsc",
        },
-       .flags = HW_CTRL | RETAIN_FF_ENABLE,
+       .flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE,
        .pwrsts = PWRSTS_OFF_ON,
 };
 
@@ -461,7 +461,7 @@ static struct gdsc mvs1_gdsc = {
        .pd = {
                .name = "mvs1_gdsc",
        },
-       .flags = HW_CTRL | RETAIN_FF_ENABLE,
+       .flags = HW_CTRL_TRIGGER | RETAIN_FF_ENABLE,
        .pwrsts = PWRSTS_OFF_ON,
 };
 
--
Quoted 3 lines

2.44.2

Being as I saw this as well locally, I've now tested with this patch on top of 6.11-rc6 and can confirm that I don't see the splat anymore.

#2 lore raw
In reply to Johan Hovold
Quoted 25 lines · Johan Hovold

A recent change in the venus driver results in a stuck clock on the Lenovo ThinkPad X13s, for example, when streaming video in firefox:

	video_cc_mvs0_clk status stuck at 'off'
	WARNING: CPU: 6 PID: 2885 at drivers/clk/qcom/clk-branch.c:87 clk_branch_wait+0x144/0x15c
	...
	Call trace:
	 clk_branch_wait+0x144/0x15c
	 clk_branch2_enable+0x30/0x40
	 clk_core_enable+0xd8/0x29c
	 clk_enable+0x2c/0x4c
	 vcodec_clks_enable.isra.0+0x94/0xd8 [venus_core]
	 coreid_power_v4+0x464/0x628 [venus_core]
	 vdec_start_streaming+0xc4/0x510 [venus_dec]
	 vb2_start_streaming+0x6c/0x180 [videobuf2_common]
	 vb2_core_streamon+0x120/0x1dc [videobuf2_common]
	 vb2_streamon+0x1c/0x6c [videobuf2_v4l2]
	 v4l2_m2m_ioctl_streamon+0x30/0x80 [v4l2_mem2mem]
	 v4l_streamon+0x24/0x30 [videodev]

using the out-of-tree sm8350/sc8280xp venus support. [1]

Update also the sm8350/sc8280xp GDSC definitions so that the hw control mode can be changed at runtime as the venus driver now requires.

Quoted 7 lines
Fixes ec9a652e5149 ("venus: pm_helpers: Use dev_pm_genpd_set_hwmode to switch GDSC mode on V6")
Cc Jagadeesh Kona <[email protected]>
Cc Taniya Das <[email protected]>
Cc Abel Vesa <[email protected]>
Cc Konrad Dybcio <[email protected]>

This one did not make it into 6.11 and should now be backported as well:

Bjorn, can you pick it up for 6.12-rc?

Johan

maintainer Applied
#3 lore raw
In reply to Johan Hovold
Quoted 20 lines · Johan Hovold

A recent change in the venus driver results in a stuck clock on the Lenovo ThinkPad X13s, for example, when streaming video in firefox:

	video_cc_mvs0_clk status stuck at 'off'
	WARNING: CPU: 6 PID: 2885 at drivers/clk/qcom/clk-branch.c:87 clk_branch_wait+0x144/0x15c
	...
	Call trace:
	 clk_branch_wait+0x144/0x15c
	 clk_branch2_enable+0x30/0x40
	 clk_core_enable+0xd8/0x29c
	 clk_enable+0x2c/0x4c
	 vcodec_clks_enable.isra.0+0x94/0xd8 [venus_core]
	 coreid_power_v4+0x464/0x628 [venus_core]
	 vdec_start_streaming+0xc4/0x510 [venus_dec]
	 vb2_start_streaming+0x6c/0x180 [videobuf2_common]
	 vb2_core_streamon+0x120/0x1dc [videobuf2_common]
	 vb2_streamon+0x1c/0x6c [videobuf2_v4l2]
	 v4l2_m2m_ioctl_streamon+0x30/0x80 [v4l2_mem2mem]
	 v4l_streamon+0x24/0x30 [videodev]
Quoted 1 line

[...]

Applied, thanks!

[1/1] clk: qcom: videocc-sm8350: use HW_CTRL_TRIGGER for vcodec GDSCs

      commit: f903663a8dcd6e1656e52856afbf706cc14cbe6d

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>