From: Ben Skeggs Date: Tue, 14 May 2013 03:33:56 +0000 (+1000) Subject: drm/nv50/fifo: prevent races between clients updating playlists X-Git-Tag: upstream/snapshot3+hdmi~4961^2^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5096566f6e1ee2b88324772f020ae9bc0cfa9a0;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drm/nv50/fifo: prevent races between clients updating playlists Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c index ddaeb55..89bf459 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c @@ -47,6 +47,7 @@ nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) struct nouveau_gpuobj *cur; int i, p; + mutex_lock(&nv_subdev(priv)->mutex); cur = priv->playlist[priv->cur_playlist]; priv->cur_playlist = !priv->cur_playlist; @@ -60,6 +61,7 @@ nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) nv_wr32(priv, 0x0032f4, cur->addr >> 12); nv_wr32(priv, 0x0032ec, p); nv_wr32(priv, 0x002500, 0x00000101); + mutex_unlock(&nv_subdev(priv)->mutex); } static int