Netdev List
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Wilkins, Stephen" <Stephen.Wilkins@teledyne.com>
Cc: Conor Dooley <conor@kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Conor Dooley <conor.dooley@microchip.com>,
	"valentina.fernandezalanis@microchip.com"
	<valentina.fernandezalanis@microchip.com>,
	Nicolas Ferre <nicolas.ferre@microchip.com>,
	Claudiu Beznea <claudiu.beznea@tuxon.dev>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC net-next] net: macb: add support for configuring eee via ethtool
Date: Wed, 28 Aug 2024 18:18:59 +0200	[thread overview]
Message-ID: <08d191dd-bc70-4292-8031-d1d41036e731@lunn.ch> (raw)
In-Reply-To: <AM0PR04MB41316B50F68C83A73E57A82F89952@AM0PR04MB4131.eurprd04.prod.outlook.com>

On Wed, Aug 28, 2024 at 03:47:21PM +0000, Wilkins, Stephen wrote:
> Thanks for the feedback.
> 
> In my particular use-case I wanted to ensure the PHY didn't advertise EEE
> support, as it can cause issues in our deployment environment. The problem I
> had was the PHY we are using enables EEE advertisement by default, and the
> generic phy support in phy_device.c reads the c45 registers and enables EEE if
> there are any linkmodes already advertised. Without the phylink hook in macb, I
> couldn't use ethtool to disable it, but I now see my patch is only a partial
> solution and would also imply support that is missing. That's why code reviews
> are important. Maybe I need an alternative approach for ensuring the PHY
> advertising is disabled if the MAC layer support is missing. 

In this particular case, do you know what is causing you problems?

I agree that if the MAC does not support EEE, the PHY should not be
advertising it. But historically EEE has been a mess. It could be the
MAC does EEE by default, using default settings, and the PHY is
advertising EEE, and the link partner is happy, and EEE just works. So
if we turn advertisement of EEE off by default, we might cause
regressions :-(

Now, we know some PHYs are actually broken. And we have a standard way
to express this:

Documentation/devicetree/bindings/net/ethernet-phy.yaml

  eee-broken-100tx:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Mark the corresponding energy efficient ethernet mode as
      broken and request the ethernet to stop advertising it.

  eee-broken-1000t:
    $ref: /schemas/types.yaml#/definitions/flag
    description:
      Mark the corresponding energy efficient ethernet mode as
      broken and request the ethernet to stop advertising it.

If you know this MAC/PHY combination really is broken, not that it is
just missing support for EEE, you could add these properties to your
device tree.

Otherwise, you do a very minimal EEE implementation. After connecting
to the PHY call phy_ethtool_set_eee() with everything in data set to
0. That should disable adverting of EEE.

	Andrew

  parent reply	other threads:[~2024-08-28 16:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 11:29 [RFC net-next] net: macb: add support for configuring eee via ethtool Conor Dooley
2024-08-27 15:29 ` Andrew Lunn
     [not found]   ` <AM0PR04MB41316B50F68C83A73E57A82F89952@AM0PR04MB4131.eurprd04.prod.outlook.com>
2024-08-28 16:18     ` Andrew Lunn [this message]
2024-08-28 17:00       ` Wilkins, Stephen

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=08d191dd-bc70-4292-8031-d1d41036e731@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Stephen.Wilkins@teledyne.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=conor.dooley@microchip.com \
    --cc=conor@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    --cc=valentina.fernandezalanis@microchip.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