Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-gen: ring: fix ring size detection
Previously, _RING_MPMC_ENQ_MULTI() and _RING_MPMC_ENQ_BATCH() could return zero even though the ring was not actually full. Read w_head before r_tail, which guarantees that w_head - r_tail <= size. Any additional delay in reading r_tail makes the subtraction result only smaller. This avoids returning zero when the ring is not actually full. Signed-off-by: Matias Elo <matias.elo@nokia.com> Reviewed-by: Petri Savolainen <petri.savolainen@nokia.com> Reported-by: Fan Hong <fan.hong@arm.com>
- Loading branch information