linux-brain/drivers/platform/mellanox
Liming Sun 6e90ff540a platform/mellanox: mlxbf-tmfifo: Fix a memory barrier issue
[ Upstream commit 1c0e5701c5e792c090aef0e5b9b8923c334d9324 ]

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: 1357dfd726 ("platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc")
Signed-off-by: Liming Sun <limings@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/1620433812-17911-1-git-send-email-limings@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-26 12:05:15 +02:00
..
Kconfig platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc 2019-05-06 17:54:42 +03:00
Makefile platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc 2019-05-06 17:54:42 +03:00
mlxbf-tmfifo-regs.h platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc 2019-05-06 17:54:42 +03:00
mlxbf-tmfifo.c platform/mellanox: mlxbf-tmfifo: Fix a memory barrier issue 2021-05-26 12:05:15 +02:00
mlxreg-hotplug.c platform/mellanox: mlxreg-hotplug: Remove dev_err() usage after platform_get_irq() 2019-08-01 18:03:02 +03:00
mlxreg-io.c platform/mellanox: Use 2-factor allocator calls 2018-07-18 13:29:11 +03:00