From: Jiri Slaby Date: Mon, 5 Mar 2012 13:52:06 +0000 (+0100) Subject: XTENSA: iss/console, fix potential deadlock X-Git-Tag: MMI-PSA29.97-13-9~17267^2~73 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c9ddb1d6e29697029118377c1f4f9a4a148d755e;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git XTENSA: iss/console, fix potential deadlock If the timer ticks while we are holding the spinlock, the system deadlocks. It is due to synchronous del_timer. So to fix that, use spinlocks that properly disable bottom halves. Signed-off-by: Jiri Slaby Cc: Chris Zankel Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c index 01842e4d1904..94ab8eca9d77 100644 --- a/arch/xtensa/platforms/iss/console.c +++ b/arch/xtensa/platforms/iss/console.c @@ -91,11 +91,10 @@ static int rs_open(struct tty_struct *tty, struct file * filp) */ static void rs_close(struct tty_struct *tty, struct file * filp) { - spin_lock(&timer_lock); + spin_lock_bh(&timer_lock); if (tty->count == 1) - /* this will cause a deadlock if the timer ticks right now */ del_timer_sync(&serial_timer); - spin_unlock(&timer_lock); + spin_unlock_bh(&timer_lock); }