diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-05-21 09:07:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-21 20:19:10 -0400 |
commit | e35ec126507529ce407136c6b9e36747d89891f9 (patch) | |
tree | 35eea146ce5494c67bd4a320bec5b7d6a0c99f4c | |
parent | 7e0e99ef43b1fab8caf0348e31704c7d15060ce0 (diff) |
ixgbe: only register DCA requester once
The current driver tries to re-register the DCA requester after reset and
this is not correct. This change makes it so all we are doing is resetting
the DCA registers after reset and not re-adding the requester.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 3d5f7f575ae3..e52798c4816b 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -411,6 +411,9 @@ static void ixgbe_setup_dca(struct ixgbe_adapter *adapter) | |||
411 | if (!(adapter->flags & IXGBE_FLAG_DCA_ENABLED)) | 411 | if (!(adapter->flags & IXGBE_FLAG_DCA_ENABLED)) |
412 | return; | 412 | return; |
413 | 413 | ||
414 | /* always use CB2 mode, difference is masked in the CB driver */ | ||
415 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, 2); | ||
416 | |||
414 | for (i = 0; i < adapter->num_tx_queues; i++) { | 417 | for (i = 0; i < adapter->num_tx_queues; i++) { |
415 | adapter->tx_ring[i].cpu = -1; | 418 | adapter->tx_ring[i].cpu = -1; |
416 | ixgbe_update_tx_dca(adapter, &adapter->tx_ring[i]); | 419 | ixgbe_update_tx_dca(adapter, &adapter->tx_ring[i]); |
@@ -432,9 +435,6 @@ static int __ixgbe_notify_dca(struct device *dev, void *data) | |||
432 | /* if we're already enabled, don't do it again */ | 435 | /* if we're already enabled, don't do it again */ |
433 | if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) | 436 | if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) |
434 | break; | 437 | break; |
435 | /* Always use CB2 mode, difference is masked | ||
436 | * in the CB driver. */ | ||
437 | IXGBE_WRITE_REG(&adapter->hw, IXGBE_DCA_CTRL, 2); | ||
438 | if (dca_add_requester(dev) == 0) { | 438 | if (dca_add_requester(dev) == 0) { |
439 | adapter->flags |= IXGBE_FLAG_DCA_ENABLED; | 439 | adapter->flags |= IXGBE_FLAG_DCA_ENABLED; |
440 | ixgbe_setup_dca(adapter); | 440 | ixgbe_setup_dca(adapter); |
@@ -2767,13 +2767,6 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
2767 | 2767 | ||
2768 | netif_carrier_off(netdev); | 2768 | netif_carrier_off(netdev); |
2769 | 2769 | ||
2770 | #ifdef CONFIG_IXGBE_DCA | ||
2771 | if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) { | ||
2772 | adapter->flags &= ~IXGBE_FLAG_DCA_ENABLED; | ||
2773 | dca_remove_requester(&adapter->pdev->dev); | ||
2774 | } | ||
2775 | |||
2776 | #endif | ||
2777 | if (!pci_channel_offline(adapter->pdev)) | 2770 | if (!pci_channel_offline(adapter->pdev)) |
2778 | ixgbe_reset(adapter); | 2771 | ixgbe_reset(adapter); |
2779 | ixgbe_clean_all_tx_rings(adapter); | 2772 | ixgbe_clean_all_tx_rings(adapter); |
@@ -2781,13 +2774,7 @@ void ixgbe_down(struct ixgbe_adapter *adapter) | |||
2781 | 2774 | ||
2782 | #ifdef CONFIG_IXGBE_DCA | 2775 | #ifdef CONFIG_IXGBE_DCA |
2783 | /* since we reset the hardware DCA settings were cleared */ | 2776 | /* since we reset the hardware DCA settings were cleared */ |
2784 | if (dca_add_requester(&adapter->pdev->dev) == 0) { | 2777 | ixgbe_setup_dca(adapter); |
2785 | adapter->flags |= IXGBE_FLAG_DCA_ENABLED; | ||
2786 | /* always use CB2 mode, difference is masked | ||
2787 | * in the CB driver */ | ||
2788 | IXGBE_WRITE_REG(hw, IXGBE_DCA_CTRL, 2); | ||
2789 | ixgbe_setup_dca(adapter); | ||
2790 | } | ||
2791 | #endif | 2778 | #endif |
2792 | } | 2779 | } |
2793 | 2780 | ||
@@ -5354,9 +5341,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
5354 | #ifdef CONFIG_IXGBE_DCA | 5341 | #ifdef CONFIG_IXGBE_DCA |
5355 | if (dca_add_requester(&pdev->dev) == 0) { | 5342 | if (dca_add_requester(&pdev->dev) == 0) { |
5356 | adapter->flags |= IXGBE_FLAG_DCA_ENABLED; | 5343 | adapter->flags |= IXGBE_FLAG_DCA_ENABLED; |
5357 | /* always use CB2 mode, difference is masked | ||
5358 | * in the CB driver */ | ||
5359 | IXGBE_WRITE_REG(hw, IXGBE_DCA_CTRL, 2); | ||
5360 | ixgbe_setup_dca(adapter); | 5344 | ixgbe_setup_dca(adapter); |
5361 | } | 5345 | } |
5362 | #endif | 5346 | #endif |