]> git.baikalelectronics.ru Git - kernel.git/commit
can: mcp251xfd: add RX IRQ coalescing support
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 16 Feb 2021 10:46:16 +0000 (11:46 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 13 Mar 2022 08:45:36 +0000 (09:45 +0100)
commitc6617a8bba4746e9e9d50a4a12498480a70662d1
treefcbcd3b7e48c5eeb3e49ea8a421d6bac07c57729
parentd3601611f0e586ba5b579a17c7f6bce0f1cf202a
can: mcp251xfd: add RX IRQ coalescing support

This patch adds RX IRQ coalescing support to the driver.

The mcp251xfd chip doesn't support proper hardware based coalescing,
so this patch tries to implemented it in software. The RX-FIFO offers
a "FIFO not empty" interrupt, which is used if no coalescing is
active.

With activated RX IRQ coalescing the "FIFO not empty" interrupt is
disabled in the RX IRQ handler and the "FIFO half full" or "FIFO full
interrupt" (depending on RX max coalesced frames IRQ) is used instead.
To avoid RX CAN frame starvation a hrtimer is setup with RX coalesce
usecs IRQ,on timer expiration the "FIFO not empty" is enabled again.

Support for ethtool configuration is added in the next patch.

Link: https://lore.kernel.org/20220313083640.501791-9-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-ethtool.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-rx.c
drivers/net/can/spi/mcp251xfd/mcp251xfd.h