[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57322792.4060008@gmail.com>
Date: Tue, 10 May 2016 11:25:22 -0700
From: Florian Fainelli <f.fainelli@...il.com>
To: shh.xie@...il.com, netdev@...r.kernel.org, davem@...emloft.net
Cc: Shaohui Xie <Shaohui.Xie@....com>, Andrew Lunn <andrew@...n.ch>
Subject: Re: [PATCH] net: phylib: fix interrupts re-enablement in phy_start
On 05/10/2016 02:42 AM, shh.xie@...il.com wrote:
> From: Shaohui Xie <Shaohui.Xie@....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@....com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.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
Powered by blists - more mailing lists