summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vsp1
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2016-09-14 02:19:29 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-09-19 21:01:49 +0300
commit225c2926d85bd2f9aebd5a122fa14a44b74d2594 (patch)
tree25a44dfa75a76b2f4850465cea710bc1ec79684e /drivers/media/platform/vsp1
parentfc6e514a72c718f025d69e3006d6827b25a6df27 (diff)
downloadlinux-225c2926d85bd2f9aebd5a122fa14a44b74d2594.tar.xz
[media] v4l: vsp1: Fix spinlock in mixed IRQ context function
The wpf_configure() function can be called both from IRQ and non-IRQ contexts, use spin_lock_irqsave(). Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/vsp1')
-rw-r--r--drivers/media/platform/vsp1/vsp1_wpf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_wpf.c b/drivers/media/platform/vsp1/vsp1_wpf.c
index fdee5a891e40..deb53b5df1cf 100644
--- a/drivers/media/platform/vsp1/vsp1_wpf.c
+++ b/drivers/media/platform/vsp1/vsp1_wpf.c
@@ -189,11 +189,12 @@ static void wpf_configure(struct vsp1_entity *entity,
if (params == VSP1_ENTITY_PARAMS_RUNTIME) {
const unsigned int mask = BIT(WPF_CTRL_VFLIP)
| BIT(WPF_CTRL_HFLIP);
+ unsigned long flags;
- spin_lock(&wpf->flip.lock);
+ spin_lock_irqsave(&wpf->flip.lock, flags);
wpf->flip.active = (wpf->flip.active & ~mask)
| (wpf->flip.pending & mask);
- spin_unlock(&wpf->flip.lock);
+ spin_unlock_irqrestore(&wpf->flip.lock, flags);
outfmt = (wpf->alpha << VI6_WPF_OUTFMT_PDV_SHIFT) | wpf->outfmt;