2024-01-23 08:17:13

by Horatiu Vultur

[permalink] [raw]
Subject: [PATCH net] net: lan966x: Fix port configuration when using SGMII interface

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 <[email protected]>
---
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.
*/
- 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,
--
2.34.1



2024-01-23 08:49:10

by Maxime Chevallier

[permalink] [raw]
Subject: Re: [PATCH net] net: lan966x: Fix port configuration when using SGMII interface

Hello Horatiu,

On Tue, 23 Jan 2024 09:15:14 +0100
Horatiu Vultur <[email protected]> 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 <[email protected]>
> ---
> 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 <[email protected]>

Thanks,

Maxime

2024-01-23 10:11:52

by Horatiu Vultur

[permalink] [raw]
Subject: Re: [PATCH net] net: lan966x: Fix port configuration when using SGMII interface

The 01/23/2024 09:48, Maxime Chevallier wrote:
>
> Hello Horatiu,

Hi Maxime,

>
> On Tue, 23 Jan 2024 09:15:14 +0100
> Horatiu Vultur <[email protected]> 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 <[email protected]>
> > ---
> > 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 <[email protected]>
>
> Thanks,
>
> Maxime

--
/Horatiu