Skip to content

Commit 828906e

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 bc6f72c commit 828906e

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

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

0 commit comments

Comments
 (0)