]> git.baikalelectronics.ru Git - kernel.git/commit
drm/omap: fix race issue when unloading omapdrm
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 2 Apr 2014 11:31:57 +0000 (14:31 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 14 Apr 2014 09:34:14 +0000 (12:34 +0300)
commit5170391f32a29202be9aaa94e78435569893050f
tree020db67510226850520f26769da44549f46d050f
parent80c552fb95b3b7470f94e0dfc2396390a6fbbf38
drm/omap: fix race issue when unloading omapdrm

At module unload, omap_fbdev_free() gets called which releases the
framebuffers. However, the framebuffers are still used by crtcs, and
will be released only later at vsync. The driver doesn't wait for this,
and goes on to release the rest of the resources, which often
causes a crash.

This patchs adds a omap_crtc_flush() function which waits until the crtc
has finished with its apply queue and page flips.

The function utilizes a simple polling while-loop, as the performance is
not an issue here.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/omapdrm/omap_crtc.c
drivers/gpu/drm/omapdrm/omap_drv.c
drivers/gpu/drm/omapdrm/omap_drv.h