diff options
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/eq.c | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/main.c | 10 | ||||
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/mlx4.h | 2 |
3 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c index 8fa41f3082cf..9129ace02560 100644 --- a/drivers/net/ethernet/mellanox/mlx4/eq.c +++ b/drivers/net/ethernet/mellanox/mlx4/eq.c | |||
@@ -1036,7 +1036,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
1036 | struct mlx4_priv *priv = mlx4_priv(dev); | 1036 | struct mlx4_priv *priv = mlx4_priv(dev); |
1037 | int vec = 0, err = 0, i; | 1037 | int vec = 0, err = 0, i; |
1038 | 1038 | ||
1039 | spin_lock(&priv->msix_ctl.pool_lock); | 1039 | mutex_lock(&priv->msix_ctl.pool_lock); |
1040 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { | 1040 | for (i = 0; !vec && i < dev->caps.comp_pool; i++) { |
1041 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { | 1041 | if (~priv->msix_ctl.pool_bm & 1ULL << i) { |
1042 | priv->msix_ctl.pool_bm |= 1ULL << i; | 1042 | priv->msix_ctl.pool_bm |= 1ULL << i; |
@@ -1058,7 +1058,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector) | |||
1058 | eq_set_ci(&priv->eq_table.eq[vec], 1); | 1058 | eq_set_ci(&priv->eq_table.eq[vec], 1); |
1059 | } | 1059 | } |
1060 | } | 1060 | } |
1061 | spin_unlock(&priv->msix_ctl.pool_lock); | 1061 | mutex_unlock(&priv->msix_ctl.pool_lock); |
1062 | 1062 | ||
1063 | if (vec) { | 1063 | if (vec) { |
1064 | *vector = vec; | 1064 | *vector = vec; |
@@ -1079,13 +1079,13 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec) | |||
1079 | if (likely(i >= 0)) { | 1079 | if (likely(i >= 0)) { |
1080 | /*sanity check , making sure were not trying to free irq's | 1080 | /*sanity check , making sure were not trying to free irq's |
1081 | Belonging to a legacy EQ*/ | 1081 | Belonging to a legacy EQ*/ |
1082 | spin_lock(&priv->msix_ctl.pool_lock); | 1082 | mutex_lock(&priv->msix_ctl.pool_lock); |
1083 | if (priv->msix_ctl.pool_bm & 1ULL << i) { | 1083 | if (priv->msix_ctl.pool_bm & 1ULL << i) { |
1084 | free_irq(priv->eq_table.eq[vec].irq, | 1084 | free_irq(priv->eq_table.eq[vec].irq, |
1085 | &priv->eq_table.eq[vec]); | 1085 | &priv->eq_table.eq[vec]); |
1086 | priv->msix_ctl.pool_bm &= ~(1ULL << i); | 1086 | priv->msix_ctl.pool_bm &= ~(1ULL << i); |
1087 | } | 1087 | } |
1088 | spin_unlock(&priv->msix_ctl.pool_lock); | 1088 | mutex_unlock(&priv->msix_ctl.pool_lock); |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | } | 1091 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 678558b502fc..d498f049c74e 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, | |||
531 | for (port = 0; port < dev->caps.num_ports; port++) { | 531 | for (port = 0; port < dev->caps.num_ports; port++) { |
532 | /* Change the port type only if the new type is different | 532 | /* Change the port type only if the new type is different |
533 | * from the current, and not set to Auto */ | 533 | * from the current, and not set to Auto */ |
534 | if (port_types[port] != dev->caps.port_type[port + 1]) { | 534 | if (port_types[port] != dev->caps.port_type[port + 1]) |
535 | change = 1; | 535 | change = 1; |
536 | dev->caps.port_type[port + 1] = port_types[port]; | ||
537 | } | ||
538 | } | 536 | } |
539 | if (change) { | 537 | if (change) { |
540 | mlx4_unregister_device(dev); | 538 | mlx4_unregister_device(dev); |
541 | for (port = 1; port <= dev->caps.num_ports; port++) { | 539 | for (port = 1; port <= dev->caps.num_ports; port++) { |
542 | mlx4_CLOSE_PORT(dev, port); | 540 | mlx4_CLOSE_PORT(dev, port); |
541 | dev->caps.port_type[port] = port_types[port - 1]; | ||
543 | err = mlx4_SET_PORT(dev, port); | 542 | err = mlx4_SET_PORT(dev, port); |
544 | if (err) { | 543 | if (err) { |
545 | mlx4_err(dev, "Failed to set port %d, " | 544 | mlx4_err(dev, "Failed to set port %d, " |
@@ -986,6 +985,9 @@ static int map_bf_area(struct mlx4_dev *dev) | |||
986 | resource_size_t bf_len; | 985 | resource_size_t bf_len; |
987 | int err = 0; | 986 | int err = 0; |
988 | 987 | ||
988 | if (!dev->caps.bf_reg_size) | ||
989 | return -ENXIO; | ||
990 | |||
989 | bf_start = pci_resource_start(dev->pdev, 2) + | 991 | bf_start = pci_resource_start(dev->pdev, 2) + |
990 | (dev->caps.num_uars << PAGE_SHIFT); | 992 | (dev->caps.num_uars << PAGE_SHIFT); |
991 | bf_len = pci_resource_len(dev->pdev, 2) - | 993 | bf_len = pci_resource_len(dev->pdev, 2) - |
@@ -1825,7 +1827,7 @@ slave_start: | |||
1825 | goto err_master_mfunc; | 1827 | goto err_master_mfunc; |
1826 | 1828 | ||
1827 | priv->msix_ctl.pool_bm = 0; | 1829 | priv->msix_ctl.pool_bm = 0; |
1828 | spin_lock_init(&priv->msix_ctl.pool_lock); | 1830 | mutex_init(&priv->msix_ctl.pool_lock); |
1829 | 1831 | ||
1830 | mlx4_enable_msi_x(dev); | 1832 | mlx4_enable_msi_x(dev); |
1831 | if ((mlx4_is_mfunc(dev)) && | 1833 | if ((mlx4_is_mfunc(dev)) && |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h index c92269f8c057..28f8251561f4 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h | |||
@@ -697,7 +697,7 @@ struct mlx4_sense { | |||
697 | 697 | ||
698 | struct mlx4_msix_ctl { | 698 | struct mlx4_msix_ctl { |
699 | u64 pool_bm; | 699 | u64 pool_bm; |
700 | spinlock_t pool_lock; | 700 | struct mutex pool_lock; |
701 | }; | 701 | }; |
702 | 702 | ||
703 | struct mlx4_steer { | 703 | struct mlx4_steer { |