From 140e3b25cf4f9b484ef7f24104b027a8431c45f4 Mon Sep 17 00:00:00 2001 From: mcc45tr Date: Sat, 5 Sep 2026 10:07:47 +0300 Subject: [PATCH] drm/msm: preserve firmware dual-DSI handoff clocks --- drivers/clk/qcom/dispcc-sm8250.c | 17 +++++++++++------ drivers/gpu/drm/msm/dsi/dsi.c | 9 ++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/clk/qcom/dispcc-sm8250.c b/drivers/clk/qcom/dispcc-sm8250.c index fdc07323f298..de12646b4e40 100644 --- a/drivers/clk/qcom/dispcc-sm8250.c +++ b/drivers/clk/qcom/dispcc-sm8250.c @@ -710,6 +710,11 @@ static struct clk_branch disp_cc_mdss_ahb_clk = { }, }; +/* Firmware can hand an active dual-DSI scanout to Linux before the DSI PHY + * providers finish probing. Preserve only the scanout branch clocks across + * disable_unused; once DSI owns them, normal runtime reference counting and + * power management still gate the branches. + */ static struct clk_branch disp_cc_mdss_byte0_clk = { .halt_reg = 0x2028, .halt_check = BRANCH_HALT, @@ -722,7 +727,7 @@ static struct clk_branch disp_cc_mdss_byte0_clk = { &disp_cc_mdss_byte0_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, .ops = &clk_branch2_ops, }, }, @@ -740,7 +745,7 @@ static struct clk_branch disp_cc_mdss_byte0_intf_clk = { &disp_cc_mdss_byte0_div_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, .ops = &clk_branch2_ops, }, }, @@ -758,7 +763,7 @@ static struct clk_branch disp_cc_mdss_byte1_clk = { &disp_cc_mdss_byte1_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, .ops = &clk_branch2_ops, }, }, @@ -776,7 +781,7 @@ static struct clk_branch disp_cc_mdss_byte1_intf_clk = { &disp_cc_mdss_byte1_div_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, .ops = &clk_branch2_ops, }, }, @@ -1046,7 +1051,7 @@ static struct clk_branch disp_cc_mdss_pclk0_clk = { &disp_cc_mdss_pclk0_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, .ops = &clk_branch2_ops, }, }, @@ -1064,7 +1069,7 @@ static struct clk_branch disp_cc_mdss_pclk1_clk = { &disp_cc_mdss_pclk1_clk_src.clkr.hw, }, .num_parents = 1, - .flags = CLK_SET_RATE_PARENT, + .flags = CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED, .ops = &clk_branch2_ops, }, }, diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 3c9f01ed6271..d671fac865de 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -43,13 +43,13 @@ static int dsi_get_phy(struct msm_dsi *msm_dsi) of_node_put(phy_node); if (!phy_pdev) { - DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__); - return -EPROBE_DEFER; + return dev_err_probe(&pdev->dev, -EPROBE_DEFER, + "%s: phy driver is not ready\n", __func__); } if (!msm_dsi->phy) { put_device(&phy_pdev->dev); - DRM_DEV_ERROR(&pdev->dev, "%s: phy driver is not ready\n", __func__); - return -EPROBE_DEFER; + return dev_err_probe(&pdev->dev, -EPROBE_DEFER, + "%s: phy driver is not ready\n", __func__); } return 0; @@ -267,4 +267,3 @@ void msm_dsi_snapshot(struct msm_disp_state *disp_state, struct msm_dsi *msm_dsi msm_dsi_host_snapshot(disp_state, msm_dsi->host); msm_dsi_phy_snapshot(disp_state, msm_dsi->phy); } - -- 2.55.0