summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorJonathan Marek <jonathan@marek.ca>2020-07-14 00:53:41 +0200
committerRob Clark <robdclark@chromium.org>2020-07-30 22:44:52 +0200
commit0ded520b182e13277e1076f84ca16247eb9bf150 (patch)
treefb6a42be1eb6c49c9626c08db4389334a93d8a2e /drivers/gpu/drm
parentdrm/msm: fix unbalanced pm_runtime_enable in adreno_gpu_{init, cleanup} (diff)
downloadlinux-0ded520b182e13277e1076f84ca16247eb9bf150.tar.xz
linux-0ded520b182e13277e1076f84ca16247eb9bf150.zip
drm/msm: reset devfreq freq_table/max_state before devfreq_add_device
These never get set back to 0 when probing fails, so an attempt to probe again results in broken behavior. Fix the problem by setting thse to zero before they are used. Signed-off-by: Jonathan Marek <jonathan@marek.ca> Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/msm/msm_gpu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index 86a138641477..3763d4002629 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -93,7 +93,11 @@ static void msm_devfreq_init(struct msm_gpu *gpu)
/*
* Don't set the freq_table or max_state and let devfreq build the table
* from OPP
+ * After a deferred probe, these may have be left to non-zero values,
+ * so set them back to zero before creating the devfreq device
*/
+ msm_devfreq_profile.freq_table = NULL;
+ msm_devfreq_profile.max_state = 0;
gpu->devfreq.devfreq = devm_devfreq_add_device(&gpu->pdev->dev,
&msm_devfreq_profile, DEVFREQ_GOV_SIMPLE_ONDEMAND,