From nobody Sun Jun 14 06:13:46 2026 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A4F914EC73 for ; Sat, 2 May 2026 21:52:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.217.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777758733; cv=pass; b=YttHnoZVJNySA5P/XDPjovyEtC3oeilVsb7x2l/+VK2n4TBAQ0kEvj2OP3rJerKXjbP/wtXBXnKPHKbcF9eDGK65qEEdX9GxapB0ciGbXiBa78bHTkDTokGtaEqIMeM/iS5owhZA/Zh3TIEmH/xfBlkdnlGeNI/00XF+v/G/K08= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777758733; c=relaxed/simple; bh=LqQtj6QggZSNGk9hzIxmtPC+2GmjdVQKRjPTyze2yP4=; h=MIME-Version:From:Date:Message-ID:Subject:To:Cc:Content-Type; b=p0gONPggdN1Iwauulk4bFTtO3ewpo2Q/Hj93n2mK/dKWthvuEQu5A9E9vq+b1ELQRnBmQxIR3e5OkfYUCC9B669RQSGKfJV6ezuU/fMaZyQ7KtTCmAJXEYkzNVGCjLhyUNYZU3a7GbAjMtavJDj2Hwhqa/btWUbaE0tvjQzqS8E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D/fYaeLq; arc=pass smtp.client-ip=209.85.217.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D/fYaeLq" Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-60fee2fa3b8so1061924137.2 for ; Sat, 02 May 2026 14:52:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777758731; cv=none; d=google.com; s=arc-20240605; b=M2+zT4hrrW65rKLg6teMdZ8Z3/uLJi4sLhJmOIzkIEu6mX8FUL1b6+b1TStpF8AtDH JoxfbYn/ojpLUuBI4W5frX9BuC34y4CUzgN31RI285UuakJr4tKLQsv2Lpomd7w4Z8jP B2pjtx23irrWeLvGrZVWbGiQJA9ii3y4InoMHH34LQ2NmCAHjL+TsF5qkWqNopQQcr5p Z8GATZR159XhRCT5ayf8yjHUFjHJRnPrcW159Itjl8BL0vbQrTJ52Hnv5OcK5Ad+/d2p PL4DJ5zfmIfoQ8I+224ThKxKLgES024MAFpfH1dUf6Xtuy5HO2XrqL15ZdNPdHX8lgyV jd6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:mime-version:dkim-signature; bh=sPZjd2zvcbyFlXlX1KLQTQuzLyVUuoHKA2p+mdP4d9c=; fh=FqshPlCLL2FIzKMK7iQU+FPzmX2DcH9bMHeJQiuyQjM=; b=h4UP1TeNbVpg3sUKf/3yxlVLCY2meZyEBJLDA4DMSwlXwAca3OF8Iei889A0dDYjJL cS0/72xO6OortIooF3JhMRLgK0U4C3H6hSamEVHbCiaqOGRij79l8RjeKIjd3X0vSshE b3pPs0DcbEUysciScm8uBqMQMZ7ILOtz+hebVL2RstQO+Ov9oF5rz/G6CizV2EnZPkIW XbuZKUsqd1YNdJd6p4rm34qLLFPUICnwY7cL+n8S+JNj8aAuWnnLo1a1Cpso+Jtm7mVD wQSDWUoAg7dtKU4f7OCsaRJ160pNWRtUn94Xi30VLmBm8KOExVgw2ezUW4ZRYzglu2Fn Fsjw==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777758731; x=1778363531; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=sPZjd2zvcbyFlXlX1KLQTQuzLyVUuoHKA2p+mdP4d9c=; b=D/fYaeLquJGFPvzpZLgHWsitLupWkUeKA0WG+Sev3zRPmWVBlyyIDkRR36Bn+99cQG vp6TxpUANP4j4t3u6kFIX8MCVdatWGx2GdHQmXj9Tzb7PFsq8+S3WaAbNoC5y+ECmJVG GEbON8OKpnDTHOcS/BGLh3rAMh++F5ty2VAivLcLntIsm47B79nJ9UljqxNlECEEqUeM tG9TCA7lSud0m6+FhI8kY0/zRYqmoSetRyRhzcW/iUweXVhd1aXXWwPoBJqvCcHNQu55 prBs09e7lCLQSXiHrm62Vc8gHayfLnh7Z7HnjK3Sc2P2FrTKS/4BqDsaOD/VUXDMMi1e hfug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777758731; x=1778363531; h=cc:to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=sPZjd2zvcbyFlXlX1KLQTQuzLyVUuoHKA2p+mdP4d9c=; b=acpJHQU5Bkk/S000H1kO66QGgt5EhhicHecdIkri0WsCBWdIENFpcgLUSi0marf9KI ctKghOoCDRbt2VXz7kIELkKkGHRqMsyWUFgBMxnPpwLGKS7NGAIRv5Uy8mp4p7QzSJK1 tWEvLflWLxgrePxYnKKrohX5myhHYBtZIxK+gvyHmYKzJrTp8XSkAKslx+r1aqUy3CUR CqxYs4ad4Wn7edlpChL6cgwRDocj0h5t7jCXDYLY28UIC8jMb9brXIo/tA/7lsm+u1yf M4LYkv9NaDmlD5dM9qdRlJj/dOh2sKYcRZOXhY4Hl7L3HB1QPaMMj00ucSXdFp9AByED rvag== X-Gm-Message-State: AOJu0YwVwNpS+2ehaZDohfALx/c7VgMJwmwC9Y4y8RkCYBEwEcNSqUHi DzFR1F++9AJEzXvnnfa+UuWziHeyVoDEDm+CjisGLsBBcFZbr/uO+2oQR3zdzEoVOHe8KyEbuAV D3wVHneYbmXUXyaB9Rf2MqSV3h50XlWw= X-Gm-Gg: AeBDiesXPg95sRQHybCoiAKyBSpuipV2dEP41Cx8nlU9XmYikMHVSNwubDfy9+nxZPe NGMZEf7U2y3lVN4LVvAbId8MjacvKjz425b2pkNdA14Wil+DATavCn18jZl36F0sPOuOZkVVCXJ p7HceOGo08lcGFf2wtBJDuUbOk/eZqNa2M/Ty1QXVroukDIxtVjaFP/7NeJ0ukMN/wxmqOrDr7z zWY7rZxolWkfcGLvp9osfly57OvgnvtVYfIzlaSD9JilUojPG1n07/eZUIkt9v8sscSJQqbjk5M zaGWS4JBFosHwnoFKUaMxyyuhTkEvnEUOHoyz+1pox6vYPnt X-Received: by 2002:a05:6102:4b07:b0:608:cdd9:21ad with SMTP id ada2fe7eead31-62d84a5e573mr2023470137.5.1777758731352; Sat, 02 May 2026 14:52:11 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vicente Bergas Date: Sat, 2 May 2026 23:52:00 +0200 X-Gm-Features: AVHnY4LyRBywdXlbR__5FvY6Hmd9edTzaPB4z2QZngbpCQrAUA62aIk0zb2Ffgk Message-ID: Subject: gpio-mt7621 unroutable IRQs to bank0 To: Linus Walleij , Sergio Paracuellos , Bartosz Golaszewski , Thomas Gleixner , Grant Likely , Anna-Maria Behnsen Cc: Linux Kernel Mailing List , linux-gpio@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Hi, Grant Likely noticed a potential issue and documented it as a comment in kernel/irq/irqdomain.c: * We might want to match the legacy controller last since * it might potentially be set to match all interrupts in * the absence of a device node. This isn't a problem so far * yet though... There is a bug that is affecting me and it is triggered by the forseen potential issue. drivers/gpio/gpio-mt7621.c is registering 96 GPIOs, all of them capable of generating IRQs. But the `struct irq_chip` can only handle 32 IRQs, so, 3 banks are instantiated. The DTS file specifies the interrupt for one device as interrupt-parent =3D <&gpio>; interrupts =3D <0 IRQ_TYPE_EDGE_FALLING>; which should be routed to Bank0 GPIO0 but it is instead routed to Bank2. This is the bug. The call trace that leads to the problem is: drivers/i2c/i2c-core-base.c:i2c_device_probe drivers/base/property.c:fwnode_irq_get drivers/of/irq.c:of_irq_get include/linux/irqdomain.h:irq_find_host include/linux/irqdomain.h:irq_find_matching_host include/linux/irqdomain.h:irq_find_matching_fwnode kernel/irq/irqdomain.c:irq_find_matching_fwspec As a way to prove that this is indeed the problem, the following workaround makes it work. It just inverts the sorting order of all matches, so it picks Bank0 instead of Bank2. --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c @@ -538,7 +538,6 @@ irq_find_matching_fwspec if (rc) { found =3D h; - break; } } mutex_unlock(&irq_domain_mutex); For a bit more context, the platform used is an mt7628an. The problematic device is: &i2c { pinctrl-names =3D "default"; pinctrl-0 =3D <&i2c_pins>; status =3D "okay"; ft6336u: touchscreen@38 { compatible =3D "focaltech,ft6236"; reg =3D <0x38>; interrupt-parent =3D <&gpio>; interrupts =3D <0 IRQ_TYPE_EDGE_FALLING>; reset-gpios =3D <&gpio 2 GPIO_ACTIVE_LOW>; }; }; Please, can you fix this bug? I'll will be able to test, but because my platform is only supported after applying openwrt patches, i can only test on v6.18.y. Regards, Vicente.