Message ID | 20241118-sparx5-lan969x-switch-driver-4-v3-4-3cefee5e7e3a@microchip.com (mailing list archive) |
---|---|
State | Deferred |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: lan969x: add RGMII support | expand |
Hi, On Mon, Nov 18, 2024 at 02:00:50PM +0100, Daniel Machon wrote: > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c > index f8562c1a894d..cb55e05e5611 100644 > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c > @@ -32,6 +32,9 @@ sparx5_phylink_mac_select_pcs(struct phylink_config *config, > { > struct sparx5_port *port = netdev_priv(to_net_dev(config->dev)); > > + if (phy_interface_mode_is_rgmii(interface)) > + return NULL; > + > return &port->phylink_pcs; Maybe turn this into positive logic - return the PCS only when the interface mode requires the PCS? Thanks.
> Hi, > > On Mon, Nov 18, 2024 at 02:00:50PM +0100, Daniel Machon wrote: > > diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c > > index f8562c1a894d..cb55e05e5611 100644 > > --- a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c > > +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c > > @@ -32,6 +32,9 @@ sparx5_phylink_mac_select_pcs(struct phylink_config *config, > > { > > struct sparx5_port *port = netdev_priv(to_net_dev(config->dev)); > > > > + if (phy_interface_mode_is_rgmii(interface)) > > + return NULL; > > + > > return &port->phylink_pcs; > > Maybe turn this into positive logic - return the PCS only when the > interface mode requires the PCS? Sure. I can flip the logic and return the PCS for the interface modes that are advertised as supported. /Daniel
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c index f8562c1a894d..cb55e05e5611 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c @@ -32,6 +32,9 @@ sparx5_phylink_mac_select_pcs(struct phylink_config *config, { struct sparx5_port *port = netdev_priv(to_net_dev(config->dev)); + if (phy_interface_mode_is_rgmii(interface)) + return NULL; + return &port->phylink_pcs; } diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c index 8f4f19a2bd65..b494970752fd 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_port.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_port.c @@ -994,6 +994,7 @@ int sparx5_port_config(struct sparx5 *sparx5, struct sparx5_port *port, struct sparx5_port_config *conf) { + bool rgmii = phy_interface_mode_is_rgmii(conf->phy_mode); bool high_speed_dev = sparx5_is_baser(conf->portmode); const struct sparx5_ops *ops = sparx5->data->ops; int err, urgency, stop_wm; @@ -1003,7 +1004,7 @@ int sparx5_port_config(struct sparx5 *sparx5, return err; /* high speed device is already configured */ - if (!high_speed_dev) + if (!rgmii && !high_speed_dev) sparx5_port_config_low_set(sparx5, port, conf); /* Configure flow control */