aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/ff-memless.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-11-23 19:57:36 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-11-30 13:36:51 -0500
commit211f05a034f49586fdd071abd174853217ec29ee (patch)
treea23a1dd79b65049855e9344df42305442aa2a170 /drivers/input/ff-memless.c
parent02d0e6753d8ab0173b63338157929e52eac86d12 (diff)
input: replace spin_lock_bh with spin_lock_irqsave in ml_ff_playback
ml_ff_playback() uses spin_(un)lock_bh. However this function is called with interrupts disabled from erase_effect() in drivers/input/ff-core.c:196. This is not permitted, and will result in a WARN_ON in the bottom half handling code. This patch changes this function to just use spin_lock_irqsave() instead, solving the problem and simplifying the locking logic. This was reported as entry #106559 in kerneloops.org Reported-by: kerneloops.org Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/input/ff-memless.c')
-rw-r--r--drivers/input/ff-memless.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c
index 6790e975a98c..bc4e40f3ede7 100644
--- a/drivers/input/ff-memless.c
+++ b/drivers/input/ff-memless.c
@@ -397,8 +397,9 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)
397{ 397{
398 struct ml_device *ml = dev->ff->private; 398 struct ml_device *ml = dev->ff->private;
399 struct ml_effect_state *state = &ml->states[effect_id]; 399 struct ml_effect_state *state = &ml->states[effect_id];
400 unsigned long flags;
400 401
401 spin_lock_bh(&ml->timer_lock); 402 spin_lock_irqsave(&ml->timer_lock, flags);
402 403
403 if (value > 0) { 404 if (value > 0) {
404 debug("initiated play"); 405 debug("initiated play");
@@ -424,7 +425,7 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value)
424 ml_play_effects(ml); 425 ml_play_effects(ml);
425 } 426 }
426 427
427 spin_unlock_bh(&ml->timer_lock); 428 spin_unlock_irqrestore(&ml->timer_lock, flags);
428 429
429 return 0; 430 return 0;
430} 431}