Skip to content

Commit 692baed

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 57b9b7c commit 692baed

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
@@ -952,6 +952,9 @@ static int mcp251x_open(struct net_device *net)
952952
priv->tx_skb = NULL;
953953
priv->tx_len = 0;
954954

955+
if (spi->dev.of_node)
956+
flags = 0;
957+
955958
ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
956959
flags | IRQF_ONESHOT, DEVICE_NAME, priv);
957960
if (ret) {

0 commit comments

Comments
 (0)