netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: tim.beale@alliedtelesis.co.nz
Cc: f.fainelli@gmail.com, netdev@vger.kernel.org
Subject: Re: [PATCH] net: phy: Make sure phy_start() always re-enables the phy interrupts
Date: Thu, 21 May 2015 16:50:12 -0400 (EDT)	[thread overview]
Message-ID: <20150521.165012.2187615495132464149.davem@davemloft.net> (raw)
In-Reply-To: <1431920318-7157-1-git-send-email-tim.beale@alliedtelesis.co.nz>

From: Tim Beale <tim.beale@alliedtelesis.co.nz>
Date: Mon, 18 May 2015 15:38:38 +1200

> This is an alternative way of fixing:
>  commit db9683fb412d ("net: phy: Make sure PHY_RESUMING state change
>                       is always processed")
> 
> When the PHY state transitions from PHY_HALTED to PHY_RESUMING, there are
> two things we need to do:
> 1). Re-enable interrupts (and power up the physical link, if powered down)
> 2). Update the PHY state and net-device based on the link status.
> 
> There's no strict reason why #1 has to be done from within the main
> phy_state_machine() function. There is a risk that other changes to the
> PHY (e.g. setting speed/duplex, which calls phy_start_aneg()) could cause
> a subsequent state transition before phy_state_machine() has processed
> the PHY_RESUMING state change. This would leave the PHY with interrupts
> disabled and/or still in the BMCR_PDOWN/low-power mode.
> 
> Moving enabling the interrupts and phy_resume() into phy_start() will
> guarantee this work always gets done. As the PHY is already in the HALTED
> state and interrupts are disabled, it shouldn't conflict with any work
> being done in phy_state_machine(). The downside of this change is that if
> the PHY_RESUMING state is ever entered from anywhere else, it'll also have
> to repeat this work.
> 
> Signed-off-by: Tim Beale <tim.beale@alliedtelesis.co.nz>

Applied.

      reply	other threads:[~2015-05-21 20:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  1:55 [PATCH] net: phy: Make sure PHY_RESUMING state change is always processed Tim Beale
2015-05-13  2:44 ` Florian Fainelli
2015-05-15 21:25 ` Florian Fainelli
2015-05-16 21:16   ` David Miller
2015-05-18  3:38   ` Tim Beale
2015-05-18  3:38 ` [PATCH] net: phy: Make sure phy_start() always re-enables the phy interrupts Tim Beale
2015-05-21 20:50   ` David Miller [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=20150521.165012.2187615495132464149.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=tim.beale@alliedtelesis.co.nz \
    /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 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).