diff mbox series

ram: k3-ddrss: Handle error properly in lpddr4_start

Message ID 20240829083453.647044-1-u-kumar1@ti.com
State New
Delegated to: Tom Rini
Headers show
Series ram: k3-ddrss: Handle error properly in lpddr4_start | expand

Commit Message

Kumar, Udit Aug. 29, 2024, 8:34 a.m. UTC
In lpddr4_start function error returned by lpddr4_enablepiinitiator
may go undetected due to overwrite of return code.
Add support to handle error in above case.

Reported-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
---
 drivers/ram/k3-ddrss/lpddr4.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Bryan Brattlof Aug. 29, 2024, 12:21 p.m. UTC | #1
On August 29, 2024 thus sayeth Udit Kumar:
> In lpddr4_start function error returned by lpddr4_enablepiinitiator
> may go undetected due to overwrite of return code.
> Add support to handle error in above case.
> 
> Reported-by: Andreas Dannenberg <dannenberg@ti.com>
> Signed-off-by: Udit Kumar <u-kumar1@ti.com>

Reviewed-by: Bryan Brattlof <bb@ti.com>

One day I'll get around to cleaning this up. starting the controllers 
isn't all this complicated.  

~Bryan
diff mbox series

Patch

diff --git a/drivers/ram/k3-ddrss/lpddr4.c b/drivers/ram/k3-ddrss/lpddr4.c
index 11ef242a37..9f9abfeca4 100644
--- a/drivers/ram/k3-ddrss/lpddr4.c
+++ b/drivers/ram/k3-ddrss/lpddr4.c
@@ -155,10 +155,11 @@  u32 lpddr4_start(const lpddr4_privatedata *pd)
 	u32 result = 0U;
 
 	result = lpddr4_startsf(pd);
-	if (result == (u32)0) {
+	if (result == (u32)0)
 		result = lpddr4_enablepiinitiator(pd);
+	if (result == (u32)0)
 		result = lpddr4_startsequencecontroller(pd);
-	}
+
 	return result;
 }