tty: hold lock across tty buffer finding and buffer filling
authorXiaobing Tu <xiaobing.tu@intel.com>
Fri, 16 Mar 2012 15:20:06 +0000 (11:20 -0400)
committerbuildbot <buildbot@intel.com>
Mon, 19 Mar 2012 22:43:40 +0000 (15:43 -0700)
commit3c8aac468c0c7d571750113e243893c041b9b702
tree03b94d7abc06ac91d5d79f518f9d9524c5b7b911
parent2ddc8423f0112d5e7bbe83908bcbc22bcc913870
tty: hold lock across tty buffer finding and buffer filling

BZ:27313

tty_buffer_request_room is well protected, but while after it returns,
it releases the port->lock. tty->buf.tail might be modified
by either irq handler or other threads. The patch adds more protection
by holding the lock across tty buffer finding and buffer filling.
Signed-off-by: Xiaobing Tu <xiaobing.tu@intel.com>
Change-Id: Iffbfc2d7e6400807abe6d791e5f8a48e150be5e4
Reviewed-on: http://android.intel.com:8080/38961
Reviewed-by: Tu, Xiaobing <xiaobing.tu@intel.com>
Reviewed-by: Yang, Fei <fei.yang@intel.com>
Reviewed-by: Mansoor, Illyas <illyas.mansoor@intel.com>
Reviewed-by: Koskinen, Ilkka <ilkka.koskinen@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/tty/tty_buffer.c