All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chen-Yu Tsai" <wenst@chromium.org>
Cc: devicetree@vger.kernel.org, robh@kernel.org,
	linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
	conor+dt@kernel.org
Subject: Re: [PATCH v6 4/8] i2c: of-prober: skip post-power-on delay if powered on sufficiently long
Date: Tue, 01 Sep 2026 08:02:08 +0000	[thread overview]
Message-ID: <20260901080209.7381E1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260901074930.764550-5-wenst@chromium.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The i2c_of_probe_simple_get_supply function fails the probe if the regulator is not found in the device tree, contradicting its stated intent to treat missing regulators as optional.
--

commit c0491b6ceb5b608dbfb97b1a7a7116f271999495
Author: Chen-Yu Tsai <wenst@chromium.org>

i2c: of-prober: skip post-power-on delay if powered on sufficiently long

This patch switches the I2C of-prober to use the new 
regulator_enable_and_wait() function to handle post-power-on delays. This
avoids unnecessary boot time penalties on devices where the power rail is
always-on or initialized by the bootloader.

> diff --git a/drivers/i2c/i2c-core-of-prober.c b/drivers/i2c/i2c-core-of-prober.c
> index 6a82b03809d4f..f9f3c0ef93ff5 100644
> --- a/drivers/i2c/i2c-core-of-prober.c
> +++ b/drivers/i2c/i2c-core-of-prober.c

[ ... ]

> @@ -226,13 +227,11 @@ static int i2c_of_probe_simple_enable_regulator(struct device *dev, struct i2c_o
>  
>  	dev_dbg(dev, "Enabling regulator supply \"%s\"\n", ctx->opts->supply_name);
>  
> -	ret = regulator_enable(ctx->supply);
> +	ret = regulator_enable_and_wait(ctx->supply,
> +					ctx->opts->post_power_on_delay_ms * USEC_PER_MSEC);
>  	if (ret)
>  		return ret;
>  
> -	if (ctx->opts->post_power_on_delay_ms)
> -		msleep(ctx->opts->post_power_on_delay_ms);
> -
>  	return 0;
>  }

[Severity: High]
This is a pre-existing issue, but I noticed something related to the regulator
handling in i2c_of_probe_simple_get_supply().

Does this code incorrectly fail the probe when a regulator is missing?

In i2c_of_probe_simple_get_supply(), we call of_regulator_get_optional():

	supply = of_regulator_get_optional(dev, node, supply_name);
	if (IS_ERR(supply)) {
		return dev_err_probe(dev, PTR_ERR(supply),
				     "Failed to get regulator supply \"%s\" from %pOF\n",
				     supply_name, node);
	}

Since of_regulator_get_optional() returns -ENODEV when the supply is not found
in the device tree, does this IS_ERR() check cause a fatal initialization
failure for valid hardware configurations where the supply is always-on or
not modeled?

Could this contradict the stated intent of treating missing regulators as
optional?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260901074930.764550-1-wenst@chromium.org?part=4

  reply	other threads:[~2026-09-01  8:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01  7:49 [PATCH v6 0/8] arm64: mediatek: Chromebook trackpad supply fixes Chen-Yu Tsai
2026-09-01  7:49 ` [PATCH v6 1/8] regulator: core: Add "enable and wait" functions Chen-Yu Tsai
2026-09-01  8:03   ` sashiko-bot
2026-09-01  7:49 ` [PATCH v6 2/8] Input: elan_i2c - Wait for initialization after enabling regulator supply Chen-Yu Tsai
2026-09-01  7:49 ` [PATCH v6 3/8] HID: i2c-hid-of: skip post-power-on delay if powered on sufficiently long Chen-Yu Tsai
2026-09-01  8:01   ` sashiko-bot
2026-09-01  7:49 ` [PATCH v6 4/8] i2c: of-prober: " Chen-Yu Tsai
2026-09-01  8:02   ` sashiko-bot [this message]
2026-09-01  7:49 ` [PATCH v6 5/8] i2c: of-prober: Let cleanup op know if a device was found Chen-Yu Tsai
2026-09-01  7:49 ` [PATCH v6 6/8] i2c: of-prober: Defer regulator_disable() on successful probe in simple helper Chen-Yu Tsai
2026-09-01  7:49 ` [PATCH v6 7/8] arm64: dts: mediatek: mt8173-elm-hana: Unmark trackpad supply as always-on Chen-Yu Tsai
2026-09-01  7:49 ` [PATCH v6 8/8] arm64: dts: mediatek: mt8192-asurada-spherion: Add Synaptics trackpad's supply Chen-Yu Tsai

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=20260901080209.7381E1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wenst@chromium.org \
    /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.