lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+h21hqWPHHqMQONY2bKZ2uA2pUzm2Rqwo7LTX+guj7CHo4skQ@mail.gmail.com>
Date: Sun, 10 Nov 2024 17:50:02 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Tristram.Ha@...rochip.com
Cc: Woojung Huh <woojung.huh@...rochip.com>, Andrew Lunn <andrew@...n.ch>, 
	Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Marek Vasut <marex@...x.de>, 
	UNGLinuxDriver@...rochip.com, devicetree@...r.kernel.org, 
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next 2/2] net: dsa: microchip: Add SGMII port support
 to KSZ9477 switch

On Sat, 9 Nov 2024 at 03:56, <Tristram.Ha@...rochip.com> wrote:
> diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
> index f73833e24622..8163342d778a 100644
> --- a/drivers/net/dsa/microchip/ksz_common.c
> +++ b/drivers/net/dsa/microchip/ksz_common.c
> @@ -354,10 +354,30 @@ static void ksz9477_phylink_mac_link_up(struct phylink_config *config,
>                                         int speed, int duplex, bool tx_pause,
>                                         bool rx_pause);
>
> +static struct phylink_pcs *
> +ksz_phylink_mac_select_pcs(struct phylink_config *config,
> +                          phy_interface_t interface)
> +{
> +       struct dsa_port *dp = dsa_phylink_to_port(config);
> +       struct ksz_device *dev = dp->ds->priv;
> +       struct ksz_port *p = &dev->ports[dp->index];
> +
> +       if (!p->sgmii)
> +               return ERR_PTR(-EOPNOTSUPP);

Since commit 7530ea26c810 ("net: phylink: remove "using_mac_select_pcs""),
returning ERR_PTR(-EOPNOTSUPP) here would actually be fatal. This error
code no longer carries any special meaning.

It would be a good idea to Cc Russell King for phylink changes.

> +       switch (interface) {
> +       case PHY_INTERFACE_MODE_SGMII:
> +       case PHY_INTERFACE_MODE_1000BASEX:
> +               return &p->pcs_priv->pcs;
> +       default:
> +               return NULL;
> +       }
> +}
> +
>  static const struct phylink_mac_ops ksz9477_phylink_mac_ops = {
>         .mac_config     = ksz_phylink_mac_config,
>         .mac_link_down  = ksz_phylink_mac_link_down,
>         .mac_link_up    = ksz9477_phylink_mac_link_up,
> +       .mac_select_pcs = ksz_phylink_mac_select_pcs,
>  };

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ