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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yv5SzmWsVv2G9i0v@lunn.ch>
Date:   Thu, 18 Aug 2022 16:55:10 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Feiyang Chen <chris.chenfeiyang@...il.com>
Cc:     peppe.cavallaro@...com, alexandre.torgue@...s.st.com,
        joabreu@...opsys.com, Feiyang Chen <chenfeiyang@...ngson.cn>,
        zhangqing@...ngson.cn, Huacai Chen <chenhuacai@...ngson.cn>,
        netdev@...r.kernel.org, loongarch@...ts.linux.dev
Subject: Re: [PATCH] stmmac: pci: Add LS7A support for dwmac-loongson

On Thu, Aug 18, 2022 at 01:01:09PM +0800, Feiyang Chen wrote:
> On Thu, 18 Aug 2022 at 10:15, Andrew Lunn <andrew@...n.ch> wrote:
> >
> > > +static void loongson_gnet_fix_speed(void *priv, unsigned int speed)
> > > +{
> > > +     struct net_device *ndev = (struct net_device *)(*(unsigned long *)priv);
> > > +     struct stmmac_priv *ptr = netdev_priv(ndev);
> > > +
> > > +     if (speed == SPEED_1000) {
> > > +             if (readl(ptr->ioaddr + MAC_CTRL_REG) & (1 << 15) /* PS */) {
> > > +                     /* reset phy */
> > > +                     phy_set_bits(ndev->phydev, 0 /*MII_BMCR*/,
> > > +                                  0x200 /*BMCR_ANRESTART*/);
> >
> > The MAC driver should not be accessing PHY registers. Why does the PHY
> > need a reset? Can you call phy_stop()/phy_start()?
> >
> 
> Hi, Andrew,
> 
> This is a PHY bug, I'll try other methods.

Workarounds for PHY bugs should be in the PHY driver.

Maybe you can use the .link_change_notify callback.

      Andrew

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ