[PATCH v5 2/2] phy: qcom-snps-femto-v2: Add support for SA8255P
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Fri Nov 20 06:11:24 PST 2026
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 at 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
More information about the linux-phy
mailing list