Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/dsi: Use correct pm_runtime_put variant during host_init

The DSI runtime PM suspend/resume callbacks check whether
msm_host->cfg_hnd is non-NULL before trying to enable the bus clocks.
This is done to accommodate early calls to these functions that may
happen before the bus clocks are even initialized.

Calling pm_runtime_put_autosuspend() in dsi_host_init() can result in
racy behaviour since msm_host->cfg_hnd is set very soon after. If the
suspend callback happens too late, we end up trying to disable clocks
that were never enabled, resulting in a bunch of WARN_ON splats.

Use pm_runtime_put_sync() so that the suspend callback is called
immediately.

Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>

authored by

Archit Taneja and committed by
Rob Clark
a18a0ea0 c9811d0f

+1 -1
+1 -1
drivers/gpu/drm/msm/dsi/dsi_host.c
··· 248 248 clk_disable_unprepare(ahb_clk); 249 249 disable_gdsc: 250 250 regulator_disable(gdsc_reg); 251 - pm_runtime_put_autosuspend(dev); 251 + pm_runtime_put_sync(dev); 252 252 put_clk: 253 253 clk_put(ahb_clk); 254 254 put_gdsc: