[PATCH] soc: fsl: dpio: fix net interfaces probe on big endian

dullfire at yahoo.com dullfire at yahoo.com
Tue Mar 21 10:30:20 AEDT 2023


From: Jonathan Currier <dullfire at yahoo.com>

qbman-portal failed to correct for system endianness, resulting in command
time outs.

Signed-off-by: Jonathan Currier <dullfire at yahoo.com>
---
 drivers/soc/fsl/dpio/qbman-portal.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/soc/fsl/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c
index 0a3fb6c115f4..0f8f5f982399 100644
--- a/drivers/soc/fsl/dpio/qbman-portal.c
+++ b/drivers/soc/fsl/dpio/qbman-portal.c
@@ -477,24 +477,26 @@ void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, u8 cmd_verb)
  */
 void *qbman_swp_mc_result(struct qbman_swp *p)
 {
-	u32 *ret, verb;
+	u32 *ret, verb, result;
 
 	if ((p->desc->qman_version & QMAN_REV_MASK) < QMAN_REV_5000) {
 		ret = qbman_get_cmd(p, QBMAN_CENA_SWP_RR(p->mc.valid_bit));
+		result = le32_to_cpu(ret[0]);
 		/* Remove the valid-bit - command completed if the rest
 		 * is non-zero.
 		 */
-		verb = ret[0] & ~QB_VALID_BIT;
+		verb = result & ~QB_VALID_BIT;
 		if (!verb)
 			return NULL;
 		p->mc.valid_bit ^= QB_VALID_BIT;
 	} else {
 		ret = qbman_get_cmd(p, QBMAN_CENA_SWP_RR_MEM);
+		result = le32_to_cpu(ret[0]);
 		/* Command completed if the valid bit is toggled */
-		if (p->mr.valid_bit != (ret[0] & QB_VALID_BIT))
+		if (p->mr.valid_bit != (result & QB_VALID_BIT))
 			return NULL;
 		/* Command completed if the rest is non-zero */
-		verb = ret[0] & ~QB_VALID_BIT;
+		verb = result & ~QB_VALID_BIT;
 		if (!verb)
 			return NULL;
 		p->mr.valid_bit ^= QB_VALID_BIT;
-- 
2.39.1



More information about the Linuxppc-dev mailing list