]> git.karo-electronics.de Git - karo-tx-linux.git/commit
staging: quatech_usb2: Potential lost wakeup scenario in TIOCMIWAIT
authorKautuk Consul <consul.kautuk@gmail.com>
Wed, 14 Sep 2011 03:26:21 +0000 (08:56 +0530)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:35:25 +0000 (15:35 -0400)
commitd6bf984a19fba5bf1d8efc86f2b1dc7c3e71b614
tree8882f54c0ded608f6edfdb1501f28460d27c4f14
parent634a1a9359529a289f764a26911eb1a5a3b85a42
staging: quatech_usb2: Potential lost wakeup scenario in TIOCMIWAIT

commit e8df1674d383d2ecc6efa8d7dba74c03aafdfdd7 upstream.

If the usermode app does an ioctl over this serial device  by
using TIOCMIWAIT, then the code will wait by setting the current
task state to TASK_INTERRUPTIBLE and then calling schedule().
This will be woken up by the qt2_process_modem_status on URB
completion when the port_extra->shadowMSR is set to the new
modem status.

However, this could result in a lost wakeup scenario due to a race
in the logic in the qt2_ioctl(TIOCMIWAIT) loop and the URB completion
for new modem status in qt2_process_modem_status.
Due to this, the usermode app's task will continue to sleep despite a
change in the modem status.

Signed-off-by: Kautuk Consul <consul.kautuk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/staging/quatech_usb2/quatech_usb2.c