Commit 250ae0d4 authored by Eli Cohen's avatar Eli Cohen Committed by Saeed Mahameed

net/mlx5: Fix read from coherent memory

Use accessor function READ_ONCE to read from coherent memory modified
by the device and read by the driver. This becomes most important in
preemptive kernels where cond_resched implementation does not have the
side effect which guaranteed the updated value.

Fixes: 269d26f4 ("net/mlx5: Reduce command polling interval")
Change-Id: Ie6deeb565ffaf76777b07448c7fbcce3510bbb8a
Signed-off-by: default avatarEli Cohen <eli@mellanox.com>
Reported-by: default avatarJesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
parent c7348091
...@@ -206,7 +206,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent) ...@@ -206,7 +206,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent)
u8 own; u8 own;
do { do {
own = ent->lay->status_own; own = READ_ONCE(ent->lay->status_own);
if (!(own & CMD_OWNER_HW)) { if (!(own & CMD_OWNER_HW)) {
ent->ret = 0; ent->ret = 0;
return; return;
......
Markdown is supported
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