Skip to content

Commit

Permalink
drm/omap: add a comment why locking is missing
Browse files Browse the repository at this point in the history
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 <tomi.valkeinen@ti.com>
  • Loading branch information
Tomi Valkeinen committed Mar 24, 2015
1 parent f36eb5a commit f7c5f5d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/omapdrm/omap_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f7c5f5d

Please sign in to comment.