[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGVrzcbrm3KO_=NSJz=KOAcPWvVUMm5kPM7nryJBag6BotKgoQ@mail.gmail.com>
Date: Thu, 24 Apr 2014 11:53:51 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: Balakumaran Kannan <kumaran.4353@...il.com>
Cc: netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH] net phy: Check for aneg completion before setting state
to PHY_RUNNING
2014-04-23 19:52 GMT-07:00 Balakumaran Kannan <kumaran.4353@...il.com>:
> phy_state_machine should check whether auto-negotiatin is completed
> before changing phydev->state from PHY_NOLINK to PHY_RUNNING. If
> auto-negotiation is not completed phydev->state should be set to
> PHY_AN.
I need some time to review this. Just out of curiosity, is this fixing
a bug you have encountered or was this found by state machine
inspection?
>
> Signed-off-by: Balakumaran Kannan <kumaran.4353@...il.com>
> ---
> drivers/net/phy/phy.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 1b6d09a..a972056 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -765,6 +765,17 @@ void phy_state_machine(struct work_struct *work)
> break;
>
> if (phydev->link) {
> + if (AUTONEG_ENABLE == phydev->autoneg) {
> + err = phy_aneg_done(phydev);
> + if (err < 0)
> + break;
> +
> + if (!err) {
> + phydev->state = PHY_AN;
> + phydev->link_timeout = PHY_AN_TIMEOUT;
> + break;
> + }
> + }
> phydev->state = PHY_RUNNING;
> netif_carrier_on(phydev->attached_dev);
> phydev->adjust_link(phydev->attached_dev);
> --
> 1.8.2.1
--
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