]> git.baikalelectronics.ru Git - kernel.git/commit
can: mcp251xfd: introduce struct mcp251xfd_tx_ring::nr and ::fifo_nr and make use...
authorMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 21 May 2021 17:51:32 +0000 (19:51 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 24 Feb 2022 07:46:59 +0000 (08:46 +0100)
commit1822a7fc83b76b9d798248ec3924693788bd1a75
tree8b5ad1ff2d264e7b2d9b2efd001b96d119f86847
parent7e97ae29b1393317986c994d375239fc61ba9683
can: mcp251xfd: introduce struct mcp251xfd_tx_ring::nr and ::fifo_nr and make use of it

This patch removes the hard coded assumption that the TX ring uses
hardware FIFO 1. This allows the hardware FIFO 1 to be used for RX and
the next free FIFO for TX.

This gives the opportunity to minimize the number of SPI transfers in
the IRQ handler. The read of the IRQ status register and RX FIFO
status registers can be combined into single SPI transfer. If the RX
ring uses FIFO 1, the overall length of the transfer is smaller than
in the original layout, where the RX FIFO comes after the TX FIFO.

Link: https://lore.kernel.org/all/20220217103826.2299157-2-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-chip-fifo.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-dump.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-regmap.c
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c
drivers/net/can/spi/mcp251xfd/mcp251xfd.h