[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z1gQ0O8dbUl26JTc@shell.armlinux.org.uk>
Date: Tue, 10 Dec 2024 09:58:40 +0000
From: "Russell King (Oracle)" <linux@...linux.org.uk>
To: Andrew Lunn <andrew@...n.ch>
Cc: Heiner Kallweit <hkallweit1@...il.com>,
Andrew Lunn <andrew+netdev@...n.ch>,
Bryan Whitehead <bryan.whitehead@...rochip.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Marcin Wojtas <marcin.s.wojtas@...il.com>, netdev@...r.kernel.org,
Paolo Abeni <pabeni@...hat.com>, UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next 06/10] net: phylink: allow MAC driver to
validate eee params
On Tue, Dec 10, 2024 at 04:21:51AM +0100, Andrew Lunn wrote:
> > +/**
> > + * mac_validate_tx_lpi() - validate the LPI parameters in EEE
> > + * @config: a pointer to a &struct phylink_config.
> > + * @e: EEE configuration to be validated.
> > + *
> > + * Validate the LPI configuration parameters in @e, returning an appropriate
> > + * error. This will be called prior to any changes being made, and must not
> > + * make any changes to existing configuration. Returns zero on success.
>
> Maybe suggest -EOPNOTSUPP? We might then get more uniform error codes
> from MAC drivers?
-EOPNOTSUPP would be appropriate if the driver doesn't support EEE at
all. Other errors are more appropriate when validating the value of
the parameters (e.g. tx_lpi_timer.)
However, we probably need to have a discussion about the best way to
handle tx_lpi_timer values that the hardware can't deal with. Should we
handle it with a hrtimer? If so, we probably need mac_enable_tx_lpi() to
return an error code, so that the core knows that the hardware can't
cope with the value at a particular speed, and needs to switch to a
software timer (I'm not currently sure how complex that would be to
implement, but I think stmmac takes this approach.)
That could make mac_validate_tx_lpi() redundant, but then I have a
stack of DSA patches that could use this callback to indicate that
EEE is not supported.
I don't have all the answers for this, so I was hoping to kick off a
discussion in the RFC patchset before submitting something that could
be merged, but that didn't happen.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Powered by blists - more mailing lists