[SRU][J:linux-bluefield][PATCH v3 2/9] Revert "UBUNTU: SAUCE: mlxbf-tmfifo: fix potential race"

Haifei Luo haifeil at nvidia.com
Mon Mar 24 01:59:21 UTC 2025


BugLink: https://bugs.launchpad.net/bugs/2103386

This reverts commit 7789adb5fe9078325bc2dc271f2dfe7c3e5e5036.

Change-Id: I62149c52366cd21953721a92ffd408ff3c8a6693
Signed-off-by: Haifei Luo <haifeil at nvidia.com>
---
 drivers/platform/mellanox/mlxbf-tmfifo.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c
index e7d8d31c5502..641761e36994 100644
--- a/drivers/platform/mellanox/mlxbf-tmfifo.c
+++ b/drivers/platform/mellanox/mlxbf-tmfifo.c
@@ -965,7 +965,7 @@ static void mlxbf_tmfifo_rxtx(struct mlxbf_tmfifo_vring *vring, bool is_rx)
 	fifo = vring->fifo;
 
 	/* Return if vdev is not ready. */
-	if (!fifo || !fifo->vdev[devid])
+	if (!fifo->vdev[devid])
 		return;
 
 	/* Return if another vring is running. */
@@ -1163,13 +1163,9 @@ static int mlxbf_tmfifo_virtio_find_vqs(struct virtio_device *vdev,
 			goto error;
 		}
 
-		vq->priv = vring;
-
-		/* Make vq update visible before using it. */
-		virtio_mb(false);
-
 		vqs[i] = vq;
 		vring->vq = vq;
+		vq->priv = vring;
 	}
 
 	return 0;
@@ -1474,9 +1470,6 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev)
 
 	mod_timer(&fifo->timer, jiffies + MLXBF_TMFIFO_TIMER_INTERVAL);
 
-	/* Make all updates visible before the 'is_ready' flag. */
-	virtio_mb(false);
-
 	fifo->is_ready = 1;
 	return 0;
 
-- 
2.34.1




More information about the kernel-team mailing list