can: mcp251xfd: mcp251xfd_irq(): add missing can_rx_offload_threaded_irq_finish() in case of bus off
Subsystems (2)
Marc Kleine-Budde
maintainerPATCH 1/2 can: mcp251xfd: mcp251xfd_irq(): add missing can_rx_offload_threaded_irq_finish() in case of bus off
The function can_rx_offload_threaded_irq_finish() is needed to trigger the NAPI thread to deliver read CAN frames to the networking stack.
This patch adds the missing call to can_rx_offload_threaded_irq_finish() in case of a bus off, before leaving the interrupt handler to avoid packet starvation.
Fixes 30bfec4fec59 ("can: rx-offload: can_rx_offload_threaded_irq_finish(): add new function to be called from threaded interrupt")
Signed-off-by Marc Kleine-Budde <[email protected]>
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +3 -1
@@ -2290,8 +2290,10 @@ static irqreturn_t mcp251xfd_irq(int irq, void *dev_id)* check will fail, too. So leave IRQ handler * directly. */ -if (priv->can.state ==CAN_STATE_BUS_OFF ) +if (priv->can.state ==CAN_STATE_BUS_OFF ) { +can_rx_offload_threaded_irq_finish (&priv->offload);return IRQ_HANDLED ; + } } handled =IRQ_HANDLED ;
Signature · 1 line
2.33.0
Marc Kleine-Budde
maintainerPATCH 2/2 can: mcp251xfd: mcp251xfd_chip_start(): fix error handling for mcp251xfd_chip_rx_int_enable()
This patch fixes the error handling for mcp251xfd_chip_rx_int_enable(). Instead just returning the error, properly shut down the chip in case of an error.
Fixes 55e5b97f003e ("can: mcp25xxfd: add driver for Microchip MCP25xxFD SPI CAN")
Signed-off-by Marc Kleine-Budde <[email protected]>
--- drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +1 -1
@@ -1092,7 +1092,7 @@ static int mcp251xfd_chip_start(struct mcp251xfd_priv *priv) err =mcp251xfd_chip_rx_int_enable (priv);if (err) -return err; + goto out_chip_stop; err =mcp251xfd_chip_ecc_init (priv);if (err)
Signature · 1 line
2.33.0