aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mlx4/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mlx4/cmd.c')
-rw-r--r--drivers/net/mlx4/cmd.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c
index a9f31753661a..db49051b97b1 100644
--- a/drivers/net/mlx4/cmd.c
+++ b/drivers/net/mlx4/cmd.c
@@ -95,7 +95,7 @@ enum {
95}; 95};
96 96
97enum { 97enum {
98 GO_BIT_TIMEOUT = 10000 98 GO_BIT_TIMEOUT_MSECS = 10000
99}; 99};
100 100
101struct mlx4_cmd_context { 101struct mlx4_cmd_context {
@@ -155,7 +155,7 @@ static int mlx4_cmd_post(struct mlx4_dev *dev, u64 in_param, u64 out_param,
155 155
156 end = jiffies; 156 end = jiffies;
157 if (event) 157 if (event)
158 end += HZ * 10; 158 end += msecs_to_jiffies(GO_BIT_TIMEOUT_MSECS);
159 159
160 while (cmd_pending(dev)) { 160 while (cmd_pending(dev)) {
161 if (time_after_eq(jiffies, end)) 161 if (time_after_eq(jiffies, end))
@@ -184,6 +184,13 @@ static int mlx4_cmd_post(struct mlx4_dev *dev, u64 in_param, u64 out_param,
184 (event ? (1 << HCR_E_BIT) : 0) | 184 (event ? (1 << HCR_E_BIT) : 0) |
185 (op_modifier << HCR_OPMOD_SHIFT) | 185 (op_modifier << HCR_OPMOD_SHIFT) |
186 op), hcr + 6); 186 op), hcr + 6);
187
188 /*
189 * Make sure that our HCR writes don't get mixed in with
190 * writes from another CPU starting a FW command.
191 */
192 mmiowb();
193
187 cmd->toggle = cmd->toggle ^ 1; 194 cmd->toggle = cmd->toggle ^ 1;
188 195
189 ret = 0; 196 ret = 0;