-
Notifications
You must be signed in to change notification settings - Fork 5.2k
MCP2515 Hangs When Set to IRQF_TRIGGER_FALLING #2175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a duplicate of #1490, a long-standing issue for which up to now we don't have a fix. I'd like to read up a bit to verify that your change is safe, but I would always prefer a level-sensitive interrupt to an edge-sensitive one for this reason, so I'm hopeful that we may be able to close both issues soon thanks to your suggestion. |
I have a 4 channel MCP2515 board I built using SPI 0.0, 0.1, 1.0, and 1.1, which stresses the Pi further, let me know if I can be of any assistance with research into the issue. |
Hi I'm busy debugging my dual can adapter and seeing some weird initialization bug I much prefer this approach If we're not sure about making a sweeping change why don't we add a module option to this to specify whether you want a edge or level trigger and default it to the edge as standard? I'm not the greatest of C coders, but I can hack together a patch if that helps move things forward It would be nice to clear this up before the holiday season. |
I've seen on other overlays the trigger type as an option, but I'm not sufficiently familiar with how they work to implement it myself. |
Hey Chris, Did you have any problems with CAN interfaces not automatically coming up (even if respective entries are there /etc/network/interfaces) or issues with CAN devices not initializing when rebooting via command line. Got a weird bug and it's not making a lot of sense :( |
I typically do
in a script when I want to bring the interface. I haven't tried to have them automatically come up via other methods. What sort of hardware are you using? |
Perhaps this forum thread may help with the initialisation problem: https://www.raspberrypi.org/forums/viewtopic.php?t=190868 |
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
See #2267. |
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
Just to update the issue with initialization above was a crystal issue, swapped them for the usual type I use and the interfaces came up as expected. Happy to test the patch referred to above if you can point me on how to do this? |
There are numerous ways to download a pull request, but the simplest is to download the raw patch and apply it: $ wget https://patch-diff.githubusercontent.com/raw/raspberrypi/linux/pull/2267.patch
$ git am 2267.patch Then build and install the kernel as normal. (Note: this will apply the patch to your current branch rather than the branch the PR was submitted against, but as long as you're on 4.9 the difference should be academic). |
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi#2175 raspberrypi#2263 Signed-off-by: Phil Elwell <[email protected]>
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]>
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]>
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]>
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]>
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]>
kernel: config: Add GPIO_PCF857X=m See: raspberrypi/linux#2294 kernel: mcp2515: Use DT-supplied interrupt flags See: raspberrypi/linux#2175 kernel: cgroup: Fix automatic disabling of cgroup memory See: https://github.com/raspberrypi/issues/1950 firmware: arm_dt: Suppress non-fatal errors See: #906 firmware: dtoverlay: Create "/aliases" node when needed See: #906
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]>
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]>
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]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 8a23ccb8e8db6bb18e44d11b838e11dbc976b45f) https://github.com/raspberrypi/linux.git rpi-5.3.y) Signed-off-by: Hui Wang <[email protected]>
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]>
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]>
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]>
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]>
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]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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]>
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]>
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]>
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]>
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> (cherry picked from commit 8a23ccb8e8db6bb18e44d11b838e11dbc976b45f) https://github.com/raspberrypi/linux.git rpi-5.3.y) Signed-off-by: Hui Wang <[email protected]>
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
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), keep the old behavior for for non DT devices. DT based devices specify the flags in their corresonding DT node. See: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]> Tested-by: Sean Nyekjaer <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
Anyone how to do the same trick in PGPIO (https://abyz.me.uk/rpi/pigpio/cif.html) My pin gets randomly stuck low. Sometimes I can run my CAN-bus for 2 hours. Sometimes 1 minute. |
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]>
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: raspberrypi/linux#2175 raspberrypi/linux#2263 Signed-off-by: Phil Elwell <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
linux/drivers/net/can/spi/mcp251x.c
Line 939 in dbe9b03
I'm working with a Raspberry Pi 3 and a PiCAN Duo, and my can0/can1 interfaces will hang after a period of time ranging from 30 seconds to 15 minutes.
I hooked up a logic analyzer to the MCP2515 and saw that the interrupt line was getting stuck low (active) and the can interface would resume if the line was pulled high again. I suspect that the falling edge interrupt is being missed, though I don't understand why.
I changed line 939 to be
(level triggered low) and the issue has gone away. I haven't had a chance to test if this causes the CAN interface to miss messages or not, but it seems to be working as far as I can tell.
If the falling edge trigger is required for some reason, or I'm doing something foolish, please let me know.
Chris
The text was updated successfully, but these errors were encountered: