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] [day] [month] [year] [list]
Message-ID: <20211129110834.yy6wai63vaftnias@soft-dev3-1.localhost>
Date:   Mon, 29 Nov 2021 12:08:34 +0100
From:   Horatiu Vultur <horatiu.vultur@...rochip.com>
To:     "Russell King (Oracle)" <linux@...linux.org.uk>
CC:     <davem@...emloft.net>, <kuba@...nel.org>, <robh+dt@...nel.org>,
        <UNGLinuxDriver@...rochip.com>, <p.zabel@...gutronix.de>,
        <andrew@...n.ch>, <netdev@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net-next v4 3/6] net: lan966x: add port module support

The 11/26/2021 11:04, Russell King (Oracle) wrote:
> 
> On Fri, Nov 26, 2021 at 10:05:37AM +0100, Horatiu Vultur wrote:
> > This patch adds support for netdev and phylink in the switch. The
> > injection + extraction is register based. This will be replaced with DMA
> > accees.
> >
> > Signed-off-by: Horatiu Vultur <horatiu.vultur@...rochip.com>
> 
> This looks mostly good now, thanks. There's one remaining issue:

Thanks for the help!

> 
> > +int lan966x_port_pcs_set(struct lan966x_port *port,
> > +                      struct lan966x_port_config *config)
> > +{
> > +     struct lan966x *lan966x = port->lan966x;
> > +     bool inband_aneg = false;
> > +     bool outband;
> > +     int err;
> > +
> > +     lan966x_port_link_down(port);
> 
> This looks like something the MAC layer should be doing. Phylink won't
> change the interface mode by just calling the PCS - it will do this
> sequence, known as a major reconfiguration:
> 
> mac_link_down() (if the link was previously up)
> mac_prepare()
> mac_config()
> if (pcs_config() > 0)
>   pcs_an_restart()
> mac_finish()
> 
> pcs_config() will also be called thusly:
> 
> if (pcs_config() > 0)
>   pcs_an_restart()
> 
> to change the ethtool advertising mask which changes the inband advert
> or the Autoneg bit, which has an effect only on your DEV_PCS1G_ANEG_CFG()
> register, and this may be called with the link up or down.
> 
> Also, pcs_config() is supposed to return 0 if the inband advert has not
> changed, or positive if it has (so pcs_an_restart() is called to cause
> in-band negotiation to be restarted.)
> 
> Note also that pcs_an_restart() may  also be called when ethtool
> requests negotiation restart when we're operating in 802.3z modes.
> 
> So, my question is - do you need to be so heavy weight with the call to
> lan966x_port_link_down() to take everything down when pcs_config() is
> called, and is it really in the right place through the sequence for
> a major reconfiguration?

Thanks for the detail explanation.
You are right, it doesn't look like it is needed to call
lan966x_port_link_down when pcs_config is called.
I can put the lan966x_port_link_down() inside the mac_link_down() callback.

> 
> Thanks.
> 
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

-- 
/Horatiu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ