Skip to content

Commit

Permalink
mcp2515: Use DT-supplied interrupt flags
Browse files Browse the repository at this point in the history
The MCP2515 datasheet clearly describes a level-triggered interrupt
pin. Therefore the receiving interrupt controller must also be
configured for level-triggered operation otherwise there is a danger
of a missed interrupt condition blocking all subsequent interrupts.
The ONESHOT flag ensures that the interrupt is masked until the
threaded interrupt handler exits.

Rather than change the flags globally (they must have worked for at
least one user), allow the flags to be overridden from Device Tree
in the event that the device has a DT node.

See: #2175
     #2263

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  • Loading branch information
Phil Elwell authored and popcornmix committed May 7, 2019
1 parent f4d32b1 commit f9b0096
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/can/spi/mcp251x.c
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,9 @@ static int mcp251x_open(struct net_device *net)
priv->tx_skb = NULL;
priv->tx_len = 0;

if (spi->dev.of_node)
flags = 0;

ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
flags | IRQF_ONESHOT, DEVICE_NAME, priv);
if (ret) {
Expand Down

0 comments on commit f9b0096

Please sign in to comment.