]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
drm/msm/gpu: Drop qos request if devm_devfreq_add_device() fails
authorBjorn Andersson <bjorn.andersson@linaro.org>
Fri, 8 Jul 2022 16:26:32 +0000 (09:26 -0700)
committerRob Clark <robdclark@chromium.org>
Sun, 18 Sep 2022 16:37:55 +0000 (09:37 -0700)
commite93e45b1aa4909926b5c2e195eadbed1899e9e50
treef2451c7fa66c924617da6ea8cfbb0d68b37e88c6
parent479d431519631f678151a1076cf31f00e145ce9c
drm/msm/gpu: Drop qos request if devm_devfreq_add_device() fails

In the event that devm_devfreq_add_device() fails the device's qos freq
list is left referencing df->idle_freq and df->boost_freq. Attempting to
initialize devfreq again after a probe deferral will then cause invalid
memory accesses in dev_pm_qos_add_request().

Fix this by dropping the requests in the error path.

Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/493001/
Link: https://lore.kernel.org/r/20220708162632.3529864-1-bjorn.andersson@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_gpu_devfreq.c