public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail•com>
To: Zefir Kurtisi <zefir.kurtisi@neratec•com>, netdev@vger•kernel.org
Cc: andrew@lunn•ch
Subject: Re: [PATCH v2] phy state machine: failsafe leave invalid RUNNING state
Date: Sun, 8 Jan 2017 17:24:54 -0800	[thread overview]
Message-ID: <5d0f7208-eec2-3b36-d946-e412ec051947@gmail.com> (raw)
In-Reply-To: <1483701288-14019-1-git-send-email-zefir.kurtisi@neratec.com>



On 01/06/2017 03:14 AM, Zefir Kurtisi wrote:
> While in RUNNING state, phy_state_machine() checks for link changes by
> comparing phydev->link before and after calling phy_read_status().
> This works as long as it is guaranteed that phydev->link is never
> changed outside the phy_state_machine().
> 
> If in some setups this happens, it causes the state machine to miss
> a link loss and remain RUNNING despite phydev->link being 0.
> 
> This has been observed running a dsa setup with a process continuously
> polling the link states over ethtool each second (SNMPD RFC-1213
> agent). Disconnecting the link on a phy followed by a ETHTOOL_GSET
> causes dsa_slave_get_settings() / dsa_slave_get_link_ksettings() to
> call phy_read_status() and with that modify the link status - and
> with that bricking the phy state machine.
> 
> This patch adds a fail-safe check while in RUNNING, which causes to
> move to CHANGELINK when the link is gone and we are still RUNNING.
> 
> Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec•com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail•com>
-- 
Florian

  parent reply	other threads:[~2017-01-09  1:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 15:04 [PATCH] phy state machine: failsafe leave invalid RUNNING state Zefir Kurtisi
2017-01-04 15:13 ` Florian Fainelli
2017-01-04 15:27   ` Zefir Kurtisi
2017-01-04 15:30     ` Florian Fainelli
2017-01-04 16:10       ` Zefir Kurtisi
2017-01-04 16:16         ` Andrew Lunn
2017-01-04 16:24           ` [SIDE DISCUSSION] " Matthias May
2017-01-04 21:44         ` Florian Fainelli
2017-01-05  9:23           ` Zefir Kurtisi
2017-01-05 19:39             ` Florian Fainelli
2017-01-04 20:07 ` kbuild test robot
2017-01-04 20:23 ` kbuild test robot
2017-01-06 11:14 ` [PATCH v2] " Zefir Kurtisi
2017-01-08 23:16   ` David Miller
2017-01-09  1:24   ` Florian Fainelli [this message]
2017-01-09 20:38   ` David Miller

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=5d0f7208-eec2-3b36-d946-e412ec051947@gmail.com \
    --to=f.fainelli@gmail$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=zefir.kurtisi@neratec$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox