* [PATCH] soc: fsl: dpio: fix net interfaces probe on big endian
[not found] <20230320233020.29316-1-dullfire.ref@yahoo.com>
@ 2023-03-20 23:30 ` dullfire
0 siblings, 0 replies; 2+ messages in thread
From: dullfire @ 2023-03-20 23:30 UTC (permalink / raw)
To: Roy.Pledge, leoyang.li, linux-kernel, linuxppc-dev, linux-arm-kernel
Cc: Jonathan Currier
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 --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
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] soc: fsl: dpio: fix net interfaces probe on big endian
@ 2023-03-20 23:30 ` dullfire
0 siblings, 0 replies; 2+ messages in thread
From: dullfire @ 2023-03-20 23:30 UTC (permalink / raw)
To: Roy.Pledge, leoyang.li, linux-kernel, linuxppc-dev, linux-arm-kernel
Cc: Jonathan Currier
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 --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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-21 1:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230320233020.29316-1-dullfire.ref@yahoo.com>
2023-03-20 23:30 ` [PATCH] soc: fsl: dpio: fix net interfaces probe on big endian dullfire
2023-03-20 23:30 ` dullfire
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.