Skip to content
Commit 1c0e5701 authored by Liming Sun's avatar Liming Sun Committed by Hans de Goede
Browse files

platform/mellanox: mlxbf-tmfifo: Fix a memory barrier issue



The virtio framework uses wmb() when updating avail->idx. It
guarantees the write order, but not necessarily loading order
for the code accessing the memory. This commit adds a load barrier
after reading the avail->idx to make sure all the data in the
descriptor is visible. It also adds a barrier when returning the
packet to virtio framework to make sure read/writes are visible to
the virtio code.

Fixes: 1357dfd7 ("platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc")
Signed-off-by: default avatarLiming Sun <limings@nvidia.com>
Reviewed-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/1620433812-17911-1-git-send-email-limings@nvidia.com


Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 9795d823
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment