diff mbox series

board: ten64: add missing error checks for retimer power on

Message ID 20230807014108.28451-1-matt@traverse.com.au
State Accepted
Commit 29760c8e6d3a3d02a23439f62b7e663e0c38eb3b
Delegated to: Tom Rini
Headers show
Series board: ten64: add missing error checks for retimer power on | expand

Commit Message

Mathew McBride Aug. 7, 2023, 1:41 a.m. UTC
The retimer reset/power on logic was changed in a recent commit,
however, it neglected to check if the commands sent to the
board microcontroller (to control power to the retimer chip)
actually completed.

Add return checks for these operations so any failures will
be reported to the user.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
Fixes: 7a041fea2 ("board: traverse: ten64: ensure retimer reset
is done on new board revisions")
---
 board/traverse/ten64/ten64.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Tom Rini Aug. 7, 2023, 7:29 p.m. UTC | #1
On Mon, Aug 07, 2023 at 01:41:08AM +0000, Mathew McBride wrote:

> The retimer reset/power on logic was changed in a recent commit,
> however, it neglected to check if the commands sent to the
> board microcontroller (to control power to the retimer chip)
> actually completed.
> 
> Add return checks for these operations so any failures will
> be reported to the user.
> 
> Signed-off-by: Mathew McBride <matt@traverse.com.au>
> Fixes: 7a041fea2 ("board: traverse: ten64: ensure retimer reset
> is done on new board revisions")

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/board/traverse/ten64/ten64.c b/board/traverse/ten64/ten64.c
index 52daae6e24..df9f0afe1a 100644
--- a/board/traverse/ten64/ten64.c
+++ b/board/traverse/ten64/ten64.c
@@ -383,10 +383,15 @@  static int board_cycle_retimer(struct udevice **retim_dev)
 			puts("(retimer on, resetting...) ");
 
 			ret = misc_call(uc_dev, TEN64_CNTRL_10G_OFF, NULL, 0, NULL, 0);
+			if (ret)
+				return ret;
 			mdelay(1000);
 		}
 
+		/* Turn on the retimer */
 		ret = misc_call(uc_dev, TEN64_CNTRL_10G_ON, NULL, 0, NULL, 0);
+		if (ret)
+			return ret;
 	}
 
 	// Wait for retimer to come back