]> git.baikalelectronics.ru Git - kernel.git/commit
drivers/net/ftgmac100: fix DHCP potential failure with systemd
authorHeyi Guo <guoheyi@linux.alibaba.com>
Wed, 23 Feb 2022 03:14:36 +0000 (11:14 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Feb 2022 12:50:19 +0000 (12:50 +0000)
commit200a1fff1c6322c01c4443373133d804c40009d3
treedbb7471708acfeb3411a5574096f037e14bc5241
parent4be78f5600e8692ca6bb1dd78a10e3191c564dcf
drivers/net/ftgmac100: fix DHCP potential failure with systemd

DHCP failures were observed with systemd 247.6. The issue could be
reproduced by rebooting Aspeed 2600 and then running ifconfig ethX
down/up.

It is caused by below procedures in the driver:

1. ftgmac100_open() enables net interface and call phy_start()
2. When PHY is link up, it calls netif_carrier_on() and then
adjust_link callback
3. ftgmac100_adjust_link() will schedule the reset task
4. ftgmac100_reset_task() will then reset the MAC in another schedule

After step 2, systemd will be notified to send DHCP discover packet,
while the packet might be corrupted by MAC reset operation in step 4.

Call ftgmac100_reset() directly instead of scheduling task to fix the
issue.

Signed-off-by: Heyi Guo <guoheyi@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/faraday/ftgmac100.c