Skip to contentSkip to conversation

can: mcp251xfd: mcp251xfd_irq(): stop timestamping worker in case error in IRQ

PATCH In review Marc Kleine-Budde 2 participants 2 messages Jul 24, 2021 – Jul 27, 2021

Subsystems (2)
lore
Share & tools
lore

Marc Kleine-Budde

author maintainer
#0 lore raw

PATCH 1/1 can: mcp251xfd: mcp251xfd_irq(): stop timestamping worker in case error in IRQ

In case an error occurred in the IRQ handler, the chip status is dumped via devcoredump and all IRQs are disabled, but the chip stays powered for further analysis.

The chip is in an undefined state and will not receive any CAN frames, so shut down the timestamping worker, which reads the TBC register regularly, too. This avoids any CRC read error messages if there is a communication problem with the chip.

Fixes efd8d98dfb90 ("can: mcp251xfd: add HW timestamp infrastructure")
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +1 -0
index 47c3f408a799..9ae48072b6c6 100644
@@ -2300,6 +2300,7 @@ static irqreturn_t mcp251xfd_irq(int irq, void *dev_id)
 		   err, priv->regs_status.intf);
 	mcp251xfd_dump(priv);
 	mcp251xfd_chip_interrupts_disable(priv);
+	mcp251xfd_timestamp_stop(priv);
 
 	return handled;
 }
Signature · 1 line
2.30.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Marc Kleine-Budde

In case an error occurred in the IRQ handler, the chip status is dumped via devcoredump and all IRQs are disabled, but the chip stays powered for further analysis.

The chip is in an undefined state and will not receive any CAN frames, so shut down the timestamping worker, which reads the TBC register regularly, too. This avoids any CRC read error messages if there is a communication problem with the chip.

Fixes efd8d98dfb90 ("can: mcp251xfd: add HW timestamp infrastructure")

Thanks,
Mani

Quoted 20 lines
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c +1 -0
index 47c3f408a799..9ae48072b6c6 100644
@@ -2300,6 +2300,7 @@ static irqreturn_t mcp251xfd_irq(int irq, void *dev_id)
 		   err, priv->regs_status.intf);
 	mcp251xfd_dump(priv);
 	mcp251xfd_chip_interrupts_disable(priv);
+	mcp251xfd_timestamp_stop(priv);
 
 	return handled;
 }
Signature · 1 line
2.30.2