diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-03-05 08:52:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-03-08 14:47:01 -0500 |
commit | c9ddb1d6e29697029118377c1f4f9a4a148d755e (patch) | |
tree | 565b58ae6c81d692b7e1d4f74d51aa95ccaa99f9 /arch/xtensa | |
parent | 86e7e874635ea76fee8608646afcb103414c6e72 (diff) |
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 <jslaby@suse.cz>
Cc: Chris Zankel <chris@zankel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/platforms/iss/console.c | 5 |
1 files changed, 2 insertions, 3 deletions
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) | |||
91 | */ | 91 | */ |
92 | static void rs_close(struct tty_struct *tty, struct file * filp) | 92 | static void rs_close(struct tty_struct *tty, struct file * filp) |
93 | { | 93 | { |
94 | spin_lock(&timer_lock); | 94 | spin_lock_bh(&timer_lock); |
95 | if (tty->count == 1) | 95 | if (tty->count == 1) |
96 | /* this will cause a deadlock if the timer ticks right now */ | ||
97 | del_timer_sync(&serial_timer); | 96 | del_timer_sync(&serial_timer); |
98 | spin_unlock(&timer_lock); | 97 | spin_unlock_bh(&timer_lock); |
99 | } | 98 | } |
100 | 99 | ||
101 | 100 | ||