From: Birger Koblitz <mail@birger-koblitz.de>
To: Linmao Li <lilinmao@kylinos.cn>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Chih Kai Hsu <hsu.chih.kai@realtek.com>,
nic_swsd@realtek.com, Xiangqian Zhang <zhangxiangqian@kylinos.cn>,
linux-usb@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH net v2] r8152: Use BMSR to detect the link state
Date: Mon, 5 Oct 2026 20:32:35 +0200 [thread overview]
Message-ID: <ee122a12-eae8-40a6-bad9-086228ae76f2@birger-koblitz.de> (raw)
In-Reply-To: <20261005105249.1281648-1-lilinmao@kylinos.cn>
Hi Linmao,
On 05/10/2026 12:52 pm, Linmao Li wrote:
> r8152 detects carrier from PLA_PHYSTATUS without reading BMSR, so
> BMSR_LSTATUS can still be latched low when the carrier comes up.
> Since commit f6f2e946aa4d ("net: mii: Fix the Speed display when the
> network cable is not connected"), the first speed query after link up
> can then report SPEED_UNKNOWN, leaving NetworkManager at 0 Mb/s until
> the next carrier change.
>
> Use BMSR_LSTATUS in set_carrier() and rtl8152_runtime_resume(), so the
> driver consumes the latched link down itself. If the first read still
> reports link down, the next link-up notification triggers another read
> and brings the carrier up.
>
> Tested on an RTL8153B with a 6.6-based kernel. In 5 rebinds and 6 cable
> replugs, the first read returned LSTATUS=0, a second link-up
> notification came about 32 ms later, the second read returned
> LSTATUS=1 and the carrier went up; NetworkManager reported 1000 Mb/s.
> Runtime suspend/resume with the link up did not change the carrier.
I have been trying to reproduce the issue with the following adapter:
driver: r8152
version: 7.1.8+deb13-amd64
firmware-version: rtl8153a-4 v2 02/07/20
But I am not able to do so. Both after a link-up after a plugin event
and after a system resume, ethtool always reports that the correct link
speed and state. Could you explain, what you actually do, exactly? Or is
the wrong link information only there for 32ms and I am just too slow?
Birger
next prev parent reply other threads:[~2026-10-05 18:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 10:52 Linmao Li
2026-10-05 18:32 ` Birger Koblitz [this message]
2026-10-06 8:28 ` Hayes Wang
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=ee122a12-eae8-40a6-bad9-086228ae76f2@birger-koblitz.de \
--to=mail@birger-koblitz.de \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hsu.chih.kai@realtek.com \
--cc=kuba@kernel.org \
--cc=lilinmao@kylinos.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
--cc=zhangxiangqian@kylinos.cn \
/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
all inboxes | Powered by JetHome®