summaryrefslogtreecommitdiff
path: root/drivers/tty/sysrq.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>2020-10-01 09:44:15 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-01 10:57:50 +0200
commitfce3c5c1a2d9cd888f2987662ce17c0c651916b2 (patch)
treeefc18ce5bb8aa64f047a427b22c0049e69636294 /drivers/tty/sysrq.c
parent85985a3dcd7415dd849cf62ec14f931cd905099a (diff)
downloadlwn-fce3c5c1a2d9cd888f2987662ce17c0c651916b2.tar.gz
lwn-fce3c5c1a2d9cd888f2987662ce17c0c651916b2.zip
serial: max310x: rework RX interrupt handling
Currently, the RX interrupt logic uses the RXEMPTY interrupt, with the RXEMPTYINV bit set, which means we get an RX interrupt as soon as the RX FIFO is non-empty. However, with the MAX310X having a FIFO of 128 bytes, this makes very poor use of the FIFO: we trigger an interrupt as soon as the RX FIFO has one byte, which means a lot of interrupts, each only collecting a few bytes from the FIFO, causing a significant CPU load. Instead this commit relies on two other RX interrupt events: - MAX310X_IRQ_RXFIFO_BIT, which triggers when the RX FIFO has reached a certain threshold, which we define to be half of the FIFO size. This ensure we get an interrupt before the RX FIFO fills up. - MAX310X_LSR_RXTO_BIT, which triggers when the RX FIFO has received some bytes, and then no more bytes are received for a certain time. Arbitrarily, this time is defined to the time is takes to receive 4 characters. On a Microchip SAMA5D3 platform that is receiving 20 bytes every 16ms over one MAX310X UART, this patch has allowed to reduce the CPU consumption of the interrupt handler thread from ~25% to 6-7%. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Link: https://lore.kernel.org/r/20201001074415.349739-1-thomas.petazzoni@bootlin.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/sysrq.c')
0 files changed, 0 insertions, 0 deletions