]> git.baikalelectronics.ru Git - kernel.git/commit
serial: 8250: Adjust misleading LSR related comment
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 8 Jun 2022 09:54:29 +0000 (12:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jun 2022 11:45:09 +0000 (13:45 +0200)
commit4d66fb086b8d241a1a5531f0462f5b7895abb5bb
treec78fb3fdce68704e2240faec134bd91527b70a0e
parentfdda80b9d722648f4ac60ad7ad22451c94792947
serial: 8250: Adjust misleading LSR related comment

serial8250_rx_chars() has max_count based character limit. If it
triggers, the function returns the old LSR value (and it has never
returned only flags which were not handled). Adjust the comment to
match behavior and warn about which flags can be depended on.

I'd have moved LSR read before LSR read and used serial_lsr_in() also
here but I came across an old discussion about the topic. That
discussion generated commit f6dc80bf0f93 ("serial: 8250: Fix lost rx
state") so I left the code as it is (it works as long as the callers
only use a subset of the LSR flags which holds true today) and changed
the comment instead.

Link: https://www.spinics.net/lists/linux-serial/msg16220.html
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220608095431.18376-5-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c