Skip to content

Commit be0f5c6

Browse files
author
Phil Elwell
committed
mcp2515: Change interrupt to TRIGGER_LOW
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. See: #2175 #2263 Signed-off-by: Phil Elwell <[email protected]>
1 parent ac10eaf commit be0f5c6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

arch/arm/boot/dts/overlays/mcp2515-can0-overlay.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
pinctrl-0 = <&can0_pins>;
6161
spi-max-frequency = <10000000>;
6262
interrupt-parent = <&gpio>;
63-
interrupts = <25 0x2>;
63+
interrupts = <25 8>; /* IRQF_TRIGGER_LOW */
6464
clocks = <&can0_osc>;
6565
};
6666
};

arch/arm/boot/dts/overlays/mcp2515-can1-overlay.dts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
pinctrl-0 = <&can1_pins>;
6161
spi-max-frequency = <10000000>;
6262
interrupt-parent = <&gpio>;
63-
interrupts = <25 0x2>;
63+
interrupts = <25 8>; /* IRQF_TRIGGER_LOW */
6464
clocks = <&can1_osc>;
6565
};
6666
};

drivers/net/can/spi/mcp251x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ static int mcp251x_open(struct net_device *net)
936936
{
937937
struct mcp251x_priv *priv = netdev_priv(net);
938938
struct spi_device *spi = priv->spi;
939-
unsigned long flags = IRQF_ONESHOT | IRQF_TRIGGER_FALLING;
939+
unsigned long flags = IRQF_TRIGGER_LOW;
940940
int ret;
941941

942942
ret = open_candev(net);

0 commit comments

Comments
 (0)