Skip to content

Commit e1ed3e4

Browse files
hkallweitdavem330
authored andcommitted
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: Kai-Heng Feng <[email protected]> Reviewed-by: Simon Horman <[email protected]> Tested-by: Kai-Heng Feng <[email protected]> Tested-by: Holger Hoffstätte <[email protected]> Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 49ef7d8 commit e1ed3e4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4577,6 +4577,10 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
45774577
}
45784578

45794579
if (napi_schedule_prep(&tp->napi)) {
4580+
rtl_unlock_config_regs(tp);
4581+
rtl_hw_aspm_clkreq_enable(tp, false);
4582+
rtl_lock_config_regs(tp);
4583+
45804584
rtl_irq_disable(tp);
45814585
__napi_schedule(&tp->napi);
45824586
}
@@ -4636,9 +4640,14 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
46364640

46374641
work_done = rtl_rx(dev, tp, budget);
46384642

4639-
if (work_done < budget && napi_complete_done(napi, work_done))
4643+
if (work_done < budget && napi_complete_done(napi, work_done)) {
46404644
rtl_irq_enable(tp);
46414645

4646+
rtl_unlock_config_regs(tp);
4647+
rtl_hw_aspm_clkreq_enable(tp, true);
4648+
rtl_lock_config_regs(tp);
4649+
}
4650+
46424651
return work_done;
46434652
}
46444653

0 commit comments

Comments
 (0)