Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Pengpeng Hou" <pengpeng@iscas.ac.cn>
Cc: linux-phy@lists.infradead.org, olteanv@gmail.com,
	neil.armstrong@linaro.org, vkoul@kernel.org
Subject: Re: [PATCH] phy: starfive: jh7110-dphy: fail init when the PLL does not lock
Date: Wed, 24 Jun 2026 14:48:34 +0000	[thread overview]
Message-ID: <20260624144835.23B2F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260624143911.58472-1-pengpeng@iscas.ac.cn>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Failed PLL lock leaves the hardware out of reset, preventing clean initialization retries.
--

commit 2ff03101ec29d4c2e1b0317fa73877af8894c09e
Author: Pengpeng Hou <pengpeng@iscas.ac.cn>

phy: starfive: jh7110-dphy: fail init when the PLL does not lock
    
This commit updates stf_dphy_hw_reset() to return a timeout error instead
of just logging it when the PHY PLL fails to lock. It also propagates this
error up through the initialization and exit paths so the driver can properly
fail when the lock condition is not met.

> diff --git a/drivers/phy/starfive/phy-jh7110-dphy-tx.c b/drivers/phy/starfive/phy-jh7110-dphy-tx.c
> --- a/drivers/phy/starfive/phy-jh7110-dphy-tx.c
> +++ b/drivers/phy/starfive/phy-jh7110-dphy-tx.c

[ ... ]

> @@ -224,8 +224,12 @@ static void stf_dphy_hw_reset(struct stf_dphy *dphy, int assert)
>  					       !(FIELD_GET(STF_DPHY_RGS_CDTX_PLL_UNLOCK, status)),
>  					       STF_DPHY_HW_DELAY_US, STF_DPHY_HW_TIMEOUT_US);
>  		if (rc)
> -			dev_err(dphy->dev, "MIPI dphy-tx # PLL Locked\n");
> +			dev_err(dphy->dev, "MIPI dphy-tx PLL failed to lock\n");
> +
> +		return rc;
>  	}

[Severity: Medium]
When stf_dphy_hw_reset() is called with assert set to 1, it writes 1 to the
STF_DPHY_RESETB bit to bring the PHY out of reset. If the PLL lock times out,
the function now returns an error early without reverting the register to 0.

Since phy_init() fails, phy_exit() won't be called to clean up. Does this
leave the hardware permanently out of reset in a dirty state? If the hardware
requires a 0-to-1 reset transition to attempt locking again, will subsequent
initialization retries automatically fail because the hardware was never put
back into reset?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260624143911.58472-1-pengpeng@iscas.ac.cn?part=1

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

      reply	other threads:[~2026-06-24 14:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 14:39 [PATCH] phy: starfive: jh7110-dphy: fail init when the PLL does not lock Pengpeng Hou
2026-06-24 14:48 ` 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=20260624144835.23B2F1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=pengpeng@iscas.ac.cn \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox