linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: mcp251xfd: mcp251xfd_irq(): stop timestamping worker in case error in IRQ
@ 2021-07-24 15:51 Marc Kleine-Budde
  2021-07-27  7:18 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 2+ messages in thread
From: Marc Kleine-Budde @ 2021-07-24 15:51 UTC (permalink / raw)
  To: linux-can; +Cc: Manivannan Sadhasivam, Thomas Kopp, 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")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 47c3f408a799..9ae48072b6c6 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -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;
 }
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] can: mcp251xfd: mcp251xfd_irq(): stop timestamping worker in case error in IRQ
  2021-07-24 15:51 [PATCH] can: mcp251xfd: mcp251xfd_irq(): stop timestamping worker in case error in IRQ Marc Kleine-Budde
@ 2021-07-27  7:18 ` Manivannan Sadhasivam
  0 siblings, 0 replies; 2+ messages in thread
From: Manivannan Sadhasivam @ 2021-07-27  7:18 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can, Thomas Kopp

On Sat, Jul 24, 2021 at 05:51:31PM +0200, Marc Kleine-Budde wrote:
> 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")
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> index 47c3f408a799..9ae48072b6c6 100644
> --- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> +++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
> @@ -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;
>  }
> -- 
> 2.30.2
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-27  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-24 15:51 [PATCH] can: mcp251xfd: mcp251xfd_irq(): stop timestamping worker in case error in IRQ Marc Kleine-Budde
2021-07-27  7:18 ` Manivannan Sadhasivam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).