-
Notifications
You must be signed in to change notification settings - Fork 5.2k
MCP23017 interrupt broke on 6.6.y overlays #5677
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
I reverted |
The incorrect fragment order (*) caused broke the interrupt usage, and while it was being fixed the lack of a reference to the pinctrl declaration was noticed. See: raspberrypi#5677 Signed-off-by: Phil Elwell <[email protected]> (*) Ideally all fragments would appear in the file in the order in which they should be merged, but that is easy to forget and can be awkward, so the firmware merges all "intra" fragments (those that target other fragments in the overlay) before "inter" fragments (those that target the base DTB). However, intra fragments that target other intra fragments is a level of nesting too far for this logic to cope, so they must appear before the fragments they target.
This is caused by the ease of getting the fragment order wrong, something I'd like to detect and automatically warn about, and actually affects rpi-6.1.y as well. If you have time it would be helpful it you could install a trial kernel - wait about an hour until the build checks (https://github.com/raspberrypi/linux/pull/5678/checks) complete then run |
This is ready to test now, if you are able to. |
The incorrect fragment order (*) caused broke the interrupt usage, and while it was being fixed the lack of a reference to the pinctrl declaration was noticed. See: #5677 Signed-off-by: Phil Elwell <[email protected]> (*) Ideally all fragments would appear in the file in the order in which they should be merged, but that is easy to forget and can be awkward, so the firmware merges all "intra" fragments (those that target other fragments in the overlay) before "inter" fragments (those that target the base DTB). However, intra fragments that target other intra fragments is a level of nesting too far for this logic to cope, so they must appear before the fragments they target.
The incorrect fragment order (*) caused broke the interrupt usage, and while it was being fixed the lack of a reference to the pinctrl declaration was noticed. See: #5677 Signed-off-by: Phil Elwell <[email protected]> (*) Ideally all fragments would appear in the file in the order in which they should be merged, but that is easy to forget and can be awkward, so the firmware merges all "intra" fragments (those that target other fragments in the overlay) before "inter" fragments (those that target the base DTB). However, intra fragments that target other intra fragments is a level of nesting too far for this logic to cope, so they must appear before the fragments they target.
The pull rolled it to kernel 6.1.58-v8+. The targeted GPIO pin 23 is marked as unused, and there is no entry found in
|
Inconsistent or different? phandles are allocated by the dtc compiler and firmware, and depend on the entire content of the dts/dtb file. What matters is that if in one branch node A uses phandle X and node B has the property |
The incorrect fragment order (*) caused broke the interrupt usage, and while it was being fixed the lack of a reference to the pinctrl declaration was noticed. See: #5677 Signed-off-by: Phil Elwell <[email protected]> (*) Ideally all fragments would appear in the file in the order in which they should be merged, but that is easy to forget and can be awkward, so the firmware merges all "intra" fragments (those that target other fragments in the overlay) before "inter" fragments (those that target the base DTB). However, intra fragments that target other intra fragments is a level of nesting too far for this logic to cope, so they must appear before the fragments they target.
Thanks for the clarification. "Different" may be the proper term in this case. Are there other places in your mind to investigate? |
Are there any errors or warnings in the kernel log? I don't have an MCP23017 to test. |
The problem was due to a short on one of the i2c addressing pins. The interrupt is now adequately configured with your new patch. Thanks. |
Thank goodness for that - you had me worried. |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
GPIO interrupt is not configured correctly when setting up mcp23017 with devicetree overlay in
config.txt
with kernel branchrpi-6.6.y
.If I roll back to the latest Raspberry OS Lite image (
2023-10-10-raspios-bookworm-arm64-lite
), the interrupt will then be configured as expected and can show up under/proc/interrupts
:Steps to reproduce the behaviour
rpi-6.6.y
branch, commitf275f8f
: Typo in overlays READMEDevice (s)
Raspberry Pi 4 Mod. B
System
Logs
dmesg
at step 5 (working): http://0x0.st/HJDN.txtdmesg
at step 6 (broken): http://0x0.st/HJDK.txtAdditional context
I dumped the devicetree base between step 5 and step 6. A diff quickly unveils the culprit:
Not only the interrupt-related properties are missing from step 6, but the
phandle
addresses are also not consistent across the whole tree.As a side note, I'm under the impression that this was working on 6.6.0-rc2. I noticed this problem when I updated the kernel to rc-6 recently.
The text was updated successfully, but these errors were encountered: