diff options
author | Akeem G Abodunrin <akeem.g.abodunrin@intel.com> | 2013-08-27 22:22:43 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2013-09-04 06:53:53 -0400 |
commit | aa9b8cc44409b140c0dadd3776e99220edf3384a (patch) | |
tree | 70a548bfc70454fb893a0491d316f6cd10a8250f /drivers/net/ethernet/intel/igb/igb_main.c | |
parent | 53ea6c7e2d6ce50c73544ef432fb2206ca60fc38 (diff) |
igb: Implementation of 1-sec delay for i210 devices
This patch adds 1 sec delay mechanism to i210 device family, in order
to avoid erroneous link issue with the link partner.
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb_main.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 78f49cf94e82..b209ca56d50b 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -1671,6 +1671,8 @@ void igb_down(struct igb_adapter *adapter) | |||
1671 | 1671 | ||
1672 | igb_irq_disable(adapter); | 1672 | igb_irq_disable(adapter); |
1673 | 1673 | ||
1674 | adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE; | ||
1675 | |||
1674 | for (i = 0; i < adapter->num_q_vectors; i++) { | 1676 | for (i = 0; i < adapter->num_q_vectors; i++) { |
1675 | napi_synchronize(&(adapter->q_vector[i]->napi)); | 1677 | napi_synchronize(&(adapter->q_vector[i]->napi)); |
1676 | napi_disable(&(adapter->q_vector[i]->napi)); | 1678 | napi_disable(&(adapter->q_vector[i]->napi)); |
@@ -3886,6 +3888,17 @@ bool igb_has_link(struct igb_adapter *adapter) | |||
3886 | break; | 3888 | break; |
3887 | } | 3889 | } |
3888 | 3890 | ||
3891 | if (((hw->mac.type == e1000_i210) || | ||
3892 | (hw->mac.type == e1000_i211)) && | ||
3893 | (hw->phy.id == I210_I_PHY_ID)) { | ||
3894 | if (!netif_carrier_ok(adapter->netdev)) { | ||
3895 | adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE; | ||
3896 | } else if (!(adapter->flags & IGB_FLAG_NEED_LINK_UPDATE)) { | ||
3897 | adapter->flags |= IGB_FLAG_NEED_LINK_UPDATE; | ||
3898 | adapter->link_check_timeout = jiffies; | ||
3899 | } | ||
3900 | } | ||
3901 | |||
3889 | return link_active; | 3902 | return link_active; |
3890 | } | 3903 | } |
3891 | 3904 | ||
@@ -3930,6 +3943,14 @@ static void igb_watchdog_task(struct work_struct *work) | |||
3930 | int i; | 3943 | int i; |
3931 | 3944 | ||
3932 | link = igb_has_link(adapter); | 3945 | link = igb_has_link(adapter); |
3946 | |||
3947 | if (adapter->flags & IGB_FLAG_NEED_LINK_UPDATE) { | ||
3948 | if (time_after(jiffies, (adapter->link_check_timeout + HZ))) | ||
3949 | adapter->flags &= ~IGB_FLAG_NEED_LINK_UPDATE; | ||
3950 | else | ||
3951 | link = false; | ||
3952 | } | ||
3953 | |||
3933 | if (link) { | 3954 | if (link) { |
3934 | /* Cancel scheduled suspend requests. */ | 3955 | /* Cancel scheduled suspend requests. */ |
3935 | pm_runtime_resume(netdev->dev.parent); | 3956 | pm_runtime_resume(netdev->dev.parent); |
@@ -4054,9 +4075,14 @@ static void igb_watchdog_task(struct work_struct *work) | |||
4054 | igb_ptp_rx_hang(adapter); | 4075 | igb_ptp_rx_hang(adapter); |
4055 | 4076 | ||
4056 | /* Reset the timer */ | 4077 | /* Reset the timer */ |
4057 | if (!test_bit(__IGB_DOWN, &adapter->state)) | 4078 | if (!test_bit(__IGB_DOWN, &adapter->state)) { |
4058 | mod_timer(&adapter->watchdog_timer, | 4079 | if (adapter->flags & IGB_FLAG_NEED_LINK_UPDATE) |
4059 | round_jiffies(jiffies + 2 * HZ)); | 4080 | mod_timer(&adapter->watchdog_timer, |
4081 | round_jiffies(jiffies + HZ)); | ||
4082 | else | ||
4083 | mod_timer(&adapter->watchdog_timer, | ||
4084 | round_jiffies(jiffies + 2 * HZ)); | ||
4085 | } | ||
4060 | } | 4086 | } |
4061 | 4087 | ||
4062 | enum latency_range { | 4088 | enum latency_range { |