From: sashiko-bot@kernel.org
To: "Svyatoslav Ryhel" <clamor95@gmail.com>
Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
mfd@lists.linux.dev, dri-devel@lists.freedesktop.org,
robh@kernel.org, conor+dt@kernel.org, lee@kernel.org
Subject: Re: [PATCH v3 4/4] mfd: aat2870: Add support for VIN and IN-LDO power supplies
Date: Tue, 13 Oct 2026 18:18:15 +0000 [thread overview]
Message-ID: <sashiko-outbox-170310@kernel.org> (raw)
In-Reply-To: <20261013180933.487013-5-clamor95@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] mfd: aat2870: Missing GPIO teardown causes backpowering risk
--
commit 878c16709c6ee44d1728f13a2ff6e9ad29023883
Author: Svyatoslav Ryhel <clamor95@gmail.com>
mfd: aat2870: Add support for VIN and IN-LDO power supplies
This commit adds support for retrieving and managing the VIN and IN-LDO
power supplies using the regulator framework to ensure proper power
supply dependencies and power-up sequencing.
> diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
> index 909c14ee60323..0bd430b90bc1b 100644
> --- a/drivers/mfd/aat2870-core.c
> +++ b/drivers/mfd/aat2870-core.c
[ ... ]
> @@ -309,6 +310,10 @@ static int aat2870_i2c_probe(struct i2c_client *client)
>
> aat2870->reg_cache = aat2870_regs;
>
> + ret = devm_regulator_get_enable(&client->dev, "vin");
> + if (ret)
> + return dev_err_probe(&client->dev, ret, "Failed to enable regulator\n");
> +
> aat2870->en_pin = devm_gpiod_get_optional(&client->dev, "enable",
> GPIOD_OUT_HIGH);
[Severity: High]
Does this unwinding order create a backpowering regression when the device
is removed?
Because the regulator is acquired before the GPIO, devres unwinds in reverse
order. It will release the GPIO descriptor first during device unbind (e.g.,
during parent I2C adapter removal), without actually driving the pin low.
After the GPIO descriptor is released, devm_regulator_get_enable() will
disable the vin regulator. This leaves the enable GPIO driven high into
the unpowered AAT2870 device.
Since aat2870_i2c_driver lacks a .remove callback to explicitly drive the
GPIO low before devres unwinds, could this backpowering state cause hardware
damage? Would it be safer to add a devm action or a .remove callback to pull
the enable pin low first?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013180933.487013-1-clamor95@gmail.com?part=4
prev parent reply other threads:[~2026-10-13 18:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 18:09 [PATCH v3 0/4] mfd: aat2870: Convert to use OF bindings Svyatoslav Ryhel
2026-10-13 18:09 ` [PATCH v3 1/4] dt-bindings: mfd: Document Skyworks AAT2870 Svyatoslav Ryhel
2026-10-13 18:16 ` sashiko-bot
2026-10-13 18:09 ` [PATCH v3 2/4] mfd: aat2870: Derive brightness steps from max current Svyatoslav Ryhel
2026-10-13 18:16 ` sashiko-bot
2026-10-13 18:09 ` [PATCH v3 3/4] mfd: aat2870: Convert to use OF bindings Svyatoslav Ryhel
2026-10-13 18:21 ` sashiko-bot
2026-10-13 18:09 ` [PATCH v3 4/4] mfd: aat2870: Add support for VIN and IN-LDO power supplies Svyatoslav Ryhel
2026-10-13 18:18 ` sashiko-bot [this message]
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-170310@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=clamor95@gmail.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=lee@kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=mfd@lists.linux.dev \
--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