All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH can-next 0/5] m_can, tcan4x5x: device-specific interrupt handling
@ 2021-05-26 12:47 Torin Cooper-Bennun
  2021-05-26 12:47 ` [PATCH can-next 1/5] can: m_can: ops: clear_interrupts -> handle_dev_interrupts Torin Cooper-Bennun
                   ` (6 more replies)
  0 siblings, 7 replies; 19+ messages in thread
From: Torin Cooper-Bennun @ 2021-05-26 12:47 UTC (permalink / raw)
  To: Marc Kleine-Budde, linux-can

Hi Marc and list,

This series is a follow-up to the RFC here:
  https://lore.kernel.org/linux-can/20210514121946.2344901-1-torin@maxiluxsystems.com/

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(-)



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

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

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 12:47 [PATCH can-next 0/5] m_can, tcan4x5x: device-specific interrupt handling Torin Cooper-Bennun
2021-05-26 12:47 ` [PATCH can-next 1/5] can: m_can: ops: clear_interrupts -> handle_dev_interrupts Torin Cooper-Bennun
2021-05-26 12:47 ` [PATCH can-next 2/5] can: m_can: m_can_isr(): handle device-specific interrupts Torin Cooper-Bennun
2021-05-26 15:07   ` Marc Kleine-Budde
2021-05-26 15:18     ` Marc Kleine-Budde
2021-06-01  8:23       ` Torin Cooper-Bennun
2021-06-01 10:25         ` Marc Kleine-Budde
2021-06-01  7:22     ` Torin Cooper-Bennun
2021-05-26 12:47 ` [PATCH can-next 3/5] can: tcan4x5x: tcan4x5x_clear_interrupts(): rm unnecessary reg clears Torin Cooper-Bennun
2021-05-26 12:47 ` [PATCH can-next 4/5] can: tcan4x5x: only enable useful device interrupts Torin Cooper-Bennun
2021-05-26 12:47 ` [PATCH can-next 5/5] can: tcan4x5x: implement handling of " Torin Cooper-Bennun
2021-05-26 15:15   ` Marc Kleine-Budde
2021-06-01  7:50     ` Torin Cooper-Bennun
2021-06-01  8:19       ` Marc Kleine-Budde
2021-05-26 15:20 ` [PATCH can-next 0/5] m_can, tcan4x5x: device-specific interrupt handling Marc Kleine-Budde
2021-06-01  8:21   ` Torin Cooper-Bennun
2021-06-01  9:18     ` Marc Kleine-Budde
2021-06-01 10:56       ` Torin Cooper-Bennun
2021-07-02  7:33 ` Torin Cooper-Bennun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.