diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2016-09-13 19:19:29 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-09-19 14:01:49 -0400 |
commit | 225c2926d85bd2f9aebd5a122fa14a44b74d2594 (patch) | |
tree | 25a44dfa75a76b2f4850465cea710bc1ec79684e | |
parent | fc6e514a72c718f025d69e3006d6827b25a6df27 (diff) |
[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>
-rw-r--r-- | drivers/media/platform/vsp1/vsp1_wpf.c | 5 |
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, | |||
189 | if (params == VSP1_ENTITY_PARAMS_RUNTIME) { | 189 | if (params == VSP1_ENTITY_PARAMS_RUNTIME) { |
190 | const unsigned int mask = BIT(WPF_CTRL_VFLIP) | 190 | const unsigned int mask = BIT(WPF_CTRL_VFLIP) |
191 | | BIT(WPF_CTRL_HFLIP); | 191 | | BIT(WPF_CTRL_HFLIP); |
192 | unsigned long flags; | ||
192 | 193 | ||
193 | spin_lock(&wpf->flip.lock); | 194 | spin_lock_irqsave(&wpf->flip.lock, flags); |
194 | wpf->flip.active = (wpf->flip.active & ~mask) | 195 | wpf->flip.active = (wpf->flip.active & ~mask) |
195 | | (wpf->flip.pending & mask); | 196 | | (wpf->flip.pending & mask); |
196 | spin_unlock(&wpf->flip.lock); | 197 | spin_unlock_irqrestore(&wpf->flip.lock, flags); |
197 | 198 | ||
198 | outfmt = (wpf->alpha << VI6_WPF_OUTFMT_PDV_SHIFT) | wpf->outfmt; | 199 | outfmt = (wpf->alpha << VI6_WPF_OUTFMT_PDV_SHIFT) | wpf->outfmt; |
199 | 200 | ||