drm/nouveau/imem/gk20a: Turn instmem lock into mutex
authorThierry Reding <treding@nvidia.com>
Mon, 30 Jan 2017 20:03:07 +0000 (21:03 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 6 Apr 2017 04:39:03 +0000 (14:39 +1000)
commite5ffa727e5330478d9f074521dbf195c8593ed9f
tree859f4ebba33ce624533bcaa1b2b59aefe14b602b
parent2ebd42bc28525da52162425ecd7472846b78584d
drm/nouveau/imem/gk20a: Turn instmem lock into mutex

The gk20a implementation of instance memory uses vmap()/vunmap() to map
memory regions into the kernel's virtual address space. These functions
may sleep, so protecting them by a spin lock is not safe. This triggers
a warning if the DEBUG_ATOMIC_SLEEP Kconfig option is enabled. Fix this
by using a mutex instead.

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