Skip to content

Commit

Permalink
soc: fsl: dpio: properly compute the consumer index
Browse files Browse the repository at this point in the history
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: 3b2abda ("soc: fsl: dpio: Replace QMAN array mode with ring mode enqueue")
Signed-off-by: Ioana Ciornei <[email protected]>
Acked-by: Li Yang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
IoanaCiornei authored and davem330 committed May 8, 2020
1 parent eb55d7b commit 7596ac9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/soc/fsl/dpio/qbman-portal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7596ac9

Please sign in to comment.