[MLX4] improvements in Soft Reset mechanism [mlnx: 3363]
[mirror/winof/.git] / hw / mlx4 / kernel / bus / net / cmd.c
index 123ad70..a27a638 100644 (file)
@@ -389,6 +389,9 @@ int __mlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
                __print_opcode(op), mlx4_priv(dev)->cmd.use_events, in_param, out_param, 
                out_is_imm, in_modifier, (int)op_modifier);
 #endif
+
+       if ( mlx4_is_barred(dev) )
+               return -EFAULT;
        
        if (mlx4_priv(dev)->cmd.use_events)
                return mlx4_cmd_wait(dev, in_param, out_param, out_is_imm,
@@ -527,9 +530,6 @@ EXPORT_SYMBOL_GPL(mlx4_free_cmd_mailbox);
 int imlx4_cmd(struct mlx4_dev *dev, u64 in_param, u64 *out_param, int out_is_imm,
                u32 in_modifier, u8 op_modifier, u16 op, unsigned long timeout)
 {
-       if ( mlx4_is_barred(dev) )
-               return -EFAULT;
-       
        return __mlx4_cmd(dev, in_param, out_param, out_is_imm, in_modifier,
                          op_modifier, op, timeout);
 }