Thread (5 messages) 5 messages, 2 authors, 2025-02-05

RE: [PATCH 1/2] firmware: xilinx: Update the zynqmp_pm_load_pdi() API

flat view

From: Manne, Nava kishore <hidden>
Date: 2025-02-05 11:32:55
Also in: lkml

Hi Jie,

	Thanks for providing the review comments.
Please find my response inline.
-----Original Message-----
From: Jie Gan <redacted>
Sent: Friday, January 24, 2025 11:30 AM
To: Manne, Nava kishore <redacted>; Simek, Michal
[off-list ref]; Jain, Ronak [off-list ref];
gregkh@linuxfoundation.org; Buddhabhatti, Jay [off-list ref];
praveen.teja.kundanala@amd.com; Paladugu, Siva Durga Prasad
[off-list ref]; u.kleine-koenig@baylibre.com; linux-
arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] firmware: xilinx: Update the zynqmp_pm_load_pdi() API



On 1/23/2025 6:35 PM, Nava kishore Manne wrote:
quoted
Update the zynqmp_pm_load_pdi() API to handle the firmware error’s
properly.

Signed-off-by: Nava kishore Manne <redacted>
---
  drivers/firmware/xilinx/zynqmp.c | 12 ++++++++++--
  1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/xilinx/zynqmp.c
b/drivers/firmware/xilinx/zynqmp.c
index 720fa8b5d8e9..ea04a6ac402d 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1483,8 +1483,16 @@
EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement);
quoted
   */
  int zynqmp_pm_load_pdi(const u32 src, const u64 address)
  {
-	return zynqmp_pm_invoke_fn(PM_LOAD_PDI, NULL, 3, src,
lower_32_bits(address),
quoted
-				   upper_32_bits(address));
+	u32 ret_payload[PAYLOAD_ARG_CNT];
+	int ret;
+
+	ret = zynqmp_pm_invoke_fn(PM_LOAD_PDI, ret_payload, 3, src,
+				  lower_32_bits(address),
+				  upper_32_bits(address));
+	if (ret_payload[0])
+		return ret_payload[0];
Looks a little bit hacking. As the ret_payload is u32, return as int, it has possibility to
overflow?
I agree with your concern.
I'll drop this patch and look into a proper solution to address the issue.

Regards,
Navakishore
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help