netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>,
	Jakub Kicinski <kuba@kernel.org>,
	David Miller <davem@davemloft.net>,
	Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH RESUBMIT net-next] r8169: simplify EEE handling
Date: Fri, 2 Feb 2024 17:06:10 +0100	[thread overview]
Message-ID: <7122d90b-cdfe-4733-bfad-45ce63f75536@gmail.com> (raw)
In-Reply-To: <219c3309-e676-48e0-9a24-e03332b7b7b4@lunn.ch>

On 02.02.2024 14:12, Andrew Lunn wrote:
> On Fri, Feb 02, 2024 at 07:55:38AM +0100, Heiner Kallweit wrote:
>> On 02.02.2024 01:16, Andrew Lunn wrote:
>>>> @@ -5058,7 +5033,9 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
>>>>  	}
>>>>  
>>>>  	tp->phydev->mac_managed_pm = true;
>>>> -
>>>> +	if (rtl_supports_eee(tp))
>>>> +		linkmode_copy(tp->phydev->advertising_eee,
>>>> +			      tp->phydev->supported_eee);
>>>
>>> This looks odd. Does it mean something is missing on phylib?
>>>
>> Reason is that we treat "normal" advertising and EEE advertising differently
>> in phylib. See this code snippet from phy_probe().
>>
>>         phy_advertise_supported(phydev);
>>         /* Get PHY default EEE advertising modes and handle them as potentially
>>          * safe initial configuration.
>>          */
>>         err = genphy_c45_read_eee_adv(phydev, phydev->advertising_eee);
>>
>> For EEE we don't change the initial advertising to what's supported,
>> but preserve the EEE advertising at the time of phy probing.
>> So if I want to mimic the behavior of phy_advertise_supported() for EEE,
>> I have to populate advertising_eee in the driver.
> 
> So the device you are using is advertising less than what it supports?
> 
It may. If on a board with this chip version the BIOS for whatever reason
disabled EEE advertising, then users may complain that their system consumes
more power with r8169 than with r8125. Typical users don't necessarily
know that EEE exists and what it is, and how to enable it with ethtool.
Therefore I'd like to ensure that the supported EEE modes are also advertised.

>> Alternative would be to change phy_advertise_supported(), but this may
>> impact systems with PHY's with EEE flaws.
> 
> If i remember correctly, there was some worry enabling EEE by default
> could upset some low latency use cases, PTP accuracy etc. So lets
> leave it as it is. Maybe a helper would be useful
> phy_advertise_eee_all() with a comment about why it could be used.
> 
Yes, I think that's the way to go.
To minimize efforts I'd like to keep this patch here as it is, then I'll
add the helper and change this place in r8169 to use the new helper.

> 	Andrew
Heiner

  reply	other threads:[~2024-02-02 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-31 20:31 [PATCH RESUBMIT net-next] r8169: simplify EEE handling Heiner Kallweit
2024-02-02  0:16 ` Andrew Lunn
2024-02-02  6:55   ` Heiner Kallweit
2024-02-02 13:12     ` Andrew Lunn
2024-02-02 16:06       ` Heiner Kallweit [this message]
2024-02-02 16:15         ` Jakub Kicinski
2024-02-02 20:36           ` Heiner Kallweit
2024-02-03  5:10 ` patchwork-bot+netdevbpf

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=7122d90b-cdfe-4733-bfad-45ce63f75536@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    --cc=pabeni@redhat.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).