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: <20200622132200.GB5822@lsv03152.swis.in-blr01.nxp.com>
Date:   Mon, 22 Jun 2020 18:52:00 +0530
From:   Calvin Johnson <calvin.johnson@....nxp.com>
To:     Russell King - ARM Linux admin <linux@...linux.org.uk>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Jeremy Linton <jeremy.linton@....com>, Jon <jon@...id-run.com>,
        Cristi Sovaiala <cristian.sovaiala@....com>,
        Ioana Ciornei <ioana.ciornei@....com>,
        Andy Shevchenko <andy.shevchenko@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Madalin Bucur <madalin.bucur@....nxp.com>,
        netdev@...r.kernel.org, linux.cj@...il.com
Subject: Re: [PATCH v1 1/3] net: phy: Allow mdio buses to auto-probe c45
 devices

On Wed, Jun 17, 2020 at 07:57:03PM +0100, Russell King - ARM Linux admin wrote:
> On Wed, Jun 17, 2020 at 08:51:20PM +0200, Andrew Lunn wrote:
> > > > +	/* bus capabilities, used for probing */
> > > > +	enum {
> > > > +		MDIOBUS_C22 = 0,
> > > > +		MDIOBUS_C45,
> > > > +		MDIOBUS_C22_C45,
> > > > +	} probe_capabilities;
> > > 
> > > I think it would be better to reserve "0" to mean that no capabilities
> > > have been declared.  We hae the situation where we have mii_bus that
> > > exist which do support C45, but as they stand, probe_capabilities will
> > > be zero, and with your definitions above, that means MDIOBUS_C22.
> > > 
> > > It seems this could lock in some potential issues later down the line
> > > if we want to use this elsewhere.
> > 
> > Hi Russell
> > 
> > Actually, this patch already causes issues, i think.
> > 
> > drivers/net/ethernet/marvell/mvmdio.c contains two MDIO bus master
> > drivers. "marvell,orion-mdio" is C22 only. "marvell,xmdio" is C45
> > only. Because the capabilites is not initialized, it will default to
> > 0, aka MDIOBUS_C22, for the C45 only bus master, and i expect bad
> > things will happen.
> > 
> > We need the value of 0 to cause existing behaviour. Or all MDIO bus
> > drivers need reviewing, and the correct capabilities set.
> 
> Yes, that's basically what I was trying to say, thanks for putting it
> more clearly.

Prior to this patch, below code which is for C22 was executed in this path.
	phydev = get_phy_device(bus, addr, false);
Doesn't this mean that MDIOBUS_C22 = 0, doesn't break anything?

I think for DT cases, there wasn't autoprobing for PHYs and this path wasn't
taken.

Regards
Calvin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ