From: Florian Fainelli <f.fainelli@gmail.com>
To: shh.xie@gmail.com, netdev@vger.kernel.org, davem@davemloft.net
Cc: Shaohui Xie <Shaohui.Xie@nxp.com>, Andrew Lunn <andrew@lunn.ch>
Subject: Re: [PATCH] net: phylib: fix interrupts re-enablement in phy_start
Date: Tue, 10 May 2016 11:25:22 -0700 [thread overview]
Message-ID: <57322792.4060008@gmail.com> (raw)
In-Reply-To: <1462873346-46457-1-git-send-email-shh.xie@gmail.com>
On 05/10/2016 02:42 AM, shh.xie@gmail.com wrote:
> From: Shaohui Xie <Shaohui.Xie@nxp.com>
>
> If phy was suspended and is starting, current driver always enable
> phy's interrupts, if phy works in polling, phy can raise unexpected
> interrupt which will not be handled, the interrupt will block system
> enter suspend again. So interrupts should only be re-enabled if phy
> works in interrupt.
Your explanation makes sense. The commit message could you use some
improvements like s/phy/PHY/ and "works in interrupt mode", but that is
not a huge thing.
>
> Signed-off-by: Shaohui Xie <Shaohui.Xie@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
> drivers/net/phy/phy.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 6f221c8..baa5ecb 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -871,9 +871,11 @@ void phy_start(struct phy_device *phydev)
> break;
> case PHY_HALTED:
> /* make sure interrupts are re-enabled for the PHY */
> - err = phy_enable_interrupts(phydev);
> - if (err < 0)
> - break;
> + if (phydev->irq != PHY_POLL) {
> + err = phy_enable_interrupts(phydev);
> + if (err < 0)
> + break;
> + }
>
> phydev->state = PHY_RESUMING;
> do_resume = true;
>
--
Florian
next prev parent reply other threads:[~2016-05-10 18:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-10 9:42 [PATCH] net: phylib: fix interrupts re-enablement in phy_start shh.xie
2016-05-10 18:25 ` Florian Fainelli [this message]
2016-05-11 2:15 ` Shaohui Xie
2016-05-10 20:01 ` 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=57322792.4060008@gmail.com \
--to=f.fainelli@gmail.com \
--cc=Shaohui.Xie@nxp.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=shh.xie@gmail.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 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).