Commit e1ed3e4d authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: disable ASPM during NAPI poll

Several chip versions have problems with ASPM, what may result in
rx_missed errors or tx timeouts. The root cause isn't known but
experience shows that disabling ASPM during NAPI poll can avoid
these problems.
Suggested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Tested-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
Tested-by: default avatarHolger Hoffstätte <holger@applied-asynchrony.com>
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 49ef7d84
...@@ -4577,6 +4577,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) ...@@ -4577,6 +4577,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
} }
if (napi_schedule_prep(&tp->napi)) { if (napi_schedule_prep(&tp->napi)) {
rtl_unlock_config_regs(tp);
rtl_hw_aspm_clkreq_enable(tp, false);
rtl_lock_config_regs(tp);
rtl_irq_disable(tp); rtl_irq_disable(tp);
__napi_schedule(&tp->napi); __napi_schedule(&tp->napi);
} }
...@@ -4636,9 +4640,14 @@ static int rtl8169_poll(struct napi_struct *napi, int budget) ...@@ -4636,9 +4640,14 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
work_done = rtl_rx(dev, tp, budget); work_done = rtl_rx(dev, tp, budget);
if (work_done < budget && napi_complete_done(napi, work_done)) if (work_done < budget && napi_complete_done(napi, work_done)) {
rtl_irq_enable(tp); rtl_irq_enable(tp);
rtl_unlock_config_regs(tp);
rtl_hw_aspm_clkreq_enable(tp, true);
rtl_lock_config_regs(tp);
}
return work_done; return work_done;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment