diff options
author | Paul Fulghum <paulkf@microgate.com> | 2011-01-18 14:03:25 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-22 19:15:01 -0800 |
commit | 1035b63d3c6fc34a9b8c4a181366eec6d6158b31 (patch) | |
tree | a1078793d172e79fdede20f30e371ba05d7c2d2b /Documentation | |
parent | d0694e2aeb815042aa0f3e5036728b3db4446f1d (diff) | |
download | linux-1035b63d3c6fc34a9b8c4a181366eec6d6158b31.tar.gz linux-1035b63d3c6fc34a9b8c4a181366eec6d6158b31.tar.bz2 linux-1035b63d3c6fc34a9b8c4a181366eec6d6158b31.zip |
n_hdlc: fix read and write locking
Fix locking in read and write code of n_hdlc line discipline.
2.6.36 replaced lock_kernel() with tty_lock(). The tty mutex is not
dropped automatically when the thread sleeps like the BKL. This results
in a blocked read or write holding the tty mutex and stalling operations
by other devices that use the tty mutex.
A review of n_hdlc read and write code shows:
1. neither BKL or tty mutex are required for correct operation
2. read can block while read data is available if data is posted
between availability check and call to interruptible_sleep_on()
3. write does not set process state to TASK_INTERRUPTIBLE
on each pass through the processing loop which can cause
unneeded scheduling of the thread
The unnecessary tty mutex references have been removed.
Read changed to use same code as n_tty read
for completing reads and blocking.
Write corrected to set process state to TASK_INTERRUPTIBLE on each pass
through processing loop.
Signed-off-by: Paul Fulghum <paulkf@microgate.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'Documentation')
0 files changed, 0 insertions, 0 deletions