Acquire ordering is needed to maintain proper release consistency with
the ring enqueue operation. This issue presented itself as deadlock when
running on an ARM-based chip.

Signed-off-by: Brian Brooks <brian.bro...@linaro.org>
---
 platform/linux-generic/include/odp_ring_internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/platform/linux-generic/include/odp_ring_internal.h 
b/platform/linux-generic/include/odp_ring_internal.h
index 55fedeb3..44b83c60 100644
--- a/platform/linux-generic/include/odp_ring_internal.h
+++ b/platform/linux-generic/include/odp_ring_internal.h
@@ -57,7 +57,7 @@ static inline uint32_t ring_deq(ring_t *ring, uint32_t mask)
 
        /* Move reader head. This thread owns data at the new head. */
        do {
-               tail = odp_atomic_load_u32(&ring->w_tail);
+               tail = odp_atomic_load_acq_u32(&ring->w_tail);
 
                if (head == tail)
                        return RING_EMPTY;
@@ -90,7 +90,7 @@ static inline uint32_t ring_deq_multi(ring_t *ring, uint32_t 
mask,
 
        /* Move reader head. This thread owns data at the new head. */
        do {
-               tail = odp_atomic_load_u32(&ring->w_tail);
+               tail = odp_atomic_load_acq_u32(&ring->w_tail);
 
                /* Ring is empty */
                if (head == tail)
-- 
2.12.0

Reply via email to