From: Ioana Ciornei <ioana.ciornei@nxp.com>
To: Russell King <rmk+kernel@armlinux.org.uk>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Heiner Kallweit <hkallweit1@gmail.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandru Marginean <alexandru.marginean@nxp.com>,
"michael@walle.cc" <michael@walle.cc>,
"olteanv@gmail.com" <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH RFC net-next 09/13] net: phylink: simplify fixed-link case for ksettings_set method
Date: Mon, 20 Jul 2020 10:52:56 +0000 [thread overview]
Message-ID: <VI1PR0402MB38719CABD380FD58CA113DC2E07B0@VI1PR0402MB3871.eurprd04.prod.outlook.com> (raw)
In-Reply-To: E1jqHG9-0006Pj-2J@rmk-PC.armlinux.org.uk
On 6/30/20 5:29 PM, Russell King wrote:
> For fixed links, we only allow the current settings, so this should be
> a matter of merely rejecting an attempt to change the settings. If the
> settings agree, then there is nothing more we need to do.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
> ---
> drivers/net/phy/phylink.c | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 967c068d16c8..b91151062cdc 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -1360,22 +1360,31 @@ int phylink_ethtool_ksettings_set(struct phylink *pl,
> if (!s)
> return -EINVAL;
>
> - /* If we have a fixed link (as specified by firmware), refuse
> - * to change link parameters.
> + /* If we have a fixed link, refuse to change link parameters.
> + * If the link parameters match, accept them but do nothing.
> */
> - if (pl->cur_link_an_mode == MLO_AN_FIXED &&
> - (s->speed != pl->link_config.speed ||
> - s->duplex != pl->link_config.duplex))
> - return -EINVAL;
> + if (pl->cur_link_an_mode == MLO_AN_FIXED) {
> + if (s->speed != pl->link_config.speed ||
> + s->duplex != pl->link_config.duplex)
> + return -EINVAL;
> + return 0;
> + }
>
> config.speed = s->speed;
> config.duplex = s->duplex;
> break;
>
> case AUTONEG_ENABLE:
> - /* If we have a fixed link, refuse to enable autonegotiation */
> - if (pl->cur_link_an_mode == MLO_AN_FIXED)
> - return -EINVAL;
> + /* If we have a fixed link, allow autonegotiation (since that
> + * is our default case) but do not allow the advertisement to
> + * be changed. If the advertisement matches, simply return.
> + */
> + if (pl->cur_link_an_mode == MLO_AN_FIXED) {
> + if (!linkmode_equal(config.advertising,
> + pl->link_config.advertising))
> + return -EINVAL;
> + return 0;
> + }
>
> config.speed = SPEED_UNKNOWN;
> config.duplex = DUPLEX_UNKNOWN;
> @@ -1385,8 +1394,8 @@ int phylink_ethtool_ksettings_set(struct phylink *pl,
> return -EINVAL;
> }
>
> - /* For a fixed link, this isn't able to change any parameters,
> - * which just leaves inband mode.
> + /* We have ruled out the case with a PHY attached, and the
> + * fixed-link cases. All that is left are in-band links.
> */
> if (phylink_validate(pl, support, &config))
> return -EINVAL;
>
next prev parent reply other threads:[~2020-07-20 10:53 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-30 14:27 [PATCH RFC net-next 00/13] Phylink PCS updates Russell King - ARM Linux admin
2020-06-30 14:28 ` [PATCH RFC net-next 01/13] net: phylink: update ethtool reporting for fixed-link modes Russell King
2020-06-30 18:15 ` Florian Fainelli
2020-06-30 14:28 ` [PATCH RFC net-next 02/13] net: phylink: rejig link state tracking Russell King
2020-06-30 18:15 ` Florian Fainelli
2020-06-30 14:28 ` [PATCH RFC net-next 03/13] net: phylink: rearrange resolve mac_config() call Russell King
2020-06-30 18:32 ` Florian Fainelli
2020-06-30 14:28 ` [PATCH RFC net-next 04/13] net: phylink: ensure link is down when changing interface Russell King
2020-06-30 18:32 ` Florian Fainelli
2020-06-30 14:28 ` [PATCH RFC net-next 05/13] net: phylink: update PCS when changing interface during resolution Russell King
2020-06-30 18:33 ` Florian Fainelli
2020-06-30 14:29 ` [PATCH RFC net-next 06/13] net: phylink: avoid mac_config calls Russell King
2020-06-30 19:04 ` Florian Fainelli
2020-06-30 14:29 ` [PATCH RFC net-next 07/13] net: phylink: simplify ksettings_set() implementation Russell King
2020-07-20 10:24 ` Ioana Ciornei
2020-06-30 14:29 ` [PATCH RFC net-next 08/13] net: phylink: simplify phy case for ksettings_set method Russell King
2020-07-20 10:44 ` Ioana Ciornei
2020-07-20 12:45 ` Russell King - ARM Linux admin
2020-06-30 14:29 ` [PATCH RFC net-next 09/13] net: phylink: simplify fixed-link " Russell King
2020-07-20 10:52 ` Ioana Ciornei [this message]
2020-06-30 14:29 ` [PATCH RFC net-next 10/13] net: phylink: in-band pause mode advertisement update for PCS Russell King
2020-06-30 16:19 ` Jakub Kicinski
2020-06-30 14:29 ` [PATCH RFC net-next 11/13] net: phylink: re-implement interface configuration with PCS Russell King
2020-07-20 11:40 ` Ioana Ciornei
2020-07-20 12:44 ` Russell King - ARM Linux admin
2020-07-20 13:02 ` Ioana Ciornei
2020-07-20 14:19 ` Russell King - ARM Linux admin
2020-06-30 14:29 ` [PATCH RFC net-next 12/13] net: phylink: add struct phylink_pcs Russell King
2020-07-01 10:47 ` Vladimir Oltean
2020-07-01 11:16 ` Russell King - ARM Linux admin
2020-07-01 11:24 ` Vladimir Oltean
2020-07-20 15:50 ` Ioana Ciornei
2020-07-20 16:26 ` Russell King - ARM Linux admin
2020-07-20 16:59 ` Ioana Ciornei
2020-07-20 18:16 ` Russell King - ARM Linux admin
2020-06-30 14:29 ` [PATCH RFC net-next 13/13] net: phylink: add interface to configure clause 22 PCS PHY Russell King
2020-07-01 10:52 ` Ioana Ciornei
2020-07-14 8:49 ` [PATCH RFC net-next 00/13] Phylink PCS updates Vladimir Oltean
2020-07-14 13:18 ` Russell King - ARM Linux admin
2020-07-14 21:22 ` Florian Fainelli
2020-07-15 9:53 ` Russell King - ARM Linux admin
2020-07-14 23:46 ` Vladimir Oltean
2020-07-15 11:21 ` Russell King - ARM Linux admin
2020-07-15 11:34 ` Russell King - ARM Linux admin
2020-07-15 12:31 ` Vladimir Oltean
2020-07-15 14:20 ` Andrew Lunn
2020-07-15 17:02 ` Russell King - ARM Linux admin
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=VI1PR0402MB38719CABD380FD58CA113DC2E07B0@VI1PR0402MB3871.eurprd04.prod.outlook.com \
--to=ioana.ciornei@nxp.com \
--cc=alexandru.marginean@nxp.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=michael@walle.cc \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=vladimir.oltean@nxp.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).