Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Andre Edich <andre.edich@microchip.com>
Cc: netdev@vger.kernel.org, UNGLinuxDriver@microchip.com,
	steve.glendinning@shawell.net,
	Parthiban.Veerasooran@microchip.com
Subject: Re: [PATCH net-next v3 3/3] smsc95xx: add phylib support
Date: Wed, 19 Aug 2020 03:58:28 +0200	[thread overview]
Message-ID: <20200819015828.GB2347062@lunn.ch> (raw)
In-Reply-To: <20200818111127.176422-4-andre.edich@microchip.com>

> @@ -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

      parent reply	other threads:[~2020-08-19  1:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-18 11:11 [PATCH net-next v3 0/3] Add phylib support to smsc95xx Andre Edich
2020-08-18 11:11 ` [PATCH net-next v3 1/3] smsc95xx: remove redundant function arguments Andre Edich
2020-08-18 11:11 ` [PATCH net-next v3 2/3] smsc95xx: use usbnet->driver_priv Andre Edich
2020-08-18 11:11 ` [PATCH net-next v3 3/3] smsc95xx: add phylib support Andre Edich
2020-08-18 15:25   ` Jakub Kicinski
2020-08-19  1:51   ` Andrew Lunn
2020-08-19  1:58   ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200819015828.GB2347062@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Parthiban.Veerasooran@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andre.edich@microchip.com \
    --cc=netdev@vger.kernel.org \
    --cc=steve.glendinning@shawell.net \
    --subject='Re: [PATCH net-next v3 3/3] smsc95xx: add phylib support' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).