From: sashiko-bot@kernel.org
To: "Jorijn van der Graaf" <jorijnvdgraaf@catcrafts.net>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v4 4/6] nfc: s3fwrn5: enable the PVDD supply
Date: Sat, 08 Aug 2026 02:24:21 +0000 [thread overview]
Message-ID: <20260808022421.896231F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260807021001.239389-5-jorijnvdgraaf@catcrafts.net>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] The NCI device is registered and exposed to userspace before its IRQ handler is requested, creating a race condition.
--
--- Patch [4]: [PATCH v4 4/6] nfc: s3fwrn5: enable the PVDD supply ---
commit 3e46e47e27236d4ca640efa94f0c2940f401ccd7
Author: Jorijn van der Graaf <jorijnvdgraaf@catcrafts.net>
nfc: s3fwrn5: enable the PVDD supply
This commit retrieves and enables the PVDD supply in the I2C PHY probe
function. This ensures the controller is powered before any of its pins
are driven or its clock is started.
> diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
> index c528c085b43ef..f93d8b47b65e3 100644
> --- a/drivers/nfc/s3fwrn5/i2c.c
> +++ b/drivers/nfc/s3fwrn5/i2c.c
[ ... ]
> @@ -158,6 +159,11 @@ static int s3fwrn5_i2c_probe(struct i2c_client *client)
> phy->i2c_dev = client;
> i2c_set_clientdata(client, phy);
>
> + ret = devm_regulator_get_enable(&client->dev, "pvdd");
> + if (ret)
> + return dev_err_probe(&client->dev, ret,
> + "failed to enable pvdd\n");
> +
[Severity: High]
This isn't a bug introduced by this patch, but does this function expose
the device to userspace before the IRQ handler is set up?
Looking further down in s3fwrn5_i2c_probe():
ret = s3fwrn5_probe(&phy->common.ndev, phy, &phy->i2c_dev->dev,
&i2c_phy_ops, variant);
if (ret < 0)
return ret;
ret = devm_request_threaded_irq(&client->dev, phy->i2c_dev->irq, NULL,
s3fwrn5_i2c_irq_thread_fn, IRQF_ONESHOT,
"s3fwrn5_i2c", phy);
If userspace (like udev or neard) immediately opens the NCI device and
starts sending commands after s3fwrn5_probe() returns, can the hardware
generate an interrupt that is missed because devm_request_threaded_irq()
has not been called yet?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260807021001.239389-1-jorijnvdgraaf@catcrafts.net?part=4
next prev parent reply other threads:[~2026-08-08 2:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 2:09 [PATCH v4 0/6] nfc: s3fwrn5: support the S3NRN4V variant Jorijn van der Graaf
2026-08-07 2:09 ` [PATCH v4 1/6] nfc: s3fwrn5: drop of_match_ptr() from the I2C driver Jorijn van der Graaf
2026-08-07 2:09 ` [PATCH v4 2/6] nfc: s3fwrn5: use the "s3fwrn5_i2c" string literal directly Jorijn van der Graaf
2026-08-08 2:24 ` sashiko-bot
2026-08-07 2:09 ` [PATCH v4 3/6] dt-bindings: net: nfc: samsung,s3fwrn5: add the S3NRN4V Jorijn van der Graaf
2026-08-07 2:09 ` [PATCH v4 4/6] nfc: s3fwrn5: enable the PVDD supply Jorijn van der Graaf
2026-08-08 2:24 ` sashiko-bot [this message]
2026-08-07 2:10 ` [PATCH v4 5/6] nfc: s3fwrn5: support the S3NRN4V variant Jorijn van der Graaf
2026-08-08 2:24 ` sashiko-bot
2026-08-07 2:10 ` [PATCH v4 6/6] arm64: dts: qcom: milos-fairphone-fp6: Add NFC Jorijn van der Graaf
2026-08-08 2:24 ` 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=20260808022421.896231F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jorijnvdgraaf@catcrafts.net \
--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