Skip to content

m_can, tcan4x5x: device-specific interrupt handling

Torin Cooper-Bennun linux-can 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5can: m_can: ops: clear_interrupts -> handle_dev_interruptsdrivers/net/can/m_can/m_can.c drivers/net/can/m_can/m_can.h drivers/net/can/m_can/tcan4x5x-core.c+13 -40 replies
2/5can: m_can: m_can_isr(): handle device-specific interruptsdrivers/net/can/m_can/m_can.c+12 -55 replies
3/5can: tcan4x5x: tcan4x5x_clear_interrupts(): rm unnecessary reg clearsdrivers/net/can/m_can/tcan4x5x-core.c+1 -110 replies
4/5can: tcan4x5x: only enable useful device interruptsdrivers/net/can/m_can/tcan4x5x-core.c+2 -20 replies
5/5can: tcan4x5x: implement handling of device interruptsdrivers/net/can/m_can/tcan4x5x-core.c+49 -13 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH can-next 0/5] m_can, tcan4x5x: device-specific interrupt handling

Hi Marc and list,

This series is a follow-up to the RFC here:
https://lore.kernel.org/linux-can/[email protected]/

In this series we enable M_CAN-based devices to implement their own device-specific interrupt handling, and add such handling for tcan4x5x.

In 1, we replace the clear_interrupts() m_can_ops callback with handle_interrupts(), which returns irqreturn_t and has an extra parameter, clear_only, which is used if it isn't necessary to handle device interrupts, only clear them.

In 2, we use the new infrastructure in m_can_isr(). If M_CAN core interrupts are handled, we still only clear device interrupts. Otherwise, we try to handle any pending device interrupts.

In 3-5, we clean up interrupt enabling and clearing in tcan4x5x, and handle device interrupts appropriately. We specifically look for fatal errors arising from transceiver or power, and SPI errors, which are not necessarily fatal, but are dangerous!

TCAN4550 shutdown is attempted by setting the device into standby mode. There is probably a better way, but I understand we are limited by being in the ISR context.

The patches are based on linux-can-next/testing.

Torin Cooper-Bennun (5):
can: m_can: ops: clear_interrupts -> handle_dev_interrupts
can: m_can: m_can_isr(): handle device-specific interrupts
can: tcan4x5x: tcan4x5x_clear_interrupts(): rm unnecessary reg clears
can: tcan4x5x: only enable useful device interrupts
can: tcan4x5x: implement handling of device interrupts

 drivers/net/can/m_can/m_can.c         | 21 +++++++----
 drivers/net/can/m_can/m_can.h         |  4 +-
 drivers/net/can/m_can/tcan4x5x-core.c | 71 ++++++++++++++++++++++++++++-------
 3 files changed, 75 insertions(+), 21 deletions(-)