On Sun, Jun 21, 2020 at 10:21:11PM +0200, Jaromír Škorpil wrote: > The current version of cp210x driver doesn't provide any way to detect > a parity error in received data from userspace. Some serial protocols like > STM32 bootloader protect data only by parity so application needs to > know whether parity error happened to repeat peripheral data reading. > > Added support for icount (ioctl TIOCGICOUNT) which sends GET_COMM_STATUS > command to CP210X and according received flags increments fields for > parity error, frame error, break and overrun. An application can detect > an error condition after reading data from ttyUSB and reacts adequately. > There is no impact for applications which don't call ioctl TIOCGICOUNT. > > The flag "hardware overrun" is not examined because CP2102 sets this bit > for the first received byte after openning of port which was previously > closed with some unreaded data in buffer. This is confusing and checking > "queue overrun" flag seems be enough. > > Signed-off-by: Jaromír Škorpil <Jerry@xxxxxx> > --- > v2: Simplified counting - only queue overrun checked > v3: Changed description + UTF-8 name ;-) Much nicer, thanks for the changes! I'll let Johan comment on the actual patch itself, as he's the maintainer of this driver/subsystems. thanks, greg k-h