Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mattijs Korpershoek" <mkorpershoek@kernel.org>
Cc: linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org, vkoul@kernel.org,
	neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v5 2/2] phy: qcom-snps-femto-v2: Add support for SA8255P
Date: Fri, 20 Nov 2026 14:11:24 +0000	[thread overview]
Message-ID: <sashiko-outbox-225334@kernel.org> (raw)
In-Reply-To: <20261120-phy-qcom-snps-femto-v2-8255-v5-2-86a9880ee5a5@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] phy: qcom-snps-femto-v2: use devm_pm_domain_attach_list() and
  check ret == 0
--

commit 40323ed83ee6f03c36d2767d1e91cd08ccff373b
Author: Sriram Dash <quic_sriramd@quicinc.com>

phy: qcom-snps-femto-v2: Add support for SA8255P

This commit adds support for the SA8255P USB HS PHY variant, whose power,
clock, and reset resources are managed by SCMI firmware through "core" and
"transfer" power domains.

> diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
> index 0dae8369671ab..0ec34bc5c26ec 100644
> --- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
> +++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c
[ ... ]
> @@ -164,8 +167,82 @@ struct qcom_snps_hsphy {
>  	bool phy_initialized;
>  	enum phy_mode mode;
>  	struct phy_override_seq update_seq_cfg[NUM_HSPHY_TUNING_PARAMS];
> +
> +	struct dev_pm_domain_list *pd_list;
>  };
>  
> +static void qcom_snps_domain_detach(void *data)
> +{
> +	struct qcom_snps_hsphy *hsphy = data;
> +
> +	dev_pm_domain_detach_list(hsphy->pd_list);
> +}
> +
> +static int qcom_snps_domain_attach(struct qcom_snps_hsphy *hsphy)
> +{
> +	struct dev_pm_domain_attach_data pd_data = {
> +		.pd_flags       = PD_FLAG_NO_DEV_LINK,
> +		.pd_names       = (const char*[]) { "core", "transfer" },
> +		.num_pd_names   = 2,
> +	};
> +	struct device *dev = hsphy->dev;
> +	int ret;
> +
> +	ret = dev_pm_domain_attach_list(dev, &pd_data, &hsphy->pd_list);
> +	if (ret < 0)
> +		return dev_err_probe(dev, ret, "domain attach failed\n");
> +
> +	return 0;
> +}
> +
> +static bool qcom_snps_is_fw_managed(struct qcom_snps_hsphy *hsphy)
> +{
> +	return hsphy->pd_list != NULL;
> +}
> +
> +static int qcom_snps_pds_enable_all(struct qcom_snps_hsphy *hsphy)
> +{
> +	int ret;
> +
> +	if (!qcom_snps_is_fw_managed(hsphy))
> +		return 0;

[Severity: Low]
Can qcom_snps_domain_attach() succeed with hsphy->pd_list left NULL when
dev_pm_domain_attach_list() returns 0 (for example, when CONFIG_PM is
disabled)?

If that happens, qcom_snps_pds_enable_all() returns 0 without enabling the
power domains, and qcom_snps_hsphy_fw_managed_init() proceeds to
qcom_snps_hsphy_configure() and writes PHY registers while clocks, resets,
and power domains are off.  Also, qcom_snps_domain_attach() and
qcom_snps_domain_detach() with devm_add_action_or_reset() in
qcom_snps_hsphy_probe() duplicate devm_pm_domain_attach_list(); calling
devm_pm_domain_attach_list() directly and returning -ENODEV when ret == 0
would avoid both issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-phy-qcom-snps-femto-v2-8255-v5-0-86a9880ee5a5@kernel.org?part=2

      reply	other threads:[~2026-11-20 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 13:56 [PATCH v5 0/2] Add support for SA8255P in the phy-qcom-snps-femto-v2 phy driver Mattijs Korpershoek
2026-11-20 13:56 ` [PATCH v5 1/2] dt-bindings: phy: Add sa8255p high-speed USB PHY Mattijs Korpershoek
2026-11-20 13:56 ` [PATCH v5 2/2] phy: qcom-snps-femto-v2: Add support for SA8255P Mattijs Korpershoek
2026-11-20 14:11   ` 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-225334@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=mkorpershoek@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=robh@kernel.org \
    --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