From: Jyri Sarha Date: Mon, 5 Sep 2016 17:39:32 +0000 (+0300) Subject: drm/tilcdc: Take crtc modeset lock while updating the crtc clock rate X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a6b7ebaadb5c8d869908e803e5616922a5096253;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/tilcdc: Take crtc modeset lock while updating the crtc clock rate Take crtc modeset lock while updating the crtc clock rate. To avoid a race in tilcdc_crtc_update_clk(), we do not want crtc mode to change while we update crtc clock. Signed-off-by: Jyri Sarha Reviewed-by: Tomi Valkeinen --- diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index f8892e9ad169..b1ac61eac056 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -184,10 +184,13 @@ static int cpufreq_transition(struct notifier_block *nb, { struct tilcdc_drm_private *priv = container_of(nb, struct tilcdc_drm_private, freq_transition); + if (val == CPUFREQ_POSTCHANGE) { if (priv->lcd_fck_rate != clk_get_rate(priv->clk)) { + drm_modeset_lock_crtc(priv->crtc, NULL); priv->lcd_fck_rate = clk_get_rate(priv->clk); tilcdc_crtc_update_clk(priv->crtc); + drm_modeset_unlock_crtc(priv->crtc); } }