m_can, tcan4x5x: device-specific interrupt handling
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest5 patches 13 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | can: m_can: ops: clear_interrupts -> handle_dev_interruptsdrivers/ drivers/ drivers/ | +13 | 0 replies | |
| 2/5 | can: m_can: m_can_isr(): handle device-specific interruptsdrivers/ | +12 | 5 replies | |
| 3/5 | can: tcan4x5x: tcan4x5x_clear_interrupts(): rm unnecessary reg clearsdrivers/ | +1 | 0 replies | |
| 4/5 | can: tcan4x5x: only enable useful device interruptsdrivers/ | +2 | 0 replies | |
| 5/5 | can: tcan4x5x: implement handling of device interruptsdrivers/ | +49 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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(-)