diff mbox series

[net] net: lan966x: Fix port configuration when using SGMII interface

Message ID 20240123081514.3625293-1-horatiu.vultur@microchip.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net] net: lan966x: Fix port configuration when using SGMII interface | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success SINGLE THREAD; Generated files up to date; no warnings/errors; no diff in generated;
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: 1077 this patch: 1077
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 1095 this patch: 1095
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: 1095 this patch: 1095
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 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
netdev/contest success net-next-2024-01-23--21-00 (tests: 494)

Commit Message

Horatiu Vultur Jan. 23, 2024, 8:15 a.m. UTC
In case the interface between the MAC and the PHY is SGMII, then the bit
GIGA_MODE on the MAC side needs to be set regardless of the speed at
which it is running.

Fixes: d28d6d2e37d1 ("net: lan966x: add port module support")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_port.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Maxime Chevallier Jan. 23, 2024, 8:48 a.m. UTC | #1
Hello Horatiu,

On Tue, 23 Jan 2024 09:15:14 +0100
Horatiu Vultur <horatiu.vultur@microchip.com> wrote:

> In case the interface between the MAC and the PHY is SGMII, then the bit
> GIGA_MODE on the MAC side needs to be set regardless of the speed at
> which it is running.
> 
> Fixes: d28d6d2e37d1 ("net: lan966x: add port module support")
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  drivers/net/ethernet/microchip/lan966x/lan966x_port.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
> index 92108d354051c..975a6d64a2e18 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
> @@ -170,7 +170,8 @@ static void lan966x_port_link_up(struct lan966x_port *port)
>  	/* Also the GIGA_MODE_ENA(1) needs to be set regardless of the
>  	 * port speed for QSGMII ports.

Small nit, I think this comment above the test could also be updated to
reflect that change.

>  	 */
> -	if (phy_interface_num_ports(config->portmode) == 4)
> +	if (phy_interface_num_ports(config->portmode) == 4 ||
> +	    config->portmode == PHY_INTERFACE_MODE_SGMII)
>  		mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA_SET(1);
>  
>  	lan_wr(config->duplex | mode,

Besides that,

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Thanks,

Maxime
Horatiu Vultur Jan. 23, 2024, 10:03 a.m. UTC | #2
The 01/23/2024 09:48, Maxime Chevallier wrote:
> 
> Hello Horatiu,

Hi Maxime,

> 
> On Tue, 23 Jan 2024 09:15:14 +0100
> Horatiu Vultur <horatiu.vultur@microchip.com> wrote:
> 
> > In case the interface between the MAC and the PHY is SGMII, then the bit
> > GIGA_MODE on the MAC side needs to be set regardless of the speed at
> > which it is running.
> >
> > Fixes: d28d6d2e37d1 ("net: lan966x: add port module support")
> > Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> > ---
> >  drivers/net/ethernet/microchip/lan966x/lan966x_port.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
> > index 92108d354051c..975a6d64a2e18 100644
> > --- a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
> > +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
> > @@ -170,7 +170,8 @@ static void lan966x_port_link_up(struct lan966x_port *port)
> >       /* Also the GIGA_MODE_ENA(1) needs to be set regardless of the
> >        * port speed for QSGMII ports.
> 
> Small nit, I think this comment above the test could also be updated to
> reflect that change.

Ah... yes, you are right. I will update this in the next version.

> 
> >        */
> > -     if (phy_interface_num_ports(config->portmode) == 4)
> > +     if (phy_interface_num_ports(config->portmode) == 4 ||
> > +         config->portmode == PHY_INTERFACE_MODE_SGMII)
> >               mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA_SET(1);
> >
> >       lan_wr(config->duplex | mode,
> 
> Besides that,
> 
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> 
> Thanks,
> 
> Maxime
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
index 92108d354051c..975a6d64a2e18 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_port.c
@@ -170,7 +170,8 @@  static void lan966x_port_link_up(struct lan966x_port *port)
 	/* Also the GIGA_MODE_ENA(1) needs to be set regardless of the
 	 * port speed for QSGMII ports.
 	 */
-	if (phy_interface_num_ports(config->portmode) == 4)
+	if (phy_interface_num_ports(config->portmode) == 4 ||
+	    config->portmode == PHY_INTERFACE_MODE_SGMII)
 		mode = DEV_MAC_MODE_CFG_GIGA_MODE_ENA_SET(1);
 
 	lan_wr(config->duplex | mode,