Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
Signed-off-by: Robert Richter <rrichter@cavium.com>
Signed-off-by: Vadim Lomovtsev <Vadim.Lomovtsev@caviumnetworks.com>
{
struct n_tty_data *ldata = tty->disc_data;
int room, n, rcvd = 0, overflow;
+ size_t *read_tail_tmp = &ldata->read_tail;
down_read(&tty->termios_rwsem);
* the consumer has loaded the data in read_buf up to the new
* read_tail (so this producer will not overwrite unread data)
*/
- size_t tail = smp_load_acquire(&ldata->read_tail);
+ size_t tail = smp_load_acquire(read_tail_tmp);
room = N_TTY_BUF_SIZE - (ldata->read_head - tail);
if (I_PARMRK(tty))