netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* A problem with "ip=..." ipconfig and Atheros alx driver.
@ 2021-04-30 11:59 Nikolai Zhubr
  2021-04-30 12:08 ` Johannes Berg
  0 siblings, 1 reply; 9+ messages in thread
From: Nikolai Zhubr @ 2021-04-30 11:59 UTC (permalink / raw)
  To: Chris Snook, netdev, Johannes Berg, nic-devel

Hello Chris and others,

I'm observing a problem with Atheros alx ethernet driver and in-kernel 
ip4 configuration (using "ip=192.168....." boot parameter).

The problem first showed itself as a huge unexpected delay in bootup as 
long as "ip=..." was specified (and a real device is present). I've then 
noticed a timeout counter "Waiting up to 110 more seconds for network" 
between the "Atheros(R) AR816x/AR817x" message and "eth0: NIC Up: 1 Gbps 
Full" message. Meanwhile, this ethernet device is fully operational and 
my cable is perfectly reliable.

Now, after debugging it a little bit more, I've apparently found the 
root cause. One can see in net/ipv4/ipconfig.c that ic_open_devs() tries 
to ensure carrier is physically present. But before opening device(s) 
and starting wait for the carrier, it calls rtnl_lock(). Now in 
ethernet/atheros/alx/main.c one can see that at opening, it first calls 
netif_carrier_off() then schedules alx_link_check() to do actual work, 
so carrier detection is supposed to happen a bit later. Now looking at 
this alx_link_check() carefully, first thing is does is rtnl_lock(). 
Bingo! Double-lock. Effectively actual carrier check in alx is therefore 
delayed just until ic_open_devs() gave up waiting for it and called 
rtnl_unlock(). Hence this delay and timeout.

I have checked with clean 4.9.268 and 5.4.115 on real hardware.
Can't check with 5.12 at the moment because my gcc is somewhat old to 
compile it, but browsing the code it looks like nothing has changed 
substantially anyway.

Fixing this myself is a bit beyond my capability I'm afraid, but I'd be 
happy do some testing if someone requests me to.


Thank you,

Reagrds,
Nikolai

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-02 11:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-30 11:59 A problem with "ip=..." ipconfig and Atheros alx driver Nikolai Zhubr
2021-04-30 12:08 ` Johannes Berg
2021-04-30 17:15   ` Nikolai Zhubr
2021-04-30 19:02     ` Johannes Berg
2021-05-01  0:01       ` Nikolai Zhubr
2021-05-01 13:50         ` Nikolai Zhubr
2021-05-02  9:04           ` Johannes Berg
2021-05-02 10:28             ` Nikolai Zhubr
2021-05-02 11:22               ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).