aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2009-10-27 19:49:59 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-28 06:25:52 -0400
commit25568a531a1bc76fdf968382a4eb65a979186c67 (patch)
tree165236fed52a368906e21734a0e6ae9422607aa5 /drivers/net/igb
parentee1b9f06dca9c406b159904e9b13ea2dfa5ed037 (diff)
igb: cleanup interrupt enablement in regards to msix_other
This patch changes a few things so that instead of firing a link status interrupt directly the get_link_status bit is set and the watchdog is scheduled. In addition the mailbox bit is now only enabled if VFs are enabled. 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>
Diffstat (limited to 'drivers/net/igb')
-rw-r--r--drivers/net/igb/igb_main.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 52c43021c13d..5b0f93911f3d 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -919,6 +919,11 @@ static void igb_irq_disable(struct igb_adapter *adapter)
919{ 919{
920 struct e1000_hw *hw = &adapter->hw; 920 struct e1000_hw *hw = &adapter->hw;
921 921
922 /*
923 * we need to be careful when disabling interrupts. The VFs are also
924 * mapped into these registers and so clearing the bits can cause
925 * issues on the VF drivers so we only need to clear what we set
926 */
922 if (adapter->msix_entries) { 927 if (adapter->msix_entries) {
923 u32 regval = rd32(E1000_EIAM); 928 u32 regval = rd32(E1000_EIAM);
924 wr32(E1000_EIAM, regval & ~adapter->eims_enable_mask); 929 wr32(E1000_EIAM, regval & ~adapter->eims_enable_mask);
@@ -942,15 +947,17 @@ static void igb_irq_enable(struct igb_adapter *adapter)
942 struct e1000_hw *hw = &adapter->hw; 947 struct e1000_hw *hw = &adapter->hw;
943 948
944 if (adapter->msix_entries) { 949 if (adapter->msix_entries) {
950 u32 ims = E1000_IMS_LSC | E1000_IMS_DOUTSYNC;
945 u32 regval = rd32(E1000_EIAC); 951 u32 regval = rd32(E1000_EIAC);
946 wr32(E1000_EIAC, regval | adapter->eims_enable_mask); 952 wr32(E1000_EIAC, regval | adapter->eims_enable_mask);
947 regval = rd32(E1000_EIAM); 953 regval = rd32(E1000_EIAM);
948 wr32(E1000_EIAM, regval | adapter->eims_enable_mask); 954 wr32(E1000_EIAM, regval | adapter->eims_enable_mask);
949 wr32(E1000_EIMS, adapter->eims_enable_mask); 955 wr32(E1000_EIMS, adapter->eims_enable_mask);
950 if (adapter->vfs_allocated_count) 956 if (adapter->vfs_allocated_count) {
951 wr32(E1000_MBVFIMR, 0xFF); 957 wr32(E1000_MBVFIMR, 0xFF);
952 wr32(E1000_IMS, (E1000_IMS_LSC | E1000_IMS_VMMB | 958 ims |= E1000_IMS_VMMB;
953 E1000_IMS_DOUTSYNC)); 959 }
960 wr32(E1000_IMS, ims);
954 } else { 961 } else {
955 wr32(E1000_IMS, IMS_ENABLE_MASK); 962 wr32(E1000_IMS, IMS_ENABLE_MASK);
956 wr32(E1000_IAM, IMS_ENABLE_MASK); 963 wr32(E1000_IAM, IMS_ENABLE_MASK);
@@ -1091,8 +1098,10 @@ int igb_up(struct igb_adapter *adapter)
1091 1098
1092 netif_tx_start_all_queues(adapter->netdev); 1099 netif_tx_start_all_queues(adapter->netdev);
1093 1100
1094 /* Fire a link change interrupt to start the watchdog. */ 1101 /* start the watchdog. */
1095 wr32(E1000_ICS, E1000_ICS_LSC); 1102 hw->mac.get_link_status = 1;
1103 schedule_work(&adapter->watchdog_task);
1104
1096 return 0; 1105 return 0;
1097} 1106}
1098 1107
@@ -1889,8 +1898,9 @@ static int igb_open(struct net_device *netdev)
1889 1898
1890 netif_tx_start_all_queues(netdev); 1899 netif_tx_start_all_queues(netdev);
1891 1900
1892 /* Fire a link status change interrupt to start the watchdog. */ 1901 /* start the watchdog. */
1893 wr32(E1000_ICS, E1000_ICS_LSC); 1902 hw->mac.get_link_status = 1;
1903 schedule_work(&adapter->watchdog_task);
1894 1904
1895 return 0; 1905 return 0;
1896 1906
@@ -3952,7 +3962,12 @@ static irqreturn_t igb_msix_other(int irq, void *data)
3952 mod_timer(&adapter->watchdog_timer, jiffies + 1); 3962 mod_timer(&adapter->watchdog_timer, jiffies + 1);
3953 } 3963 }
3954 3964
3955 wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC | E1000_IMS_VMMB); 3965 if (adapter->vfs_allocated_count)
3966 wr32(E1000_IMS, E1000_IMS_LSC |
3967 E1000_IMS_VMMB |
3968 E1000_IMS_DOUTSYNC);
3969 else
3970 wr32(E1000_IMS, E1000_IMS_LSC | E1000_IMS_DOUTSYNC);
3956 wr32(E1000_EIMS, adapter->eims_other); 3971 wr32(E1000_EIMS, adapter->eims_other);
3957 3972
3958 return IRQ_HANDLED; 3973 return IRQ_HANDLED;