diff options
author | Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com> | 2008-02-01 18:58:41 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-02-05 13:31:31 -0500 |
commit | d4f80882ee7bdc721230b9ac209ddd3a837e4545 (patch) | |
tree | ec7a096ac3c39c0d5cc5f32e88f8c7bf2f089e4c /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | 06f7525be463ef95bfdba001484bda04d00ec74e (diff) |
ixgbe: remove obsolete irq_sem, add driver state checking code
After testing we confirmed that the irq_sem can safely be
removed from ixgbe.
Add strict state checking code to various ethtool parts to
properly protect against races between various driver reset
paths.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 36353447716d..9f3cdb873001 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -179,12 +179,10 @@ static int ixgbe_set_pauseparam(struct net_device *netdev, | |||
179 | 179 | ||
180 | hw->fc.original_type = hw->fc.type; | 180 | hw->fc.original_type = hw->fc.type; |
181 | 181 | ||
182 | if (netif_running(adapter->netdev)) { | 182 | if (netif_running(netdev)) |
183 | ixgbe_down(adapter); | 183 | ixgbe_reinit_locked(adapter); |
184 | ixgbe_up(adapter); | 184 | else |
185 | } else { | ||
186 | ixgbe_reset(adapter); | 185 | ixgbe_reset(adapter); |
187 | } | ||
188 | 186 | ||
189 | return 0; | 187 | return 0; |
190 | } | 188 | } |
@@ -203,12 +201,10 @@ static int ixgbe_set_rx_csum(struct net_device *netdev, u32 data) | |||
203 | else | 201 | else |
204 | adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED; | 202 | adapter->flags &= ~IXGBE_FLAG_RX_CSUM_ENABLED; |
205 | 203 | ||
206 | if (netif_running(netdev)) { | 204 | if (netif_running(netdev)) |
207 | ixgbe_down(adapter); | 205 | ixgbe_reinit_locked(adapter); |
208 | ixgbe_up(adapter); | 206 | else |
209 | } else { | ||
210 | ixgbe_reset(adapter); | 207 | ixgbe_reset(adapter); |
211 | } | ||
212 | 208 | ||
213 | return 0; | 209 | return 0; |
214 | } | 210 | } |
@@ -662,7 +658,10 @@ static int ixgbe_set_ringparam(struct net_device *netdev, | |||
662 | return 0; | 658 | return 0; |
663 | } | 659 | } |
664 | 660 | ||
665 | if (netif_running(adapter->netdev)) | 661 | while (test_and_set_bit(__IXGBE_RESETTING, &adapter->state)) |
662 | msleep(1); | ||
663 | |||
664 | if (netif_running(netdev)) | ||
666 | ixgbe_down(adapter); | 665 | ixgbe_down(adapter); |
667 | 666 | ||
668 | /* | 667 | /* |
@@ -733,6 +732,7 @@ err_setup: | |||
733 | if (netif_running(adapter->netdev)) | 732 | if (netif_running(adapter->netdev)) |
734 | ixgbe_up(adapter); | 733 | ixgbe_up(adapter); |
735 | 734 | ||
735 | clear_bit(__IXGBE_RESETTING, &adapter->state); | ||
736 | return err; | 736 | return err; |
737 | } | 737 | } |
738 | 738 | ||
@@ -820,11 +820,8 @@ static int ixgbe_nway_reset(struct net_device *netdev) | |||
820 | { | 820 | { |
821 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 821 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
822 | 822 | ||
823 | if (netif_running(netdev)) { | 823 | if (netif_running(netdev)) |
824 | ixgbe_down(adapter); | 824 | ixgbe_reinit_locked(adapter); |
825 | ixgbe_reset(adapter); | ||
826 | ixgbe_up(adapter); | ||
827 | } | ||
828 | 825 | ||
829 | return 0; | 826 | return 0; |
830 | } | 827 | } |