Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Radhey Shyam Pandey" <radhey.shyam.pandey@amd.com>
Cc: neil.armstrong@linaro.org, olteanv@gmail.com,
	linux-phy@lists.infradead.org, vkoul@kernel.org
Subject: Re: [PATCH] phy: zynqmp: register PHY provider after probe initialization
Date: Fri, 07 Aug 2026 16:31:42 +0000	[thread overview]
Message-ID: <20260807163142.AB97A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260807162510.3681572-1-radhey.shyam.pandey@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Using asynchronous pm_runtime_put() immediately before pm_runtime_disable() on the new error path cancels the pending suspend, leaving the hardware in an active power state.
--

--- Patch [1]: [PATCH] phy: zynqmp: register PHY provider after probe initialization ---
commit d73f55f7c5982fd671a5ed442cce7f38caa3d78a
Author: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>

phy: zynqmp: register PHY provider after probe initialization

This commit moves the registration of the OF PHY provider to the end of
probe, after saved_regs allocation and runtime PM are successfully setup.
This prevents concurrent consumers from obtaining references to driver
state that could be freed if the probe failed later.

Link: https://lore.kernel.org/all/20260720155732.9DA581F000E9@smtp.kernel.org

> diff --git a/drivers/phy/xilinx/phy-zynqmp.c b/drivers/phy/xilinx/phy-zynqmp.c
> --- a/drivers/phy/xilinx/phy-zynqmp.c
> +++ b/drivers/phy/xilinx/phy-zynqmp.c
[ ... ]
> @@ -1082,6 +1075,14 @@ static int xpsgtr_probe(struct platform_device *pdev)
>  		return ret;
>  	}
>  
> +	provider = devm_of_phy_provider_register(&pdev->dev, xpsgtr_xlate);
> +	if (IS_ERR(provider)) {
> +		dev_err(&pdev->dev, "registering provider failed\n");
> +		pm_runtime_put(gtr_dev->dev);
> +		pm_runtime_disable(gtr_dev->dev);

[Severity: Medium]
Does this error path leave the device in an active power state?

Using pm_runtime_put() queues an asynchronous idle notification. Calling
pm_runtime_disable() immediately afterward cancels pending async suspend
work, leaving the hardware active.

Would it be better to use pm_runtime_put_sync() here to ensure the device
is synchronously suspended before disabling runtime PM?

> +		return PTR_ERR(provider);
> +	}
> +
>  	return 0;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260807162510.3681572-1-radhey.shyam.pandey@amd.com?part=1

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

      reply	other threads:[~2026-08-07 16:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 16:25 [PATCH] phy: zynqmp: register PHY provider after probe initialization Radhey Shyam Pandey
2026-08-07 16:31 ` 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=20260807163142.AB97A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=radhey.shyam.pandey@amd.com \
    --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