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>