[FS#4187] mediatek,mt7621-gpio driver register conflict irq number (Attachment added)

OpenWrt Bugs openwrt-bugs at lists.openwrt.org
Wed Dec 15 03:37:40 PST 2021


A new Flyspray task has been opened.  Details are below. 

User who did this - Aodzip (aodzip) 

Attached to Project - OpenWrt/LEDE Project
Summary - mediatek,mt7621-gpio driver register conflict irq number
Task Type - Bug Report
Category - Kernel
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - High
Priority - Very Low
Reported Version - openwrt-21.02
Due in Version - Undecided
Due Date - Undecided
Details - 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 =  will trigger the bug.
My board:

	expender0: pcf8574a at 38 {
		compatible = "nxp,pcf8574a";
		reg = ;
		interrupt-parent = ;
		interrupts = ;
		#gpio-cells = ;
		#interrupt-cells = ;


	expander0: pca9555 at 25 {
		compatible = "nxp,pca9555";
		interrupt-parent = ;
		interrupts = ;
		#gpio-cells = ;
		reg = ;

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 = ; kernel will report too large IRQ.
   2. some additional printk in kernel
   3. an ugly workaround

One or more files have been attached.

More information can be found at the following URL:

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.

More information about the openwrt-bugs mailing list