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: <20200617112153.GB28783@laureti-dev>
Date:   Wed, 17 Jun 2020 13:21:53 +0200
From:   Helmut Grohne <helmut.grohne@...enta.de>
To:     Russell King - ARM Linux admin <linux@...linux.org.uk>
CC:     Nicolas Ferre <nicolas.ferre@...rochip.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Palmer Dabbelt <palmer@...belt.com>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH] net: macb: reject unsupported rgmii delays

On Wed, Jun 17, 2020 at 12:55:18PM +0200, Russell King - ARM Linux admin wrote:
> The individual RGMII delay modes are more about what the PHY itself is
> asked to do with respect to inserting delays, so I don't think your
> patch makes sense.

This seems to be the same aspect that Vladimir Oltean remarked. I agree
that the relevant hunk should be dropped.

> > --- a/drivers/net/ethernet/cadence/macb_main.c
> > +++ b/drivers/net/ethernet/cadence/macb_main.c
> > @@ -514,7 +514,7 @@ static void macb_validate(struct phylink_config *config,
> >  	    state->interface != PHY_INTERFACE_MODE_RMII &&
> >  	    state->interface != PHY_INTERFACE_MODE_GMII &&
> >  	    state->interface != PHY_INTERFACE_MODE_SGMII &&
> > -	    !phy_interface_mode_is_rgmii(state->interface)) {
> > +	    state->interface != PHY_INTERFACE_MODE_RGMII_ID) {
> 
> Here you reject everything except PHY_INTERFACE_MODE_RGMII_ID.
> 
> >  		bitmap_zero(supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
> >  		return;
> >  	}
> > @@ -694,6 +694,13 @@ static int macb_phylink_connect(struct macb *bp)
> >  	struct phy_device *phydev;
> >  	int ret;
> >  
> > +	if (of_phy_is_fixed_link(dn) &&
> > +	    phy_interface_mode_is_rgmii(bp->phy_interface) &&
> > +	    bp->phy_interface != PHY_INTERFACE_MODE_RGMII) {
> 
> but here you reject everything except PHY_INTERFACE_MODE_RGMII.  These
> can't both be right.  If you start with PHY_INTERFACE_MODE_RGMII, and
> have a fixed link, you'll have PHY_INTERFACE_MODE_RGMII passed into
> the validate function, which will then fail.

For a fixed-link, the validation function is never called. Therefore, it
cannot reject PHY_INTERFACE_MODE_RGMII. It works in practice.

However, the consensus is to not reject that mode in the validation
function.

Helmut

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ