staging: bcm2835-camera: Replace spinlock protecting context_map with mutex
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Sat, 29 Jun 2019 12:13:17 +0000 (14:13 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Jul 2019 06:11:22 +0000 (08:11 +0200)
commit4502c43d7f3b3b849dd7230010ad26898b0588e8
treeb23b3f5f469cc6f543bbba543f29adcf920e4b9a
parent22a20b9f6d9f6adb73e3334f861669bf2c55879c
staging: bcm2835-camera: Replace spinlock protecting context_map with mutex

commit 8dedab2903f152aa3cee9ae3d57c828dea0d356e upstream.

The commit "staging: bcm2835-camera: Replace open-coded idr with a struct idr."
replaced an internal implementation of an idr with the standard functions
and a spinlock. idr_alloc(GFP_KERNEL) can sleep whilst calling kmem_cache_alloc
to allocate the new node, but this is not valid whilst in an atomic context
due to the spinlock.

There is no need for this to be a spinlock as a standard mutex is
sufficient.

Fixes: 950fd867c635 ("staging: bcm2835-camera: Replace open-coded idr with a struct idr.")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c