* [PATCH 0/2] firmware: xilinx: Feature check improvements
@ 2026-07-24 9:53 Jay Buddhabhatti
2026-07-24 9:53 ` [PATCH 1/2] firmware: xilinx: Use TF-A feature check for TF-A-specific APIs Jay Buddhabhatti
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jay Buddhabhatti @ 2026-07-24 9:53 UTC (permalink / raw)
To: michal.simek
Cc: linux-arm-kernel, linux-kernel, ptsm, radhey.shyam.pandey,
Jay Buddhabhatti
This series contains two independent improvements to the feature check
logic in the Xilinx firmware driver:
1. Use the TF-A dedicated PM_API_FEATURES mechanism to validate
TF-A-specific APIs instead of routing them through PM_FEATURE_CHECK.
Falls back to the legacy PM_FEATURE_CHECK for backward
compatibility.
2. When do_fw_call() fails in the feature check path, propagate the
actual errno from zynqmp_pm_ret_code() instead of always returning
-EOPNOTSUPP.
These were previously part of the kexec cleanup series
([PATCH 0/4] firmware: xilinx: Clean up firmware and TF-A state on kexec)
as patch 4/4 but are split out as they are general improvements independent
of the kexec functionality.
Jay Buddhabhatti (2):
firmware: xilinx: Use TF-A feature check for TF-A-specific APIs
firmware: xilinx: Propagate actual error from feature check
drivers/firmware/xilinx/zynqmp.c | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] firmware: xilinx: Use TF-A feature check for TF-A-specific APIs
2026-07-24 9:53 [PATCH 0/2] firmware: xilinx: Feature check improvements Jay Buddhabhatti
@ 2026-07-24 9:53 ` Jay Buddhabhatti
2026-07-24 9:53 ` [PATCH 2/2] firmware: xilinx: Propagate actual error from feature check Jay Buddhabhatti
2026-08-06 13:18 ` [PATCH 0/2] firmware: xilinx: Feature check improvements Michal Simek
2 siblings, 0 replies; 4+ messages in thread
From: Jay Buddhabhatti @ 2026-07-24 9:53 UTC (permalink / raw)
To: michal.simek
Cc: linux-arm-kernel, linux-kernel, ptsm, radhey.shyam.pandey,
Jay Buddhabhatti
Currently, TF-A-specific APIs are validated using the firmware
PM_FEATURE_CHECK API, even though TF-A provides a dedicated mechanism
via PM_API_FEATURES API. Update the feature check logic for TF-A-specific
API calls to use PM_API_FEATURES. If this check fails, fall back to the
legacy PM_FEATURE_CHECK to support backward compatibility.
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Reviewed-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
---
drivers/firmware/xilinx/zynqmp.c | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index fc7212f554ee..95f5941c5ca8 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -224,28 +224,33 @@ static int __do_feature_check_call(const u32 api_id, u32 *ret_payload)
module_id = FIELD_GET(MODULE_ID_MASK, api_id);
/*
- * Feature check of APIs belonging to PM, XSEM, and TF-A are handled by calling
+ * Feature check of APIs belonging to PM and XSEM are handled by calling
* PM_FEATURE_CHECK API. For other modules, call PM_API_FEATURES API.
*/
- if (module_id == PM_MODULE_ID || module_id == XSEM_MODULE_ID || module_id == TF_A_MODULE_ID)
+ if (module_id == PM_MODULE_ID || module_id == XSEM_MODULE_ID)
feature_check_api_id = PM_FEATURE_CHECK;
else
feature_check_api_id = PM_API_FEATURES;
- /*
- * Feature check of TF-A APIs is done in the TF-A layer and it expects for
- * MODULE_ID_MASK bits of SMC's arg[0] to be the same as PM_MODULE_ID.
- */
- if (module_id == TF_A_MODULE_ID) {
- module_id = PM_MODULE_ID;
+ if (module_id == TF_A_MODULE_ID)
smc_arg[1] = api_id;
- } else {
+ else
smc_arg[1] = (api_id & API_ID_MASK);
- }
smc_arg[0] = PM_SIP_SVC | FIELD_PREP(MODULE_ID_MASK, module_id) | feature_check_api_id;
ret = do_fw_call(ret_payload, 2, smc_arg[0], smc_arg[1]);
+
+ /*
+ * For TF-A APIs, if the feature check with PM_API_FEATURES fails,
+ * retry with the legacy PM_FEATURE_CHECK for backward compatibility.
+ */
+ if (module_id == TF_A_MODULE_ID && ret) {
+ smc_arg[0] = PM_SIP_SVC | FIELD_PREP(MODULE_ID_MASK, PM_MODULE_ID) |
+ PM_FEATURE_CHECK;
+ ret = do_fw_call(ret_payload, 2, smc_arg[0], smc_arg[1]);
+ }
+
if (ret)
ret = -EOPNOTSUPP;
else
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] firmware: xilinx: Propagate actual error from feature check
2026-07-24 9:53 [PATCH 0/2] firmware: xilinx: Feature check improvements Jay Buddhabhatti
2026-07-24 9:53 ` [PATCH 1/2] firmware: xilinx: Use TF-A feature check for TF-A-specific APIs Jay Buddhabhatti
@ 2026-07-24 9:53 ` Jay Buddhabhatti
2026-08-06 13:18 ` [PATCH 0/2] firmware: xilinx: Feature check improvements Michal Simek
2 siblings, 0 replies; 4+ messages in thread
From: Jay Buddhabhatti @ 2026-07-24 9:53 UTC (permalink / raw)
To: michal.simek
Cc: linux-arm-kernel, linux-kernel, ptsm, radhey.shyam.pandey,
Jay Buddhabhatti
When do_fw_call() fails in __do_feature_check_call(), propagate the
actual errno from zynqmp_pm_ret_code() instead of always returning
-EOPNOTSUPP. This gives callers more precise error information. Existing
callers only test ret < 0 and are unchanged by this.
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Reviewed-by: Prasanna Kumar T S M <ptsm@linux.microsoft.com>
---
drivers/firmware/xilinx/zynqmp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index 95f5941c5ca8..0b6c20a1d8be 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -252,11 +252,9 @@ static int __do_feature_check_call(const u32 api_id, u32 *ret_payload)
}
if (ret)
- ret = -EOPNOTSUPP;
- else
- ret = ret_payload[1];
+ return ret;
- return ret;
+ return ret_payload[1];
}
static int do_feature_check_call(const u32 api_id)
--
2.34.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] firmware: xilinx: Feature check improvements
2026-07-24 9:53 [PATCH 0/2] firmware: xilinx: Feature check improvements Jay Buddhabhatti
2026-07-24 9:53 ` [PATCH 1/2] firmware: xilinx: Use TF-A feature check for TF-A-specific APIs Jay Buddhabhatti
2026-07-24 9:53 ` [PATCH 2/2] firmware: xilinx: Propagate actual error from feature check Jay Buddhabhatti
@ 2026-08-06 13:18 ` Michal Simek
2 siblings, 0 replies; 4+ messages in thread
From: Michal Simek @ 2026-08-06 13:18 UTC (permalink / raw)
To: Jay Buddhabhatti
Cc: linux-arm-kernel, linux-kernel, ptsm, radhey.shyam.pandey
On 7/24/26 11:53, Jay Buddhabhatti wrote:
> This series contains two independent improvements to the feature check
> logic in the Xilinx firmware driver:
>
> 1. Use the TF-A dedicated PM_API_FEATURES mechanism to validate
> TF-A-specific APIs instead of routing them through PM_FEATURE_CHECK.
> Falls back to the legacy PM_FEATURE_CHECK for backward
> compatibility.
>
> 2. When do_fw_call() fails in the feature check path, propagate the
> actual errno from zynqmp_pm_ret_code() instead of always returning
> -EOPNOTSUPP.
>
> These were previously part of the kexec cleanup series
> ([PATCH 0/4] firmware: xilinx: Clean up firmware and TF-A state on kexec)
> as patch 4/4 but are split out as they are general improvements independent
> of the kexec functionality.
>
> Jay Buddhabhatti (2):
> firmware: xilinx: Use TF-A feature check for TF-A-specific APIs
> firmware: xilinx: Propagate actual error from feature check
>
> drivers/firmware/xilinx/zynqmp.c | 31 +++++++++++++++++--------------
> 1 file changed, 17 insertions(+), 14 deletions(-)
>
applied.
M
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-06 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-24 9:53 [PATCH 0/2] firmware: xilinx: Feature check improvements Jay Buddhabhatti
2026-07-24 9:53 ` [PATCH 1/2] firmware: xilinx: Use TF-A feature check for TF-A-specific APIs Jay Buddhabhatti
2026-07-24 9:53 ` [PATCH 2/2] firmware: xilinx: Propagate actual error from feature check Jay Buddhabhatti
2026-08-06 13:18 ` [PATCH 0/2] firmware: xilinx: Feature check improvements Michal Simek
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®