From: Tomi Valkeinen Date: Wed, 3 Sep 2014 19:25:57 +0000 (+0000) Subject: drm/omap: add a comment why locking is missing X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f7c5f5d9e25dc524f1cdc6cf821400ac29dae486;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/omap: add a comment why locking is missing unpin_worker() calls omap_framebuffer_unpin() without any locks, which looks very suspicious. However, both pin and unpin are always called via the driver's private workqueue, so the access is synchronized that way. Add a comment to make this clear. Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c index e03512c86bf8..6eedca107376 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -71,6 +71,10 @@ static void omap_plane_unpin_worker(struct drm_flip_work *work, void *val) container_of(work, struct omap_plane, unpin_work); struct drm_device *dev = omap_plane->base.dev; + /* + * omap_framebuffer_pin/unpin are always called from priv->wq, + * so there's no need for locking here. + */ omap_framebuffer_unpin(val); mutex_lock(&dev->mode_config.mutex); drm_framebuffer_unreference(val);