summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/mellanox
diff options
context:
space:
mode:
authorYevgeny Petrilin <yevgenyp@mellanox.co.il>2012-02-21 03:41:07 +0000
committerDavid S. Miller <davem@davemloft.net>2012-02-21 15:27:24 -0500
commit3d8f93083be54696d3b7f8e8c6c70d411d01f9e8 (patch)
treec517910d1381123cfffdfd4ce996a8cc50fc68f1 /drivers/net/ethernet/mellanox
parent730c41d5ba583a9608300fc4e6cf236957cfe02a (diff)
downloadlinux-3.10-3d8f93083be54696d3b7f8e8c6c70d411d01f9e8.tar.gz
linux-3.10-3d8f93083be54696d3b7f8e8c6c70d411d01f9e8.tar.bz2
linux-3.10-3d8f93083be54696d3b7f8e8c6c70d411d01f9e8.zip
mlx4: Setting new port types after all interfaces unregistered
In port type change flow, need to set the new port types only after all interfaces have finished the unregister process. Otherwise, during unregister, one of the interfaces might issue a SET_PORT command with wrong port types, it can cause bad FW behavior. Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index 5c655a2a380..32f8799db19 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -531,15 +531,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev,
for (port = 0; port < dev->caps.num_ports; port++) {
/* Change the port type only if the new type is different
* from the current, and not set to Auto */
- if (port_types[port] != dev->caps.port_type[port + 1]) {
+ if (port_types[port] != dev->caps.port_type[port + 1])
change = 1;
- dev->caps.port_type[port + 1] = port_types[port];
- }
}
if (change) {
mlx4_unregister_device(dev);
for (port = 1; port <= dev->caps.num_ports; port++) {
mlx4_CLOSE_PORT(dev, port);
+ dev->caps.port_type[port + 1] = port_types[port];
err = mlx4_SET_PORT(dev, port);
if (err) {
mlx4_err(dev, "Failed to set port %d, "