ipoctal: protect only the real critical section
ipoctal: protect only the real critical section

In some conditions (echo or particular sequence of special
characters), on buffer push, the tty layer calls the write operation
while we are holding the spinlock. This means deadlock within the same
process on kernels version < 3.12. It seems not a problem on recent
kernel, but the patch still valid as locking optimization.

The protected variables by the spinlock are: xmit_buf, nb_bytes,
pointer_read and pointer_write. So, this patch reduces the locked area
in the IRQ handler only to these variables. Most of the code inside the
locked area in the IRQ handler is not protected elsewhere; it means
that it is not protected at all.

Signed-off-by: Federico Vaga <23676262d92d617122559684a73d8a5117b40b66@cern.ch>
Acked-by: Samuel Iglesias Gonsalvez <b753b212f30aed827c3eea2e437609dc37310153@igalia.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs