diff mbox series

soc: fsl: dpio: fix net interfaces probe on big endian

Message ID 20230320233020.29316-1-dullfire@yahoo.com (mailing list archive)
State New, archived
Headers show
Series soc: fsl: dpio: fix net interfaces probe on big endian | expand

Commit Message

dullfire@yahoo.com March 20, 2023, 11:30 p.m. UTC
From: Jonathan Currier <dullfire@yahoo.com>

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

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

Patch

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;