Roy Spliet
2013-Jul-18 11:58 UTC
[Nouveau] [PATCH 10/11] drm/nvc0/fb: Take lock in nvc0_ram_put()
Kernel panic caused by list corruption in ltcg seems to indicate a concurrency issue. Take mutex of pfb like nv50_ram_put() to eliminate concurrency. Signed-off-by: Roy Spliet <r.spliet at student.tudelft.nl> --- drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c index 9c3634a..abe0b61 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c @@ -33,11 +33,18 @@ void nvc0_ram_put(struct nouveau_fb *pfb, struct nouveau_mem **pmem) { struct nouveau_ltcg *ltcg = nouveau_ltcg(pfb); + struct nouveau_mem *mem = *pmem; - if ((*pmem)->tag) - ltcg->tags_free(ltcg, &(*pmem)->tag); + *pmem = NULL; + if(unlikely(mem == NULL)) + return; - nv50_ram_put(pfb, pmem); + mutex_lock(&pfb->base.mutex); + if (mem->tag) + ltcg->tags_free(ltcg, &mem->tag); + mutex_unlock(&pfb->base.mutex); + + nv50_ram_put(pfb, &mem); } int -- 1.8.3.1
Apparently Analagous Threads
- [PATCH 10/11] drm/nvc0/fb: Take lock in nvc0_ram_put()
- [PATCH 1/4] drm/nvc0: implement VRAM compression
- [PATCH] drm/nvc0-/ltcg: fix ltcg memory initialization after suspend
- [PATCH] drm/nouveau: fix ltcg memory initialization after suspend
- [PATCH] drm/nouveau: fix ltcg memory initialization after suspend