aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-04-12 19:41:23 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-12 19:41:23 -0400
commit011e3c63251be832d23df9f0697626ab7b354d02 (patch)
tree2cad5b58c274c93ae49d9b58fb15d784d4dfd78f /drivers/infiniband
parentc1412fce7eccae62b4de22494f6ab3ff8a90c0c6 (diff)
parentecca5c3acc0d0933d89abc44e60afb0cc8170e35 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/sysfs.c9
-rw-r--r--drivers/infiniband/hw/mlx4/main.c5
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 83b720ef6c34..246fdc151652 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -179,7 +179,7 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused,
179{ 179{
180 struct ib_port_attr attr; 180 struct ib_port_attr attr;
181 char *speed = ""; 181 char *speed = "";
182 int rate = -1; /* in deci-Gb/sec */ 182 int rate; /* in deci-Gb/sec */
183 ssize_t ret; 183 ssize_t ret;
184 184
185 ret = ib_query_port(p->ibdev, p->port_num, &attr); 185 ret = ib_query_port(p->ibdev, p->port_num, &attr);
@@ -187,9 +187,6 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused,
187 return ret; 187 return ret;
188 188
189 switch (attr.active_speed) { 189 switch (attr.active_speed) {
190 case IB_SPEED_SDR:
191 rate = 25;
192 break;
193 case IB_SPEED_DDR: 190 case IB_SPEED_DDR:
194 speed = " DDR"; 191 speed = " DDR";
195 rate = 50; 192 rate = 50;
@@ -210,6 +207,10 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused,
210 speed = " EDR"; 207 speed = " EDR";
211 rate = 250; 208 rate = 250;
212 break; 209 break;
210 case IB_SPEED_SDR:
211 default: /* default to SDR for invalid rates */
212 rate = 25;
213 break;
213 } 214 }
214 215
215 rate *= ib_width_enum_to_int(attr.active_width); 216 rate *= ib_width_enum_to_int(attr.active_width);
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 75d305629300..669673e81439 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,
253 if (out_mad->data[15] & 0x1) 253 if (out_mad->data[15] & 0x1)
254 props->active_speed = IB_SPEED_FDR10; 254 props->active_speed = IB_SPEED_FDR10;
255 } 255 }
256
257 /* Avoid wrong speed value returned by FW if the IB link is down. */
258 if (props->state == IB_PORT_DOWN)
259 props->active_speed = IB_SPEED_SDR;
260
256out: 261out:
257 kfree(in_mad); 262 kfree(in_mad);
258 kfree(out_mad); 263 kfree(out_mad);