netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolai Zhubr <zhubr.2@gmail.com>
To: Chris Snook <chris.snook@gmail.com>,
	netdev@vger.kernel.org, Johannes Berg <johannes@sipsolutions.net>,
	nic-devel@qualcomm.com
Subject: A problem with "ip=..." ipconfig and Atheros alx driver.
Date: Fri, 30 Apr 2021 14:59:30 +0300	[thread overview]
Message-ID: <608BF122.7050307@gmail.com> (raw)

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

             reply	other threads:[~2021-04-30 11:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 11:59 Nikolai Zhubr [this message]
2021-04-30 12:08 ` A problem with "ip=..." ipconfig and Atheros alx driver 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=608BF122.7050307@gmail.com \
    --to=zhubr.2@gmail.com \
    --cc=chris.snook@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=netdev@vger.kernel.org \
    --cc=nic-devel@qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).