All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Sudheesh Mavila <sudheesh.mavila@amd.com>
Cc: andrew@lunn.ch, f.fainelli@gmail.com, hkallweit1@gmail.com,
	davem@davemloft.net, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: phy: corrected the return value for genphy_check_and_restart_aneg
Date: Tue, 25 Feb 2020 12:38:39 +0000	[thread overview]
Message-ID: <20200225123839.GT25745@shell.armlinux.org.uk> (raw)
In-Reply-To: <20200225122208.6881-1-sudheesh.mavila@amd.com>

On Tue, Feb 25, 2020 at 05:52:08PM +0530, Sudheesh Mavila wrote:
> When auto-negotiation is not required, return value should be zero.
> 
> Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>

Hi,

Thanks for spotting this problem. However, it looks like the same
problem also exists in genphy_c45_check_and_restart_aneg(). It would
be a good idea to fix both at the same time.

Thanks.

> ---
>  drivers/net/phy/phy_device.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 6a5056e0ae77..36cde3dac4c3 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1806,10 +1806,13 @@ int genphy_check_and_restart_aneg(struct phy_device *phydev, bool restart)
>  			restart = true;
>  	}
>  
> -	if (restart)
> -		ret = genphy_restart_aneg(phydev);
> +	/* Only restart aneg if we are advertising something different
> +	 * than we were before.
> +	 */
> +	if (restart > 0)
> +		return genphy_restart_aneg(phydev);
>  
> -	return ret;
> +	return 0;
>  }
>  EXPORT_SYMBOL(genphy_check_and_restart_aneg);
>  
> -- 
> 2.17.1
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

  reply	other threads:[~2020-02-25 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 12:22 [PATCH] net: phy: corrected the return value for genphy_check_and_restart_aneg Sudheesh Mavila
2020-02-25 12:38 ` Russell King - ARM Linux admin [this message]
2020-02-25 13:28 ` Andrew Lunn
2020-02-25 13:59 ` Heiner Kallweit

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=20200225123839.GT25745@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sudheesh.mavila@amd.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.