Skip to content
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

FS#4187 - mediatek,mt7621-gpio driver register conflict irq number #9167

Open
openwrt-bot opened this issue Dec 15, 2021 · 0 comments
Open
Labels
flyspray kernel pull request/issue with Linux kernel related changes release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release

Comments

@openwrt-bot
Copy link

aodzip:

This bug was test on a custom MT7621 board, but I think ubnt,edgerouter-x-sfp also affected.

when we have a node in DT with interrupt-parent = <&gpio> will trigger the bug.
My board:

expender0: pcf8574a@38 {
compatible = "nxp,pcf8574a";
reg = <0x38>;
interrupt-parent = <&gpio>;
interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
gpio-controller;
#gpio-cells = <2>;
interrupt-controller;
#interrupt-cells = <2>;
};

ubnt,edgerouter-x-sfp:

expander0: pca9555@25 {
compatible = "nxp,pca9555";
interrupt-parent = <&gpio>;
interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
gpio-controller;
#gpio-cells = <2>;
reg = <0x25>;
};

This bug will cause the sfp driver can't detect module insert.

In gpio-mt7621.c:245 every bank's parent is the driver itself, and direct call devm_gpiochip_add_data in :279.

This lead to an unexpected behavior: all three banks register IRQ 0~31 to kernel.
And the DT will always fetch the latest bank (bank2) as IRQ sink.
This can confirm by:

  1. setting interrupt = <32 0>; kernel will report too large IRQ.
  2. some additional printk in kernel
  3. an ugly workaround
@aparcar aparcar added release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release kernel pull request/issue with Linux kernel related changes labels Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray kernel pull request/issue with Linux kernel related changes release/21.02 pull request/issue targeted (also) for OpenWrt 21.02 release
Projects
None yet
Development

No branches or pull requests

2 participants