can: mcp251xfd: ring: change order of TX and RX FIFOs
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 3 Aug 2021 14:33:48 +0000 (16:33 +0200)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 24 Feb 2022 07:46:59 +0000 (08:46 +0100)
This patch actually changes the order of the TX and RX FIFOs.

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-5-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c
drivers/net/can/spi/mcp251xfd/mcp251xfd.h

index 39005725c665353b7d55e208890970358a7afb49..9657dbf251b0ff64c216fa4d92c1f5531d1fc8dd 100644 (file)
@@ -215,8 +215,8 @@ void mcp251xfd_ring_init(struct mcp251xfd_priv *priv)
        netdev_reset_queue(priv->ndev);
 
        mcp251xfd_ring_init_tef(priv, &base);
-       mcp251xfd_ring_init_tx(priv, &base, &fifo_nr);
        mcp251xfd_ring_init_rx(priv, &base, &fifo_nr);
+       mcp251xfd_ring_init_tx(priv, &base, &fifo_nr);
 }
 
 void mcp251xfd_ring_free(struct mcp251xfd_priv *priv)
index 5c3f7f25caf0b510ef5e0b9151289ebcc4a7f5e8..8ee959890aea41f68ff3d5ca6e51841f8c67361b 100644 (file)
@@ -596,8 +596,8 @@ struct mcp251xfd_priv {
        u32 spi_max_speed_hz_slow;
 
        struct mcp251xfd_tef_ring tef[1];
-       struct mcp251xfd_tx_ring tx[1];
        struct mcp251xfd_rx_ring *rx[1];
+       struct mcp251xfd_tx_ring tx[1];
 
        u8 rx_ring_num;