From: sashiko-bot@kernel.org
To: "Changhuang Liang" <changhuang.liang@starfivetech.com>
Cc: linux-hwmon@vger.kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v3 2/6] peci: controller: Add StarFive JHB100 PECI driver
Date: Thu, 08 Oct 2026 11:52:12 +0000 [thread overview]
Message-ID: <sashiko-outbox-164111@kernel.org> (raw)
In-Reply-To: <20261008100623.7085-3-changhuang.liang@starfivetech.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] peci: missing hardware abort/reset on transfer timeout causes spurious completion
--
commit 362c32d18ca6b1082855225b6845fe8810b06db0
Author: Changhuang Liang <changhuang.liang@starfivetech.com>
peci: controller: Add StarFive JHB100 PECI driver
This commit adds the PECI controller driver for the StarFive JHB100 SoC,
providing PECI protocol communication support for CPU thermal management.
> diff --git a/drivers/peci/controller/peci-starfive.c b/drivers/peci/controller/peci-starfive.c
> new file mode 100644
> index 0000000000000..93aca2413f5ca
> --- /dev/null
> +++ b/drivers/peci/controller/peci-starfive.c
[ ... ]
> +static int starfive_peci_xfer(struct peci_controller *controller,
> + u8 addr, struct peci_request *req)
> +{
[ ... ]
> + priv->status = 0;
> +
> + regmap_write_bits(priv->regmap, STARFIVE_PECI_CTRL,
> + STARFIVE_PECI_CTRL_START, STARFIVE_PECI_CTRL_START);
> +
> + spin_unlock_irq(&priv->lock);
[Severity: High]
Does initiating a new transfer here require clearing the interrupt status
first?
If a previous transaction timed out, the hardware might eventually finish
and set STARFIVE_PECI_STS_XFER_DONE in STARFIVE_PECI_INT_STS, leaving an
interrupt pending. When spin_unlock_irq() executes, the delayed IRQ
handler could fire immediately.
Since the handler reads the stale XFER_DONE bit and calls
complete(&priv->xfer_complete), could this falsely complete the new
transfer prematurely and read in-progress or garbage hardware FIFO data?
> +
> + ret = wait_for_completion_interruptible_timeout(&priv->xfer_complete,
> + timeout);
> + if (ret < 0)
> + return ret;
> +
> + if (ret == 0) {
> + dev_dbg(priv->dev, "Timeout waiting for a response\n");
> + return -ETIMEDOUT;
> + }
[Severity: High]
Should the hardware be reset or the pending interrupts cleared when this
transfer times out or is interrupted?
When wait_for_completion_interruptible_timeout() returns 0 or a negative
error code, starfive_peci_xfer() bails out early without aborting the
active transaction in the controller.
This leaves the hardware executing and capable of asserting the IRQ line
later, potentially desynchronizing the protocol state for the next transfer.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261008100623.7085-1-changhuang.liang@starfivetech.com?part=2
next prev parent reply other threads:[~2026-10-08 11:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-08 10:06 [PATCH v3 0/6] Add StarFive JHB100 PECI support Changhuang Liang
2026-10-08 10:06 ` [PATCH v3 1/6] dt-bindings: peci: Add StarFive JHB100 PECI controller Changhuang Liang
2026-10-08 11:45 ` sashiko-bot
2026-10-08 10:06 ` [PATCH v3 2/6] peci: controller: Add StarFive JHB100 PECI driver Changhuang Liang
2026-10-08 11:52 ` sashiko-bot [this message]
2026-10-08 10:06 ` [PATCH v3 3/6] peci: Add support for PECI CC 0x83 retry condition Changhuang Liang
2026-10-08 11:51 ` sashiko-bot
2026-10-08 10:06 ` [PATCH v3 4/6] peci: cpu: Add Intel Granite Rapids support Changhuang Liang
2026-10-08 11:49 ` sashiko-bot
2026-10-08 10:06 ` [PATCH v3 5/6] hwmon: (peci/cputemp) Add support for Granite Rapids (GNR) Changhuang Liang
2026-10-08 11:48 ` sashiko-bot
2026-10-08 10:06 ` [PATCH v3 6/6] hwmon: (peci/dimmtemp) " Changhuang Liang
2026-10-08 11:48 ` 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-164111@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=changhuang.liang@starfivetech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-hwmon@vger.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