From: Jyri Sarha Date: Tue, 6 Sep 2016 19:55:33 +0000 (+0300) Subject: drm/tilcdc: Flush flip-work workqueue before drm_flip_work_cleanup() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4e910c7a1860bbc22d06da2f62010ab20a19834f;p=linux-beck.git drm/tilcdc: Flush flip-work workqueue before drm_flip_work_cleanup() Flush flip-work workqueue before drm_flip_work_cleanup(). It causes a nasty warning if there is unfinished flip-work in the queue when drm_flip_work_cleanup() is called. The flush_workqueue() has to be called before drm_crtc_cleanup() for unref_worker() to be able to do its job. Signed-off-by: Jyri Sarha Reviewed-by: Tomi Valkeinen --- diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index 5579d97b08e6..41ce411a64f9 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c @@ -18,6 +18,7 @@ #include "drm_flip_work.h" #include #include +#include #include "tilcdc_drv.h" #include "tilcdc_regs.h" @@ -227,9 +228,12 @@ static bool tilcdc_crtc_is_on(struct drm_crtc *crtc) static void tilcdc_crtc_destroy(struct drm_crtc *crtc) { struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); + struct tilcdc_drm_private *priv = crtc->dev->dev_private; tilcdc_crtc_disable(crtc); + flush_workqueue(priv->wq); + of_node_put(crtc->port); drm_crtc_cleanup(crtc); drm_flip_work_cleanup(&tilcdc_crtc->unref_work);