summary'>refslogtreecommitdiffstats
'>
path: '>root//'>sys-kernel/boest-v5.0.15//'>raspberrypi//0100-mcp2515-Use-DT-supplied-interrupt-flags.patch
diff options
context:
space:
mode:
Diffstat (limited to 'sys-kernel/boest-v5.0.15/raspberrypi/0100-mcp2515-Use-DT-supplied-interrupt-flags.patch')
-rw-r--r--sys-kernel/boest-v5.0.15/raspberrypi/0100-mcp2515-Use-DT-supplied-interrupt-flags.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/sys-kernel/boest-v5.0.15/raspberrypi/0100-mcp2515-Use-DT-supplied-interrupt-flags.patch b/sys-kernel/boest-v5.0.15/raspberrypi/0100-mcp2515-Use-DT-supplied-interrupt-flags.patch
new file mode 100644
index 00000000..5bd313a9
--- /dev/null
+++ b/sys-kernel/boest-v5.0.15/raspberrypi/0100-mcp2515-Use-DT-supplied-interrupt-flags.patch
@@ -0,0 +1,38 @@
+From 3707dc74ddd35e602afa28bde14187ed2249127d Mon Sep 17 00:00:00 2001
+From: Phil Elwell <phil@raspberrypi.org>
+Date: Tue, 14 Nov 2017 11:03:22 +0000
+Subject: [PATCH 100/194] 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: https://github.com/raspberrypi/linux/issues/2175
+ https://github.com/raspberrypi/linux/issues/2263
+
+Signed-off-by: Phil Elwell <phil@raspberrypi.org>
+---
+ drivers/net/can/spi/mcp251x.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
+index e90817608645..663203fbb1b8 100644
+--- a/drivers/net/can/spi/mcp251x.c
++++ b/drivers/net/can/spi/mcp251x.c
+@@ -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) {