diff mbox

[for,3.9] net: fec: fix regression in link change accounting

Message ID 1366108962-8607-1-git-send-email-l.stach@pengutronix.de
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Lucas Stach April 16, 2013, 10:42 a.m. UTC
A link-down isn't properly saved in the FEC state, so we wouldn't restart the
FEC after a repeated link-up.

Regression was introduced with commit
d97e7497 "net: fec: restart the FEC when PHY speed changes"

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/net/ethernet/freescale/fec.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Fabio Estevam April 16, 2013, 1:40 p.m. UTC | #1
Hi Lucas,

On Tue, Apr 16, 2013 at 7:42 AM, Lucas Stach <l.stach@pengutronix.de> wrote:
> A link-down isn't properly saved in the FEC state, so we wouldn't restart the
> FEC after a repeated link-up.
>
> Regression was introduced with commit
> d97e7497 "net: fec: restart the FEC when PHY speed changes"
>
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/net/ethernet/freescale/fec.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
> index f292c3a..73195f6 100644
> --- a/drivers/net/ethernet/freescale/fec.c
> +++ b/drivers/net/ethernet/freescale/fec.c
> @@ -1002,6 +1002,7 @@ static void fec_enet_adjust_link(struct net_device *ndev)
>         } else {
>                 if (fep->link) {
>                         fec_stop(ndev);
> +                       fep->link = phy_dev->link;
>                         status_change = 1;
>                 }
>         }

I applied this into linux-next (the file is renamed to fec_main.c
there) and this fixes the suspend/resume issue I was seeing.

Tested-by: Fabio Estevam <fabio.estevam@freescale.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller April 16, 2013, 8:48 p.m. UTC | #2
From: Amos Kong <kongjianjun@gmail.com>
Date: Tue, 16 Apr 2013 23:04:24 +0800

> On Tue, Apr 16, 2013 at 6:42 PM, Lucas Stach <l.stach@pengutronix.de> wrote:
> 
>> A link-down isn't properly saved in the FEC state, so we wouldn't restart
>> the
>> FEC after a repeated link-up.
>>
>> Regression was introduced with commit
>> d97e7497 "net: fec: restart the FEC when PHY speed changes"
>>
>> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
>>
> 
> Reviewed-by: Amos Kong <kongjianjun@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index f292c3a..73195f6 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1002,6 +1002,7 @@  static void fec_enet_adjust_link(struct net_device *ndev)
 	} else {
 		if (fep->link) {
 			fec_stop(ndev);
+			fep->link = phy_dev->link;
 			status_change = 1;
 		}
 	}