Re: [PATCH] TTY: Fix the missing lock for the TTY ldisc buffer

From: Peter Hurley
Date: Wed Dec 10 2014 - 14:33:17 EST


On 12/10/2014 01:50 PM, Jiri Slaby wrote:
> On 12/10/2014, 07:38 PM, Denis Du wrote:
>>
>> Hi, Guys:
>
> Hi, are you sending this using some robot? I think I have seen like ten
> copies of this patch already.
>
>> It was found that the 3.12 kernel tty layer will lose or corrupt data
>> when have a full-duplex communication, especially in high baud rate, for
>> example 230k for my OMAP5 uart. Eventually I found there is lock missing
>> between copy data to ldisc layer buffer and copy data from the same
>> buffer to user space. I believe this issue existed since 3.8
>> kernel(since this kernel , it start to remove most of the spin-locks)
>> and I didn't find any fix even through 3.17 kernel. This patch was
>> tested to be works great with no any data loss again on 3.12 kernel.
>>
>> This patch was built for the latest kernel, but I cannot test it.
>> Somebody may give a test.
>>
>> I did try to use the existed lock atomic_read_lock, but it doesnât work.
>
> Anyway, adding Peter Hurley to CC who was working on eliminating locks
> from this code lately. More precisely since 3.12 we have no locks there,
> which would explain why are you seeing it starting 3.12.

Yeah, sorry. A new version of gcc for ARM exposed the lack of barriers for
the head pointer in raw mode. I got tied up on something else, but this
is my #1 priority now.

I hope to have something testable in the next day or two.
Sorry for the delay.

Regards,
Peter Hurley

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/