[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGVrzcbn104O=4NfjE=WM-z51S0iYijeqw+FBbaBdNGvGV=Tiw@mail.gmail.com>
Date: Fri, 21 Feb 2014 11:24:41 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: cristian.bercaru@...escale.com
Cc: netdev <netdev@...r.kernel.org>,
Madalin-Cristian Bucur <madalin.bucur@...escale.com>,
Shaohui Xie <shaohui.xie@...escale.com>, shruti@...escale.com
Subject: Re: [PATCH] net: phy: unmask link partner capabilities
Hi,
2014-02-21 8:18 GMT-08:00 <cristian.bercaru@...escale.com>:
> From: Cristian Bercaru <cristian.bercaru@...escale.com>
>
> Masking the link partner's capabilities with local capabilities can be
> misleading in autonegotiation scenarios such as PAUSE frame
> autonegotiation.
> Therefore, this patch unmasks the link partner's capabilities.
You have only covered the lpa register here, is lpagb also affected?
It might make sense to cache (lpa & adv) in an intermediate variable
to help clarifiying the checks.
>
> Signed-off-by: Cristian Bercaru <cristian.bercaru@...escale.com>
> ---
> drivers/net/phy/phy_device.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index a70b604..e57825e6 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -967,8 +967,6 @@ int genphy_read_status(struct phy_device *phydev)
> if (adv < 0)
> return adv;
>
> - lpa &= adv;
> -
> phydev->speed = SPEED_10;
> phydev->duplex = DUPLEX_HALF;
> phydev->pause = 0;
> @@ -979,13 +977,13 @@ int genphy_read_status(struct phy_device *phydev)
>
> if (lpagb & LPA_1000FULL)
> phydev->duplex = DUPLEX_FULL;
> - } else if (lpa & (LPA_100FULL | LPA_100HALF)) {
> + } else if (lpa & adv & (LPA_100FULL | LPA_100HALF)) {
> phydev->speed = SPEED_100;
>
> - if (lpa & LPA_100FULL)
> + if (lpa & adv & LPA_100FULL)
> phydev->duplex = DUPLEX_FULL;
> } else
> - if (lpa & LPA_10FULL)
> + if (lpa & adv & LPA_10FULL)
> phydev->duplex = DUPLEX_FULL;
>
> if (phydev->duplex == DUPLEX_FULL) {
> --
> 1.7.11.7
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Florian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists