serial: stm32: add support of RX FIFO threshold
authorErwan Le Ray <erwan.leray@st.com>
Tue, 18 Jun 2019 10:02:25 +0000 (12:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Jun 2019 09:17:36 +0000 (11:17 +0200)
commitd0a6a7bcc3fa0e97efce1d9a5c4cca6f3474c6bb
tree2488b1dd7497894f58efb3b7a51b6ff07f520d17
parentd075719e62ae7bc7fed3ff5be365c8c384483f15
serial: stm32: add support of RX FIFO threshold

Adds the support of RX FIFO threshold in order to improve the RX FIFO
management.
This is done by enabling fifo threshold interrupt, instead of relying
on rx empty/fifo not full irq. That basically generates one irq/char
currently. With this patch:
- RXCFG is set to half fifo size (e.g. 16/2 = 8 data for a 16 data depth
  FIFO)
- irq rate may be reduced by up to 1/RXCFG,  e.g. 1 over 8 with current
  RXCFG setting.
- Receiver timeout is used to gather chars when FIFO threshold isn't
  reached.

Signed-off-by: Erwan Le Ray <erwan.leray@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/stm32-usart.c
drivers/tty/serial/stm32-usart.h