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]
Date:   Tue, 22 Jun 2021 15:16:08 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     "Ismail, Mohammad Athari" <mohammad.athari.ismail@...el.com>
Cc:     "davem@...emloft.net" <davem@...emloft.net>,
        "hkallweit1@...il.com" <hkallweit1@...il.com>,
        "hmehrtens@...linear.com" <hmehrtens@...linear.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "linux@...linux.org.uk" <linux@...linux.org.uk>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "tmohren@...linear.com" <tmohren@...linear.com>,
        "vee.khee.wong@...ux.intel.com" <vee.khee.wong@...ux.intel.com>,
        "lxu@...linear.com" <lxu@...linear.com>
Subject: Re: [PATCH v3] net: phy: add Maxlinear GPY115/21x/24x driver

On Tue, Jun 22, 2021 at 04:21:47AM +0000, Ismail, Mohammad Athari wrote:
> > -----Original Message-----
> > From: Ismail, Mohammad Athari <mohammad.athari.ismail@...el.com>
> > Sent: Tuesday, June 22, 2021 12:15 PM
> > To: Ismail, Mohammad Athari <mohammad.athari.ismail@...el.com>
> > Subject:
> > 
> > > Net-next:
> > >
> > > int genphy_loopback(struct phy_device *phydev, bool enable) {
> > >      if (enable) {
> > >          u16 val, ctl = BMCR_LOOPBACK;
> > >          int ret;
> > >
> > >          if (phydev->speed == SPEED_1000)
> > >              ctl |= BMCR_SPEED1000;
> > >          else if (phydev->speed == SPEED_100)
> > >              ctl |= BMCR_SPEED100;
> > >
> > >          if (phydev->duplex == DUPLEX_FULL)
> > >              ctl |= BMCR_FULLDPLX;
> > >
> > >          phy_modify(phydev, MII_BMCR, ~0, ctl);
> > >
> > >          ret = phy_read_poll_timeout(phydev, MII_BMSR, val,
> > >                          val & BMSR_LSTATUS,
> > >                      5000, 500000, true);
> > >          if (ret)
> > >              return ret;
> > >      } else {
> > >          phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, 0);
> > >
> > >          phy_config_aneg(phydev);
> > >      }
> > >
> > >      return 0;
> > > }
> 
> Hi Andrew,
> 

> We also observe same issue on Marvell88E1510 PHY (C22 supported PHY)
> as well. It works with v5.12.11's genphy_loopback() but not
> net-next's.

Ah, yes. The Marvell probably needs a software reset after the write
to the MII_BMSR register. But just setting the loopback bit also
probably needed a software reset as well, so i suspect it was broken
before this change.

Oleksij, rather that writing registers directly, we probably need to
use the phylib API calls to configure the PHY. That will handle
oddities like the Marvell needing a reset, or PHYs with other speeds
etc.

	Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ