]> git.karo-electronics.de Git - linux-beck.git/commit
tty: synclink: avoid sleep_on race
authorArnd Bergmann <arnd@arndb.de>
Thu, 2 Jan 2014 12:07:40 +0000 (13:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jan 2014 01:05:21 +0000 (17:05 -0800)
commitb8c98ae49e8d53344b1d62417eea05ebc3cdbd78
treed50982086efec947214cc960d123afc616429dc9
parent591cee0a35632031cd925392a1bce507dcfe9ea8
tty: synclink: avoid sleep_on race

The four variants of the synclink driver use the same code in their
open() callback to wait for a port in process of being closed,
using interruptible_sleep_on, which is racy and going away soon.

Making things worse, these functions hold the BTM while doing so,
which means that if we ever enter this code path, we cannot actually
continue since the other thread that is in process of closing the
port can no longer get the BTM.

This addresses both issues by using wait_event_interruptible_tty()
instead.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/pcmcia/synclink_cs.c
drivers/tty/synclink.c
drivers/tty/synclink_gt.c
drivers/tty/synclinkmp.c