Skip to content

Commit

Permalink
input: evdev: Move wake_lock_destroy call
Browse files Browse the repository at this point in the history
Calling wake_lock_destroy from inside a spinlock
protected region (or, in general, from atomic context)
leads to a 'scheduling while atomic bug' because the
internal wakeup source deletion logic calls
synchronize_rcu, which can sleep. Moreover,
since the interal lists are already protected with
RCUs and spinlocks, putting the wake_lock_destroy
call in a spinlock is redundant.

Change-Id: I10a2239b664a5f43e54495f24fe588fb09282305
Signed-off-by: Anurag Singh <anursing@codeaurora.org>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: umberto1978 <ur.tecnotop@gmail.com>
  • Loading branch information
halaszk authored and umberto1978 committed Jan 22, 2014
1 parent b32afec commit eea4f33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/evdev.c
Expand Up @@ -667,8 +667,8 @@ static int evdev_disable_suspend_block(struct evdev *evdev,

spin_lock_irq(&client->buffer_lock);
client->use_wake_lock = false;
wake_lock_destroy(&client->wake_lock);
spin_unlock_irq(&client->buffer_lock);
wake_lock_destroy(&client->wake_lock);

return 0;
}
Expand Down

0 comments on commit eea4f33

Please sign in to comment.