summaryrefslogtreecommitdiffstats
path: root/drivers/soc/fsl
diff options
context:
space:
mode:
authorIoana Ciornei <ioana.ciornei@nxp.com>2020-05-05 23:14:29 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-07 17:35:24 -0700
commit7596ac9d19a9df25707ecaac0675881f62dd8c18 (patch)
tree6012bdd1f9bd14c111682a595945a2c550910bb3 /drivers/soc/fsl
parenteb55d7b65f1735dfb39fb14e47007d3c8fb74c43 (diff)
downloadlinux-7596ac9d19a9df25707ecaac0675881f62dd8c18.tar.bz2
soc: fsl: dpio: properly compute the consumer index
Mask the consumer index before using it. Without this, we would be writing frame descriptors beyond the ring size supported by the QBMAN block. Fixes: 3b2abda7d28c ("soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue") Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by: Li Yang <leoyang.li@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/soc/fsl')
-rw-r--r--drivers/soc/fsl/dpio/qbman-portal.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/soc/fsl/dpio/qbman-portal.c b/drivers/soc/fsl/dpio/qbman-portal.c
index 804b8ba9bf5c..23a1377971f4 100644
--- a/drivers/soc/fsl/dpio/qbman-portal.c
+++ b/drivers/soc/fsl/dpio/qbman-portal.c
@@ -669,6 +669,7 @@ int qbman_swp_enqueue_multiple_direct(struct qbman_swp *s,
eqcr_ci = s->eqcr.ci;
p = s->addr_cena + QBMAN_CENA_SWP_EQCR_CI;
s->eqcr.ci = qbman_read_register(s, QBMAN_CINH_SWP_EQCR_CI);
+ s->eqcr.ci &= full_mask;
s->eqcr.available = qm_cyc_diff(s->eqcr.pi_ring_size,
eqcr_ci, s->eqcr.ci);