]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit031d4aa628f6b786776aac1a04999d0c71d48656
treee27a66c4682946d46d9baac387c3f299527108b4
parent06d97d368e5bfb015f86c78adc2c38e3a4561045
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