Skip to content

Commit 5d8c041

Browse files
committed
drm/msm/mdp5: fix reading hw revision on db410c platform
Since the commit commit c612268 ("drm/msm/mdp5: stop overriding drvdata") reading the MDP5 hw revision on db410c will crash the board as the MDSS_GDSC is not enabled. Revert a part of the offending commit (moving rpm enablement) and set priv->kms earlier. This make it possible to use pm_runtime_get_sync() during read_mdp_hw_revision(), which will power up both the MDP5 and MDSS devices. Fixes: c612268 ("drm/msm/mdp5: stop overriding drvdata") Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/512985/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent c612268 commit 5d8c041

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -519,10 +519,9 @@ static void read_mdp_hw_revision(struct mdp5_kms *mdp5_kms,
519519
struct device *dev = &mdp5_kms->pdev->dev;
520520
u32 version;
521521

522-
/* Manually enable the MDP5, as pm runtime isn't usable yet. */
523-
mdp5_enable(mdp5_kms);
522+
pm_runtime_get_sync(dev);
524523
version = mdp5_read(mdp5_kms, REG_MDP5_HW_VERSION);
525-
mdp5_disable(mdp5_kms);
524+
pm_runtime_put_sync(dev);
526525

527526
*major = FIELD(version, MDP5_HW_VERSION_MAJOR);
528527
*minor = FIELD(version, MDP5_HW_VERSION_MINOR);
@@ -839,6 +838,12 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)
839838
*/
840839
clk_set_rate(mdp5_kms->core_clk, 200000000);
841840

841+
/* set uninit-ed kms */
842+
priv->kms = &mdp5_kms->base.base;
843+
844+
pm_runtime_enable(&pdev->dev);
845+
mdp5_kms->rpm_enabled = true;
846+
842847
read_mdp_hw_revision(mdp5_kms, &major, &minor);
843848

844849
mdp5_kms->cfg = mdp5_cfg_init(mdp5_kms, major, minor);
@@ -887,12 +892,6 @@ static int mdp5_init(struct platform_device *pdev, struct drm_device *dev)
887892
if (ret)
888893
goto fail;
889894

890-
/* set uninit-ed kms */
891-
priv->kms = &mdp5_kms->base.base;
892-
893-
pm_runtime_enable(&pdev->dev);
894-
mdp5_kms->rpm_enabled = true;
895-
896895
return 0;
897896
fail:
898897
if (mdp5_kms)

0 commit comments

Comments
 (0)