Netdev List
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	David Miller <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net] net: ethernet: xgbe: re-add aneg to supported features in PHY quirks
Date: Sun, 12 Jan 2025 23:02:56 +0100	[thread overview]
Message-ID: <aaed764f-3e55-4463-bdb5-9f8b7fca5907@gmail.com> (raw)
In-Reply-To: <46521973-7738-4157-9f5e-0bb6f694acba@gmail.com>

On 12.01.2025 22:59, Heiner Kallweit wrote:
> In 4.19, before the switch to linkmode bitmaps, PHY_GBIT_FEATURES
> included feature bits for aneg and TP/MII ports.
> 
> 				 SUPPORTED_TP | \
> 				 SUPPORTED_MII)
> 
> 				 SUPPORTED_10baseT_Full)
> 
> 				 SUPPORTED_100baseT_Full)
> 
> 				 SUPPORTED_1000baseT_Full)
> 
> 				 PHY_100BT_FEATURES | \
> 				 PHY_DEFAULT_FEATURES)
> 
> 				 PHY_1000BT_FEATURES)
> 
> Referenced commit expanded PHY_GBIT_FEATURES, silently removing
> PHY_DEFAULT_FEATURES. The removed part can be re-added by using
> the new PHY_GBIT_FEATURES definition.
> Not clear to me is why nobody seems to have noticed this issue.
> 
> I stumbled across this when checking what it takes to make
> phy_10_100_features_array et al private to phylib.
> 
> Fixes: d0939c26c53a ("net: ethernet: xgbe: expand PHY_GBIT_FEAUTRES")
> Cc: stable@vger.kernel.org
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 19 ++-----------------
>  1 file changed, 2 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> index 6a716337f..268399dfc 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
> @@ -923,7 +923,6 @@ static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)
>  
>  static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
>  {
> -	__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
>  	struct xgbe_phy_data *phy_data = pdata->phy_data;
>  	unsigned int phy_id = phy_data->phydev->phy_id;
>  
> @@ -945,14 +944,7 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
>  	phy_write(phy_data->phydev, 0x04, 0x0d01);
>  	phy_write(phy_data->phydev, 0x00, 0x9140);
>  
> -	linkmode_set_bit_array(phy_10_100_features_array,
> -			       ARRAY_SIZE(phy_10_100_features_array),
> -			       supported);
> -	linkmode_set_bit_array(phy_gbit_features_array,
> -			       ARRAY_SIZE(phy_gbit_features_array),
> -			       supported);
> -
> -	linkmode_copy(phy_data->phydev->supported, supported);
> +	linkmode_copy(phy_data->phydev->supported, PHY_GBIT_FEATURES);
>  
>  	phy_support_asym_pause(phy_data->phydev);
>  
> @@ -964,7 +956,6 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
>  
>  static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
>  {
> -	__ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, };
>  	struct xgbe_phy_data *phy_data = pdata->phy_data;
>  	struct xgbe_sfp_eeprom *sfp_eeprom = &phy_data->sfp_eeprom;
>  	unsigned int phy_id = phy_data->phydev->phy_id;
> @@ -1028,13 +1019,7 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
>  	reg = phy_read(phy_data->phydev, 0x00);
>  	phy_write(phy_data->phydev, 0x00, reg & ~0x00800);
>  
> -	linkmode_set_bit_array(phy_10_100_features_array,
> -			       ARRAY_SIZE(phy_10_100_features_array),
> -			       supported);
> -	linkmode_set_bit_array(phy_gbit_features_array,
> -			       ARRAY_SIZE(phy_gbit_features_array),
> -			       supported);
> -	linkmode_copy(phy_data->phydev->supported, supported);
> +	linkmode_copy(phy_data->phydev->supported, PHY_GBIT_FEATURES);
>  	phy_support_asym_pause(phy_data->phydev);
>  
>  	netif_dbg(pdata, drv, pdata->netdev,

+ Shyam Sundar S K <Shyam-sundar.S-k@amd.com>

  reply	other threads:[~2025-01-12 22:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-12 21:59 [PATCH net] net: ethernet: xgbe: re-add aneg to supported features in PHY quirks Heiner Kallweit
2025-01-12 22:02 ` Heiner Kallweit [this message]
2025-01-15 21:40 ` 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=aaed764f-3e55-4463-bdb5-9f8b7fca5907@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --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