diff options
-rw-r--r-- | drivers/net/team/team.c | 32 | ||||
-rw-r--r-- | include/linux/if_team.h | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index e5390c73a75d..7db219cd3153 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -443,9 +443,9 @@ static void __team_compute_features(struct team *team) | |||
443 | 443 | ||
444 | static void team_compute_features(struct team *team) | 444 | static void team_compute_features(struct team *team) |
445 | { | 445 | { |
446 | spin_lock(&team->lock); | 446 | mutex_lock(&team->lock); |
447 | __team_compute_features(team); | 447 | __team_compute_features(team); |
448 | spin_unlock(&team->lock); | 448 | mutex_unlock(&team->lock); |
449 | } | 449 | } |
450 | 450 | ||
451 | static int team_port_enter(struct team *team, struct team_port *port) | 451 | static int team_port_enter(struct team *team, struct team_port *port) |
@@ -647,7 +647,7 @@ static int team_init(struct net_device *dev) | |||
647 | int i; | 647 | int i; |
648 | 648 | ||
649 | team->dev = dev; | 649 | team->dev = dev; |
650 | spin_lock_init(&team->lock); | 650 | mutex_init(&team->lock); |
651 | 651 | ||
652 | team->pcpu_stats = alloc_percpu(struct team_pcpu_stats); | 652 | team->pcpu_stats = alloc_percpu(struct team_pcpu_stats); |
653 | if (!team->pcpu_stats) | 653 | if (!team->pcpu_stats) |
@@ -672,13 +672,13 @@ static void team_uninit(struct net_device *dev) | |||
672 | struct team_port *port; | 672 | struct team_port *port; |
673 | struct team_port *tmp; | 673 | struct team_port *tmp; |
674 | 674 | ||
675 | spin_lock(&team->lock); | 675 | mutex_lock(&team->lock); |
676 | list_for_each_entry_safe(port, tmp, &team->port_list, list) | 676 | list_for_each_entry_safe(port, tmp, &team->port_list, list) |
677 | team_port_del(team, port->dev); | 677 | team_port_del(team, port->dev); |
678 | 678 | ||
679 | __team_change_mode(team, NULL); /* cleanup */ | 679 | __team_change_mode(team, NULL); /* cleanup */ |
680 | __team_options_unregister(team, team_options, ARRAY_SIZE(team_options)); | 680 | __team_options_unregister(team, team_options, ARRAY_SIZE(team_options)); |
681 | spin_unlock(&team->lock); | 681 | mutex_unlock(&team->lock); |
682 | } | 682 | } |
683 | 683 | ||
684 | static void team_destructor(struct net_device *dev) | 684 | static void team_destructor(struct net_device *dev) |
@@ -784,7 +784,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu) | |||
784 | * Alhough this is reader, it's guarded by team lock. It's not possible | 784 | * Alhough this is reader, it's guarded by team lock. It's not possible |
785 | * to traverse list in reverse under rcu_read_lock | 785 | * to traverse list in reverse under rcu_read_lock |
786 | */ | 786 | */ |
787 | spin_lock(&team->lock); | 787 | mutex_lock(&team->lock); |
788 | list_for_each_entry(port, &team->port_list, list) { | 788 | list_for_each_entry(port, &team->port_list, list) { |
789 | err = dev_set_mtu(port->dev, new_mtu); | 789 | err = dev_set_mtu(port->dev, new_mtu); |
790 | if (err) { | 790 | if (err) { |
@@ -793,7 +793,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu) | |||
793 | goto unwind; | 793 | goto unwind; |
794 | } | 794 | } |
795 | } | 795 | } |
796 | spin_unlock(&team->lock); | 796 | mutex_unlock(&team->lock); |
797 | 797 | ||
798 | dev->mtu = new_mtu; | 798 | dev->mtu = new_mtu; |
799 | 799 | ||
@@ -802,7 +802,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu) | |||
802 | unwind: | 802 | unwind: |
803 | list_for_each_entry_continue_reverse(port, &team->port_list, list) | 803 | list_for_each_entry_continue_reverse(port, &team->port_list, list) |
804 | dev_set_mtu(port->dev, dev->mtu); | 804 | dev_set_mtu(port->dev, dev->mtu); |
805 | spin_unlock(&team->lock); | 805 | mutex_unlock(&team->lock); |
806 | 806 | ||
807 | return err; | 807 | return err; |
808 | } | 808 | } |
@@ -880,9 +880,9 @@ static int team_add_slave(struct net_device *dev, struct net_device *port_dev) | |||
880 | struct team *team = netdev_priv(dev); | 880 | struct team *team = netdev_priv(dev); |
881 | int err; | 881 | int err; |
882 | 882 | ||
883 | spin_lock(&team->lock); | 883 | mutex_lock(&team->lock); |
884 | err = team_port_add(team, port_dev); | 884 | err = team_port_add(team, port_dev); |
885 | spin_unlock(&team->lock); | 885 | mutex_unlock(&team->lock); |
886 | return err; | 886 | return err; |
887 | } | 887 | } |
888 | 888 | ||
@@ -891,9 +891,9 @@ static int team_del_slave(struct net_device *dev, struct net_device *port_dev) | |||
891 | struct team *team = netdev_priv(dev); | 891 | struct team *team = netdev_priv(dev); |
892 | int err; | 892 | int err; |
893 | 893 | ||
894 | spin_lock(&team->lock); | 894 | mutex_lock(&team->lock); |
895 | err = team_port_del(team, port_dev); | 895 | err = team_port_del(team, port_dev); |
896 | spin_unlock(&team->lock); | 896 | mutex_unlock(&team->lock); |
897 | return err; | 897 | return err; |
898 | } | 898 | } |
899 | 899 | ||
@@ -1064,13 +1064,13 @@ static struct team *team_nl_team_get(struct genl_info *info) | |||
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | team = netdev_priv(dev); | 1066 | team = netdev_priv(dev); |
1067 | spin_lock(&team->lock); | 1067 | mutex_lock(&team->lock); |
1068 | return team; | 1068 | return team; |
1069 | } | 1069 | } |
1070 | 1070 | ||
1071 | static void team_nl_team_put(struct team *team) | 1071 | static void team_nl_team_put(struct team *team) |
1072 | { | 1072 | { |
1073 | spin_unlock(&team->lock); | 1073 | mutex_unlock(&team->lock); |
1074 | dev_put(team->dev); | 1074 | dev_put(team->dev); |
1075 | } | 1075 | } |
1076 | 1076 | ||
@@ -1486,9 +1486,9 @@ static void team_port_change_check(struct team_port *port, bool linkup) | |||
1486 | { | 1486 | { |
1487 | struct team *team = port->team; | 1487 | struct team *team = port->team; |
1488 | 1488 | ||
1489 | spin_lock(&team->lock); | 1489 | mutex_lock(&team->lock); |
1490 | __team_port_change_check(port, linkup); | 1490 | __team_port_change_check(port, linkup); |
1491 | spin_unlock(&team->lock); | 1491 | mutex_unlock(&team->lock); |
1492 | } | 1492 | } |
1493 | 1493 | ||
1494 | /************************************ | 1494 | /************************************ |
diff --git a/include/linux/if_team.h b/include/linux/if_team.h index 14f6388f5460..a6eac126a99a 100644 --- a/include/linux/if_team.h +++ b/include/linux/if_team.h | |||
@@ -92,7 +92,7 @@ struct team { | |||
92 | struct net_device *dev; /* associated netdevice */ | 92 | struct net_device *dev; /* associated netdevice */ |
93 | struct team_pcpu_stats __percpu *pcpu_stats; | 93 | struct team_pcpu_stats __percpu *pcpu_stats; |
94 | 94 | ||
95 | spinlock_t lock; /* used for overall locking, e.g. port lists write */ | 95 | struct mutex lock; /* used for overall locking, e.g. port lists write */ |
96 | 96 | ||
97 | /* | 97 | /* |
98 | * port lists with port count | 98 | * port lists with port count |