Skip to content

Commit 86ef1d8

Browse files
Phil Elwellpopcornmix
Phil Elwell
authored andcommitted
mcp2515: Use DT-supplied interrupt flags
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 <[email protected]>
1 parent 8e6e0c0 commit 86ef1d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/can/spi/mcp251x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,9 @@ static int mcp251x_open(struct net_device *net)
935935
priv->tx_skb = NULL;
936936
priv->tx_len = 0;
937937

938+
if (spi->dev.of_node)
939+
flags = 0;
940+
938941
ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
939942
flags | IRQF_ONESHOT, DEVICE_NAME, priv);
940943
if (ret) {

0 commit comments

Comments
 (0)