Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Dinh Nguyen" <dinguyen@kernel.org>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/3] arm64: dts: agilex5: define the i2c0 pins for pinctrl
Date: Thu, 29 Oct 2026 21:50:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-190019@kernel.org> (raw)
In-Reply-To: <20261029213201.718625-2-dinguyen@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arm64: dts: agilex5: missing scl-gpios and sda-gpios on i2c0 prevents recovery
--

commit 4fe1ecb21c260e09211a4f5ec837b9b80b38c36d
Author: Dinh Nguyen <dinguyen@kernel.org>

arm64: dts: agilex5: define the i2c0 pins for pinctrl

This commit adds pinctrl definitions for i2c0 default and gpio states on the
Agilex5 SoCDK NAND daughter card to support I2C bus recovery.

> diff --git a/arch/arm64/boot/dts/altera/socfpga_agilex5_socdk_nand.dts b/arch/arm64/boot/dts/altera/socfpga_agilex5_socdk_nand.dts
> index 81443096cf991..346a4ee22f95b 100644
> --- a/arch/arm64/boot/dts/altera/socfpga_agilex5_socdk_nand.dts
> +++ b/arch/arm64/boot/dts/altera/socfpga_agilex5_socdk_nand.dts
> @@ -39,6 +39,22 @@ memory@80000000 {
>  	};
>  };
>  
> +&pinctrl0 {
> +	i2c0_pmx_func: i2c0-pmx-func-pins {
> +		pinctrl-single,pins = <
> +			0x10   0x4   /* I2C0_SDA (IOA4) PIN4SEL) */
> +			0x14   0x4   /* I2C0_SCL (IOA5) PIN5SEL */
> +		>;
> +	};
> +
> +	i2c0_pmx_func_gpio: i2c0-pmx-func-gpio-pins {
> +		pinctrl-single,pins = <
> +			0x10   0x8   /* I2C0_SDA (IOA4) PIN4SEL) */
> +			0x14   0x8   /* I2C0_SCL (IOA5) PIN5SEL */
> +		>;
> +	};
> +};
> +
>  &gmac0 {
>  	status = "okay";
>  	phy-mode = "rgmii"; /* TX/RX clock delays provided by Agilex5 I/O hardware */
> @@ -66,6 +82,10 @@ &gpio1 {
>  
>  &i2c0 {
>  	status = "okay";
> +
> +	pinctrl-names = "default", "gpio";
> +	pinctrl-0 = <&i2c0_pmx_func>;
> +	pinctrl-1 = <&i2c0_pmx_func_gpio>;
>  };

[Severity: Medium]
Does i2c0 also need scl-gpios and sda-gpios properties for I2C recovery to
work?

When probing i2c0, i2c_dw_probe_master() calls i2c_dw_init_recovery_info() in
drivers/i2c/busses/i2c-designware-master.c:

	gpio = devm_gpiod_get_optional(dev->dev, "scl", GPIOD_OUT_HIGH);
	if (IS_ERR_OR_NULL(gpio))
		return PTR_ERR_OR_ZERO(gpio);

	rinfo->scl_gpiod = gpio;

Without scl-gpios in the i2c0 node, devm_gpiod_get_optional() returns NULL and
i2c_dw_init_recovery_info() returns early before calling devm_pinctrl_get() or
populating adap->bus_recovery_info.

Consequently, i2c_init_recovery() in drivers/i2c/i2c-core-base.c sees
adap->bus_recovery_info as NULL and skips i2c_gpio_init_recovery(), leaving
the gpio pinctrl state unused and bus recovery disabled.

In arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts, the pinctrl states
are paired with the GPIO descriptors:

	pinctrl-names = "default", "gpio";
	pinctrl-0 = <&i2c1_pmx_func>;
	pinctrl-1 = <&i2c1_pmx_func_gpio>;

	scl-gpios = <&portb 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
	sda-gpios = <&portb 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;

Should i2c0 here also specify scl-gpios and sda-gpios (for example on &porta 5
and &porta 4 for IOA5 and IOA4)?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261029213201.718625-1-dinguyen@kernel.org?part=2

  reply	other threads:[~2026-10-29 21:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29 21:31 [PATCH 1/3] arm64: dts: socfpga: agilex5: add the pinctrl node Dinh Nguyen
2026-10-29 21:32 ` [PATCH 2/3] arm64: dts: agilex5: define the i2c0 pins for pinctrl Dinh Nguyen
2026-10-29 21:50   ` sashiko-bot [this message]
2026-10-29 21:32 ` [PATCH 3/3] arm64: dts: stratix10: define the i2c1 " Dinh Nguyen
2026-10-29 22:02   ` sashiko-bot

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=sashiko-outbox-190019@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dinguyen@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox