From: Saeed Mahameed <saeedm@mellanox.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Eli Cohen <eli@mellanox.com>,
Saeed Mahameed <saeedm@mellanox.com>
Subject: [RESEND net 1/3] net/mlx5: Fix read from coherent memory
Date: Mon, 17 Sep 2018 20:49:26 -0700 [thread overview]
Message-ID: <20180918034928.28651-2-saeedm@mellanox.com> (raw)
In-Reply-To: <20180918034928.28651-1-saeedm@mellanox.com>
From: Eli Cohen <eli@mellanox.com>
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")
Signed-off-by: Eli Cohen <eli@mellanox.com>
Reported-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.17.1
next prev parent reply other threads:[~2018-09-18 9:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 3:49 [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 Saeed Mahameed
2018-09-18 3:49 ` Saeed Mahameed [this message]
2018-09-18 3:49 ` [RESEND net 2/3] net/mlx5: Check for SQ and not RQ state when modifying hairpin SQ Saeed Mahameed
2018-09-18 3:49 ` [RESEND net 3/3] net/mlx5e: TLS, Read capabilities only when it is safe Saeed Mahameed
2018-09-19 3:00 ` [pull request][RESEND net 0/3] Mellanox, mlx5 fixes 2018-09-17 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180918034928.28651-2-saeedm@mellanox.com \
--to=saeedm@mellanox.com \
--cc=davem@davemloft.net \
--cc=eli@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox