[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211011171759.2b59eb29@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 11 Oct 2021 17:17:59 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Sean Anderson <sean.anderson@...o.com>
Cc: netdev@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
Russell King <linux@...linux.org.uk>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Antoine Tenart <atenart@...nel.org>
Subject: Re: [PATCH v2 2/2] net: macb: Allow SGMII only if we are a GEM in
mac_validate
On Mon, 11 Oct 2021 12:55:17 -0400 Sean Anderson wrote:
> This aligns mac_validate with mac_config. In mac_config, SGMII is only
> enabled if macb_is_gem. Validate should care if the mac is a gem as
> well. This also simplifies the logic now that all gigabit modes depend
> on the mac being a GEM.
>
> Fixes: 7897b071ac3b ("net: macb: convert to phylink")
> Signed-off-by: Sean Anderson <sean.anderson@...o.com>
Please make sure you CC the author of the original patch, they tend to
be a good person to review the change. Or at the very least validate
the Fixes tag. Adding Antoine.
> drivers/net/ethernet/cadence/macb_main.c | 22 +++++++++-------------
> 1 file changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index a9105ec1b885..ae8c969a609c 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -534,22 +534,18 @@ static void macb_validate(struct phylink_config *config,
> case PHY_INTERFACE_MODE_RGMII_ID:
> case PHY_INTERFACE_MODE_RGMII_RXID:
> case PHY_INTERFACE_MODE_RGMII_TXID:
> - if (!macb_is_gem(bp)) {
> - if (one)
> - goto none;
> - else
> - goto mii;
> - }
> - fallthrough;
> case PHY_INTERFACE_MODE_SGMII:
> - if (bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE) {
> - phylink_set(mask, 1000baseT_Full);
> - phylink_set(mask, 1000baseX_Full);
> - if (!(bp->caps & MACB_CAPS_NO_GIGABIT_HALF))
> - phylink_set(mask, 1000baseT_Half);
> + if (macb_is_gem(bp)) {
> + if (bp->caps & MACB_CAPS_GIGABIT_MODE_AVAILABLE) {
> + phylink_set(mask, 1000baseT_Full);
> + phylink_set(mask, 1000baseX_Full);
> + if (!(bp->caps & MACB_CAPS_NO_GIGABIT_HALF))
> + phylink_set(mask, 1000baseT_Half);
> + }
> + } else if (one) {
> + goto none;
> }
> fallthrough;
> - mii:
> case PHY_INTERFACE_MODE_MII:
> case PHY_INTERFACE_MODE_RMII:
> phylink_set(mask, 10baseT_Half);
Powered by blists - more mailing lists