2014-12-05 20:25:11

by Denis Du

[permalink] [raw]
Subject: TTY layer need a lock to copy data to user space



Hi, Guys:
It was found that the 3.12 kernel tty layer will lose or corrupt data when have a full-duplex communication, especcially in high baudrate, 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.


I did try to use the existed lock atomic_read_lock, but it doesn’t work.



Denis Du


Attachments:
Fix-serial-lose-data-by-newlock.patch (1.95 kB)