From: "Pandey, Radhey Shyam" <radheys@amd.com>
To: Jay Buddhabhatti <jay.buddhabhatti@amd.com>, michal.simek@amd.com
Cc: linux-arm-kernel@lists.infradead.org, git@amd.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firmware: xilinx: Request pre-allocated peripheral nodes after bulk release
Date: Tue, 13 Oct 2026 17:04:04 +0530 [thread overview]
Message-ID: <cdf3f87d-0575-436a-9bdd-5fc3053f21c1@amd.com> (raw)
In-Reply-To: <20260923100343.3147243-1-jay.buddhabhatti@amd.com>
On 9/23/2026 3:33 PM, Jay Buddhabhatti wrote:
> During a kexec restart, zynqmp_clear_pm_state() releases all peripheral
> devices via PM_DEV_ALL_PERIPH. Pre-allocated nodes are then left released,
> so Linux no longer owns them and later peripheral access can fail.
>
> Immediately re-request those nodes with zynqmp_pm_request_node(
> PM_DEV_ALL_PERIPH, ...) so Linux retains ownership. On a graceful kexec
> this runs from zynqmp_firmware_shutdown(). On a crash kernel restart it
> runs from zynqmp_firmware_probe() in the reloaded kernel.
>
> The bulk request depends on firmware support for PM_DEV_ALL_PERIPH
> (PM_REQUEST_NODE feature check version >= PM_API_VERSION_3). On firmware
> that does not implement it, the request is skipped and a warning is
> logged. Errors are already logged inside zynqmp_clear_pm_state() and
> zynqmp_firmware_probe() does not abort if the request fails.
>
> Also, drop the redundant ret = 0 assignments whose value is overwritten
> by the next do_feature_check_call()
>
> Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Thanks!
> ---
> drivers/firmware/xilinx/zynqmp.c | 15 +++++++++++++--
> 1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
> index fe650747ac91..96dbb23eb673 100644
> --- a/drivers/firmware/xilinx/zynqmp.c
> +++ b/drivers/firmware/xilinx/zynqmp.c
> @@ -2193,7 +2193,6 @@ static int zynqmp_clear_pm_state(struct device *dev)
> "Failed to clear EL3 PM subsystem state: %d\n", ret);
> } else {
> dev_warn(dev, "TF_A_CLEAR_PM_STATE is not supported by EL3 firmware: %d\n", ret);
> - ret = 0;
> }
>
> /* Check if the firmware supports the PM_DEV_ALL_PERIPH node ID */
> @@ -2206,7 +2205,19 @@ static int zynqmp_clear_pm_state(struct device *dev)
> } else {
> dev_warn(dev,
> "Bulk device release is not supported by firmware: %d\n", ret);
> - ret = 0;
> + }
> +
> + /* Check if the firmware supports the PM_DEV_ALL_PERIPH node ID */
> + ret = do_feature_check_call(PM_REQUEST_NODE);
> + if (ret >= 0 && ((ret & FIRMWARE_VERSION_MASK) >= PM_API_VERSION_3)) {
> + /* Attempt to request all nodes via firmware */
> + ret = zynqmp_pm_request_node(PM_DEV_ALL_PERIPH, 0, 0, 0);
> + if (ret)
> + dev_err(dev, "Failed to request all peripheral devices: %d\n", ret);
> + } else {
> + dev_warn(dev,
> + "Firmware doesn't support request all peripheral devices at once: %d\n",
> + ret);
> }
>
> /* Check if the firmware supports the PM_ALL_NOTIFIERS node ID */
prev parent reply other threads:[~2026-10-13 11:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 10:03 Jay Buddhabhatti
2026-10-13 11:34 ` Pandey, Radhey Shyam [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=cdf3f87d-0575-436a-9bdd-5fc3053f21c1@amd.com \
--to=radheys@amd.com \
--cc=git@amd.com \
--cc=jay.buddhabhatti@amd.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
/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
all inboxes | Powered by JetHome®