summaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/mlx4/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-11 20:24:52 (GMT)
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-11 20:24:52 (GMT)
commitf549e088b806f44b6ab6eeef0cb71ced1d2488dd (patch)
tree1dc4d7745d3ad67d1ab467455aeec1f58b9af5cf /drivers/infiniband/hw/mlx4/main.c
parent70f33fa5863458ec9f1ae3aabdb9c2401598ec3d (diff)
parent0559d8dc13a1cd68b5e64c0b61659f36c7b5c89f (diff)
downloadlinux-fsl-qoriq-f549e088b806f44b6ab6eeef0cb71ced1d2488dd.tar.xz
Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull infiniband fixes from Roland Dreier: "Fix a regression in the /sys/class/infiniband/.../rate attribute -- old kernels used to just return something, even if the underlying value was out-of-bounds, while 3.4-rc1 returned EINVAL to userspace. This breaks some applications that check for the error, so go back to the old behavior." * tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IB/core: Don't return EINVAL from sysfs rate attribute for invalid speeds IB/mlx4: Don't return an invalid speed when a port is down
Diffstat (limited to 'drivers/infiniband/hw/mlx4/main.c')
-rw-r--r--drivers/infiniband/hw/mlx4/main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 75d3056..669673e 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -253,6 +253,11 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port,
if (out_mad->data[15] & 0x1)
props->active_speed = IB_SPEED_FDR10;
}
+
+ /* Avoid wrong speed value returned by FW if the IB link is down. */
+ if (props->state == IB_PORT_DOWN)
+ props->active_speed = IB_SPEED_SDR;
+
out:
kfree(in_mad);
kfree(out_mad);