diff options
author | Eli Cohen <eli@mellanox.com> | 2018-09-02 12:01:53 +0300 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2018-09-17 15:12:31 -0700 |
commit | 250ae0d46d857ed61f3e0abf584901e46bd2c638 (patch) | |
tree | 90669b3d9c209a0204386385e39825610736da24 | |
parent | c73480910e9686a5c25155cb4d418d594b678196 (diff) | |
download | linux-stable-250ae0d46d857ed61f3e0abf584901e46bd2c638.tar.gz linux-stable-250ae0d46d857ed61f3e0abf584901e46bd2c638.tar.bz2 linux-stable-250ae0d46d857ed61f3e0abf584901e46bd2c638.zip |
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: 269d26f47f6f ("net/mlx5: Reduce command polling interval")
Change-Id: Ie6deeb565ffaf76777b07448c7fbcce3510bbb8a
Signed-off-by: Eli Cohen <eli@mellanox.com>
Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index 3ce14d42ddc8..a53736c26c0c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -206,7 +206,7 @@ static void poll_timeout(struct mlx5_cmd_work_ent *ent) u8 own; do { - own = ent->lay->status_own; + own = READ_ONCE(ent->lay->status_own); if (!(own & CMD_OWNER_HW)) { ent->ret = 0; return; |