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: <ZMkddjabRonGe7Eu@shell.armlinux.org.uk>
Date:   Tue, 1 Aug 2023 15:57:58 +0100
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Michael Walle <mwalle@...nel.org>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Yisen Zhuang <yisen.zhuang@...wei.com>,
        Salil Mehta <salil.mehta@...wei.com>,
        Florian Fainelli <florian.fainelli@...adcom.com>,
        Broadcom internal kernel review list 
        <bcm-kernel-feedback-list@...adcom.com>,
        Marek BehĂșn <kabel@...nel.org>,
        Xu Liang <lxu@...linear.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Simon Horman <simon.horman@...igine.com>
Subject: Re: [PATCH net-next v3 02/11] net: phy: introduce
 phy_has_c45_registers()

On Tue, Aug 01, 2023 at 04:47:04PM +0200, Michael Walle wrote:
> Hi Andrew,
> 
> Am 2023-07-19 09:11, schrieb Michael Walle:
> > > > diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
> > > > index a64186dc53f8..686a57d56885 100644
> > > > --- a/drivers/net/phy/phy-core.c
> > > > +++ b/drivers/net/phy/phy-core.c
> > > > @@ -556,7 +556,7 @@ int __phy_read_mmd(struct phy_device
> > > > *phydev, int devad, u32 regnum)
> > > > 
> > > >  	if (phydev->drv && phydev->drv->read_mmd) {
> > > >  		val = phydev->drv->read_mmd(phydev, devad, regnum);
> > > > -	} else if (phydev->is_c45) {
> > > > +	} else if (phy_has_c45_registers(phydev)) {
> > > 
> > > This i would say should be
> > > 
> > > phy_has_c45_transfers(phydev). This is about, can we do C45 transfers
> > > on the bus, and if not, fall back to C45 over C22.
> > 
> > Shouldn't this then be a bus property? I.e. mdiobus_has_c45_transfers().
> > I've have a similar helper introduced in 9/11:
> > 
> > static inline bool mdiobus_supports_c45(struct mii_bus *bus)
> > {
> >     return bus->read_c45 && !bus->prevent_c45_access;
> > }

In the case of the above (the code in __phy_read_mmd()), I wouldn't
at least initially change the test there.

phydev->is_c45 will only be true if we probed the PHY using clause
45 accesses. Thus, it will be set if "the bus supports clause 45
accesses" _and_ "the PHY responds to those accesses".

Changing that to only "the bus supports clause 45 accesses" means
that a PHY supporting only clause 22 access with indirect clause
45 access then fails if it's used with a bus that supports both
clause 22 and clause 45 accesses.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ