r8169: fix nic may not work after changing mac address.
authorChun-Hao Lin <hau@realtek.com>
Fri, 29 Jul 2016 08:37:56 +0000 (16:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 1 Aug 2016 03:34:05 +0000 (20:34 -0700)
commitf51d4a10ac39ecf06b25e7a79121b06f7ed59928
treee27a66c4682946d46d9baac387c3f299527108b4
parente06362369ae1e5b0ba70b66f8703ff08bcb63b23
r8169: fix nic may not work after changing mac address.

When there is no AC power, NIC may not work after changing mac address.
Please refer to following link.
http://www.spinics.net/lists/netdev/msg356572.html

This issue is caused by runtime power management. When there is no AC
power, if we put NIC down (ifconfig down), the driver will be in runtime
suspend state and hardware will be put into D3 state. During this time,
driver cannot access hardware regisers. So if you set new mac address
during this time, it will not be set to hardware. After resume, NIC will
keep using the old mac address and the network will not work normally.

In this patch I add detecting runtime pm status when setting mac address.
If driver is in runtime suspend state, it will skip setting mac address, keep
the new mac address, and set the new mac address during runtime resume.

Signed-off-by: Chunhao Lin <hau@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169.c
This page took 0.029404 seconds and 5 git commands to generate.