[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200819015828.GB2347062@lunn.ch>
Date: Wed, 19 Aug 2020 03:58:28 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Andre Edich <andre.edich@...rochip.com>
Cc: netdev@...r.kernel.org, UNGLinuxDriver@...rochip.com,
steve.glendinning@...well.net, Parthiban.Veerasooran@...rochip.com
Subject: Re: [PATCH net-next v3 3/3] smsc95xx: add phylib support
> @@ -553,32 +554,21 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
> static int smsc95xx_link_reset(struct usbnet *dev)
> {
> struct smsc95xx_priv *pdata = dev->driver_priv;
> - struct mii_if_info *mii = &dev->mii;
> - struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
> + struct ethtool_link_ksettings cmd;
> unsigned long flags;
> u16 lcladv, rmtadv;
> int ret;
>
> - /* clear interrupt status */
> - ret = smsc95xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
> - if (ret < 0)
> - return ret;
> -
> ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_);
> if (ret < 0)
> return ret;
>
> - mii_check_media(mii, 1, 1);
> - mii_ethtool_gset(&dev->mii, &ecmd);
> - lcladv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE);
> - rmtadv = smsc95xx_mdio_read(dev->net, mii->phy_id, MII_LPA);
> -
> - netif_dbg(dev, link, dev->net,
> - "speed: %u duplex: %d lcladv: %04x rmtadv: %04x\n",
> - ethtool_cmd_speed(&ecmd), ecmd.duplex, lcladv, rmtadv);
> + phy_ethtool_ksettings_get(pdata->phydev, &cmd);
> + lcladv = phy_read(pdata->phydev, MII_ADVERTISE);
> + rmtadv = phy_read(pdata->phydev, MII_LPA);
The MAC driver should not be making phy_read() calls. Please look at
how other driver handle flow control.
Andrew
Powered by blists - more mailing lists