Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Andrew Lunn <andrew@lunn.ch>,
	nic_swsd@realtek.com, Heiner Kallweit <hkallweit1@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Dennis Piecha <d.piecha@ymail.com>,
	stable@vger.kernel.org, kernel@pengutronix.de,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net v1 1/1] r8169: disable EEE on RTL8168h/8111h
Date: Sun, 6 Dec 2026 11:51:59 +0100	[thread overview]
Message-ID: <2067aeab-87bc-440f-bed0-d3e20087c129@bootlin.com> (raw)
In-Reply-To: <axU4o2GTunolflVr@pengutronix.de>

Hey,

On 12/6/26 11:27, Oleksij Rempel wrote:
> Hi Maxime,
> 
> On Sun, Dec 06, 2026 at 08:09:02AM +0100, Maxime Chevallier wrote:
>> Hi Oleskij, Dennis,
>>
>> On 9/25/26 09:10, Oleksij Rempel wrote:
>>> Force EEE off on the RTL8168h/8111h (RTL_GIGA_MAC_VER_46) at PHY connect
>>> with phy_disable_eee().
>>>
>>> Commit 202fef9bbbf5 ("net: phy: realtek: fix EEE advertisement write on
>>> the internal PHY MMD path") made EEE actually advertise on the generic
>>> Realtek PHY; the write had been a no-op before. On the RTL8168h that
>>> un-masks a latent defect: once EEE negotiates, RX silently stalls after
>>> ~7-20 minutes. The carrier stays up, no counter or dmesg moves, and only
>>> "ip link set down/up" recovers it; disabling EEE keeps the link stable.
>>>
>>> Root-causing the RTL8168h LPI/RX path needs hardware not available now, so
>>> disable EEE for this version. Use phy_disable_eee() rather than dropping
>>> the version from rtl_supports_eee(): the latter also skips
>>> rtl_enable_tx_lpi(), whose disable branch clears the MAC TX-LPI bits (ERI
>>> 0x1b0[1:0]) on link up. rtl_hw_start_8168h_1() does not clear them (the
>>> RTL8402/RTL8106e init does), so a warm reboot from an EEE-active state
>>> could otherwise leave TX-LPI asserted while the PHY no longer negotiates
>>> EEE. Keeping the version EEE-capable preserves that clear path. This also
>>> covers the RTL8168M, which shares RTL_GIGA_MAC_VER_46.
>>
>> I recently got a bunch of quad-ports RTL8168h/8111h cards with the same version
>> info that you report, and I'm using these to test EEE kselftests I'm planning
>> to upstream next week.
> 
> Thx for diving into it!
> 
>> I tried to reproduce this issue with multiple peers :
>>  - Intel i350 (igb driver)
>>  - mvpp2 + marvell 88e1510 PHY
>>  - mvneta + 88e6341 switch and its internal PHY
>>  - mvneta + 88e6176 switch and its PHY
> 
> I would recommend to use some device having a LPI counter, which report
> amount of transactions to the Low Power Idle mode (and/or reporting time
> spent in the LPI). For example LAN7850 support it.

It does enter LPI, running with devices that have counters show that we're
basically entering LPI after every frame

> Otherwise, you will need to attach oscilloscope and measure signal on
> the MDI side. Active EEE will be visible without any advanced equipment.
> 
> See:
> https://youtu.be/jfm0GoPu3jM?si=wHtlgta6Qt2zeJM3&t=1185
> 
>> I tested multiple loads: just pings, high-throughput tests with iperf3, mix of
>> UDP + TCP +  random delays, this has been running for multiple hours each with
>> this patch reverted, and I didn't reproduce any of these stalls.
> 
> The combination of tx-timer configurations and link-speed should be correct.
> In the 1000Mbit mode, the link will be switched to the LPI , only if
> both timers on both link sides are agree. Means, if peer A has short
> tx-timer and other side has long or infinite timer, then LPI well be
> never activated. Active EEE do not mean active LPI.

Yeah in my case I have 12µs on the realtek side, and 0 on the other end

> 
> In 100Mbit mode, we will get separate LPI behavior on each pair. And
> may be higher chance to trigger something.

Ah, haven't tried at 100M, maybe it will show a different behaviour !

> 
>> Any chance the original problem was on the link-partner side maybe ?
> 
> It can be very high chance.
> 
> Other questions is, if the system has external or internal PHY. If
> external, do it has active SmartEEE?

good question, I haven't considered these phy-side EEE with SmartEEE
or grEEEn stuff.

> 
>> What was the partner's HW (PHY + MAC) in that case, and what kind of traffic
>> did you use to trigger that ?
> 
> I guess, any traffic with measurable LPI effects. If you can measure
> MAC+PHY power consumption (or at leas system wide power) it will be
> great.
> 
> Except of this, I can imagine that cable length and/or injected noise
> can trigger some of issues.
> 
>> It's not very urgent on my side, I have enough i350 ports to run the stmmac CI and
>> the eee tests when they land, but TBH the realtek cards are cheaper, and if I could
>> use these in my setup to test EEE that'd be awesome :)
>>
>> In the meantime, I'll keep running long tests with this patch reverted, see if I can
>> reproduce that...
> 
> Probably you will need to monitor link drop counts and any kind of
> packet drops (corruptions too).

I'll test with even more peers, speeds, LPI timer configs and see if I can
see anything then, thanks a lot for the tips,

Maxime

> 
> Best Regards,
> Oleksij


      reply	other threads:[~2026-12-06 10:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  7:10 [PATCH net v1 1/1] r8169: disable EEE on RTL8168h/8111h Oleksij Rempel
2026-10-01  0:30 ` patchwork-bot+netdevbpf
2026-10-06 11:19   ` Dennis Piecha
2026-10-07  6:01     ` Heiner Kallweit
2026-10-10  6:16       ` Sasha Levin
2026-12-06  7:09 ` Maxime Chevallier
2026-12-06 10:27   ` Oleksij Rempel
2026-12-06 10:51     ` Maxime Chevallier [this message]

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=2067aeab-87bc-440f-bed0-d3e20087c129@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=d.piecha@ymail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    /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