From: sashiko-bot@kernel.org
To: "Mikhail Kshevetskiy" <mikhail.kshevetskiy@iopsys.eu>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v8 31/35] pinctrl: airoha: add support of en7523 SoC
Date: Mon, 27 Jul 2026 18:15:06 +0000 [thread overview]
Message-ID: <20260727181506.AF62F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260727174141.664933-32-mikhail.kshevetskiy@iopsys.eu>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [High] Missing pinconf mappings for dedicated interface pins (2-9) and incorrect register mappings for PCIe reset pins (40-41).
Pre-existing issues:
- [High] The IRQ handler remains active after the GPIO chip is removed, leading to a Use-After-Free of `gc->irq.domain`.
--
--- Patch [31]: [PATCH v8 31/35] pinctrl: airoha: add support of en7523 SoC ---
commit e474b38e912b2b107b5f734fda40d3805c427084
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
pinctrl: airoha: add support of en7523 SoC
This patch adds support of Airoha en7523 SoC pin controller.
> diff --git a/drivers/pinctrl/airoha/pinctrl-en7523.c b/drivers/pinctrl/airoha/pinctrl-en7523.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/pinctrl/airoha/pinctrl-en7523.c
[ ... ]
> +#define REG_I2C_SDA_PU 0x0044
> +#define SPI_MISO_PU_MASK BIT(13)
> +#define SPI_MOSI_PU_MASK BIT(12)
> +#define SPI_CLK_PU_MASK BIT(11)
> +#define SPI_CS0_PU_MASK BIT(10)
> +#define PCIE1_RESET_PU_MASK BIT(9)
> +#define PCIE0_RESET_PU_MASK BIT(8)
> +#define UART1_RXD_PU_MASK BIT(3)
> +#define UART1_TXD_PU_MASK BIT(2)
> +#define I2C_SCL_PU_MASK BIT(1)
> +#define I2C_SDA_PU_MASK BIT(0)
[ ... ]
> +static const struct airoha_pinctrl_conf pinctrl_pullup_conf[] = {
> + PINCTRL_CONF_DESC(12, REG_GPIO_L_PU, BIT(0)),
> + PINCTRL_CONF_DESC(13, REG_GPIO_L_PU, BIT(1)),
[ ... ]
> + PINCTRL_CONF_DESC(39, REG_GPIO_L_PU, BIT(27)),
> + PINCTRL_CONF_DESC(40, REG_GPIO_L_PU, BIT(28)),
> + PINCTRL_CONF_DESC(41, REG_GPIO_L_PU, BIT(29)),
> +};
[Severity: High]
Are the pinconf mappings for pins 2 through 9 missing from this array?
The pinctrl_pullup_conf array (as well as the pulldown and drive arrays)
starts at pin 12, which seems to omit the electrical configuration for the
I2C, SPI, and UART pins defined earlier. If a device tree attempts to
configure pull-up/pull-down or drive strength for these buses, will it fail?
Also, are pins 40 and 41 (pcie_reset0 and pcie_reset1) mapped to the wrong
register here? They are currently mapped to REG_GPIO_L_PU bits 28 and 29,
but the macro definitions above show PCIE0_RESET_PU_MASK and
PCIE1_RESET_PU_MASK belonging to REG_I2C_SDA_PU instead. Will configuring
the PCIe reset pins silently corrupt the GPIO pad configuration bits?
> drivers/pinctrl/airoha/pinctrl-airoha.c:airoha_pinctrl_add_gpiochip()
>
> err = devm_request_irq(dev, irq, airoha_irq_handler, IRQF_SHARED,
> dev_name(dev), pinctrl);
> if (err) {
> dev_err(dev, "error requesting irq %d: %d\n", irq, err);
> return err;
> }
>
> return devm_gpiochip_add_data(dev, gc, pinctrl);
[Severity: High]
This isn't a bug introduced by this patch, but does the devres registration
order in airoha_pinctrl_add_gpiochip() create a use-after-free risk during
teardown?
If devm_gpiochip_add_data() fails, or when the driver is unbound, devres
unwinds in reverse order. This means devm_gpiochip_add_data() is cleaned
up first, which destroys gc->irq.domain.
Since devm_request_irq() was called earlier, the shared IRQ handler
remains registered after the domain is destroyed. If a shared interrupt
fires before the IRQ is finally freed, will airoha_irq_handler() execute
and access the freed girq->domain via generic_handle_domain_irq()?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260727174141.664933-1-mikhail.kshevetskiy@iopsys.eu?part=31
next prev parent reply other threads:[~2026-07-27 18:15 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 17:41 [PATCH v8 00/35] pinctrl: airoha: split on shared and SoC drivers, add more SoCs Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 01/35] dt-bindings: pinctrl: airoha: en7581: fix misprint in i2s function name Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 02/35] dt-bindings: pinctrl: airoha: en7581: fix pwm pin-groups Mikhail Kshevetskiy
2026-07-27 17:53 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 03/35] dt-bindings: pinctrl: airoha: an7583: fix device tree binding schema Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 04/35] pinctrl: airoha: fix mdio bitfield names Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 05/35] pinctrl: airoha: an7581: fix pinconf of i2c_scl/i2c_sda pins Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 06/35] pinctrl: airoha: an7583: fix I2C0_SDA_PD register bit order Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 07/35] pinctrl: airoha: an7583: there are no muxes to enable i2c buses Mikhail Kshevetskiy
2026-07-27 17:52 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 08/35] dt-bindings: pinctrl: airoha: an7583: remove i2c pin function Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 09/35] pinctrl: airoha: an7581: fix mux/conf of pcie_reset pins Mikhail Kshevetskiy
2026-07-27 17:55 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 10/35] dt-bindings: pinctrl: airoha: en7581: allow configuration of pcie_reset pins as gpio or pwm Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 11/35] pinctrl: airoha: an7583: fix muxing of non-gpio default pins Mikhail Kshevetskiy
2026-07-27 18:00 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 12/35] dt-bindings: pinctrl: airoha: an7583: allow configuration of non-gpio default pins as gpio and pwm Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 13/35] pinctrl: airoha: add missed get_direction() function for gpio_chip Mikhail Kshevetskiy
2026-07-27 18:04 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 14/35] pinctrl: airoha: add set_direction() helper " Mikhail Kshevetskiy
2026-07-27 18:09 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 15/35] pinctrl: airoha: fix getting gpiochip/pinctrl pointers in the IRQ handling code Mikhail Kshevetskiy
2026-07-27 17:56 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 16/35] pinctrl: airoha: fix IRQ mask/unmask code Mikhail Kshevetskiy
2026-07-27 18:15 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 17/35] pinctrl: airoha: add missed IRQ resource helpers Mikhail Kshevetskiy
2026-07-27 18:10 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 18/35] pinctrl: airoha: fix edge-triggered interrupts handling Mikhail Kshevetskiy
2026-07-27 18:03 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 19/35] pinctrl: airoha: remove not needed irq_type[] array Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 20/35] pinctrl: airoha: move common definitions to the separate header Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 21/35] pinctrl: airoha: split driver on shared code and SoC specific drivers Mikhail Kshevetskiy
2026-07-27 18:09 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 22/35] pinctrl: airoha: an7581: remove en7581 prefix from variable names Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 23/35] pinctrl: airoha: an7583: remove an7583 prefix from variable names and definitions Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 24/35] pinctrl: airoha: an7583: rename registers to match its an7583 names Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 25/35] pinctrl: airoha: an7583: add support for npu_uart pinmux Mikhail Kshevetskiy
2026-07-27 18:07 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 26/35] dt-bindings: pinctrl: airoha: an7583: add npu_uart pin group Mikhail Kshevetskiy
2026-07-27 17:41 ` [PATCH v8 27/35] pinctrl: airoha: an7583: add support for pon_alt pinmux Mikhail Kshevetskiy
2026-07-27 18:10 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 28/35] dt-bindings: pinctrl: airoha: an7583: add pon_alt pin group Mikhail Kshevetskiy
2026-07-27 20:14 ` Krzysztof Kozlowski
2026-07-27 17:41 ` [PATCH v8 29/35] pinctrl: airoha: an7583: add support for olt pinmux Mikhail Kshevetskiy
2026-07-27 18:11 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 30/35] dt-bindings: pinctrl: airoha: an7583: add olt function/group Mikhail Kshevetskiy
2026-07-27 20:15 ` Krzysztof Kozlowski
2026-07-27 17:41 ` [PATCH v8 31/35] pinctrl: airoha: add support of en7523 SoC Mikhail Kshevetskiy
2026-07-27 18:15 ` sashiko-bot [this message]
2026-07-27 17:41 ` [PATCH v8 32/35] pinctrl: airoha: try to find chip scu node by phandle first Mikhail Kshevetskiy
2026-07-27 18:11 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 33/35] dt-bindings: pinctrl: airoha: add support of en7523 pin controller Mikhail Kshevetskiy
2026-07-27 18:20 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 34/35] pinctrl: airoha: add support of an7563 SoC Mikhail Kshevetskiy
2026-07-27 18:16 ` sashiko-bot
2026-07-27 17:41 ` [PATCH v8 35/35] dt-bindings: pinctrl: airoha: add support of an7563 pin controller Mikhail Kshevetskiy
2026-07-27 20:12 ` [PATCH v8 00/35] pinctrl: airoha: split on shared and SoC drivers, add more SoCs Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260727181506.AF62F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=mikhail.kshevetskiy@iopsys.eu \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.