]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/instmem/gk20a: fix race conditions
authorAlexandre Courbot <acourbot@nvidia.com>
Mon, 9 Nov 2015 07:37:53 +0000 (16:37 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 11 Jan 2016 01:17:40 +0000 (11:17 +1000)
commite703759c53e083f68e213de521b6732851b02ea7
treedf761423858cb9a629aedc7bbda0003d4b096633
parent1813c9ae415da57f3860c3a7b09751d48df2bd66
drm/nouveau/instmem/gk20a: fix race conditions

The LRU list used for recycling CPU mappings was handling concurrency
very poorly. For instance, if an instobj was acquired twice before being
released once, it would end up into the LRU list even though there is
still a client accessing it.

This patch fixes this by properly counting how many clients are
currently using a given instobj.

While at it, we also raise errors when inconsistencies are detected, and
factorize some code.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c