diff mbox series

[net,1/3] amd-xgbe: handle corner-case during sfp hotplug

Message ID 20231121191435.4049995-2-Raju.Rangoju@amd.com (mailing list archive)
State Accepted
Commit 676ec53844cbdf2f47e68a076cdff7f0ec6cbe3f
Delegated to: Netdev Maintainers
Headers show
Series amd-xgbe: fixes to handle corner-cases | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/codegen success Generated files up to date
netdev/tree_selection success Clearly marked for net
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1115 this patch: 1115
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 1142 this patch: 1142
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 1142 this patch: 1142
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Raju Rangoju Nov. 21, 2023, 7:14 p.m. UTC
Force the mode change for SFI in Fixed PHY configurations. Fixed PHY
configurations needs PLL to be enabled while doing mode set. When the
SFP module isn't connected during boot, driver assumes AN is ON and
attempts auto-negotiation. However, if the connected SFP comes up in
Fixed PHY configuration the link will not come up as PLL isn't enabled
while the initial mode set command is issued. So, force the mode change
for SFI in Fixed PHY configuration to fix link issues.

Fixes: e57f7a3feaef ("amd-xgbe: Prepare for working with more than one type of phy")
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
---
 drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

Comments

Wojciech Drewek Nov. 22, 2023, 10:31 a.m. UTC | #1
On 21.11.2023 20:14, Raju Rangoju wrote:
> Force the mode change for SFI in Fixed PHY configurations. Fixed PHY
> configurations needs PLL to be enabled while doing mode set. When the
> SFP module isn't connected during boot, driver assumes AN is ON and
> attempts auto-negotiation. However, if the connected SFP comes up in
> Fixed PHY configuration the link will not come up as PLL isn't enabled
> while the initial mode set command is issued. So, force the mode change
> for SFI in Fixed PHY configuration to fix link issues.
> 
> Fixes: e57f7a3feaef ("amd-xgbe: Prepare for working with more than one type of phy")
> Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
> Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
> ---

Thanks for our patches!
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>

>  drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> index 32d2c6fac652..4a2dc705b528 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> @@ -1193,7 +1193,19 @@ static int xgbe_phy_config_fixed(struct xgbe_prv_data *pdata)
>  	if (pdata->phy.duplex != DUPLEX_FULL)
>  		return -EINVAL;
>  
> -	xgbe_set_mode(pdata, mode);
> +	/* Force the mode change for SFI in Fixed PHY config.
> +	 * Fixed PHY configs needs PLL to be enabled while doing mode set.
> +	 * When the SFP module isn't connected during boot, driver assumes
> +	 * AN is ON and attempts autonegotiation. However, if the connected
> +	 * SFP comes up in Fixed PHY config, the link will not come up as
> +	 * PLL isn't enabled while the initial mode set command is issued.
> +	 * So, force the mode change for SFI in Fixed PHY configuration to
> +	 * fix link issues.
> +	 */
> +	if (mode == XGBE_MODE_SFI)
> +		xgbe_change_mode(pdata, mode);
> +	else
> +		xgbe_set_mode(pdata, mode);
>  
>  	return 0;
>  }
diff mbox series

Patch

diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
index 32d2c6fac652..4a2dc705b528 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
@@ -1193,7 +1193,19 @@  static int xgbe_phy_config_fixed(struct xgbe_prv_data *pdata)
 	if (pdata->phy.duplex != DUPLEX_FULL)
 		return -EINVAL;
 
-	xgbe_set_mode(pdata, mode);
+	/* Force the mode change for SFI in Fixed PHY config.
+	 * Fixed PHY configs needs PLL to be enabled while doing mode set.
+	 * When the SFP module isn't connected during boot, driver assumes
+	 * AN is ON and attempts autonegotiation. However, if the connected
+	 * SFP comes up in Fixed PHY config, the link will not come up as
+	 * PLL isn't enabled while the initial mode set command is issued.
+	 * So, force the mode change for SFI in Fixed PHY configuration to
+	 * fix link issues.
+	 */
+	if (mode == XGBE_MODE_SFI)
+		xgbe_change_mode(pdata, mode);
+	else
+		xgbe_set_mode(pdata, mode);
 
 	return 0;
 }