[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170201144155.17123-3-niklas.soderlund+renesas@ragnatech.se>
Date: Wed, 1 Feb 2017 15:41:55 +0100
From: Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Simon Horman <horms+renesas@...ge.net.au>,
netdev@...r.kernel.org
Cc: linux-renesas-soc@...r.kernel.org,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Niklas Söderlund
<niklas.soderlund+renesas@...natech.se>
Subject: [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket
If a link change interrupt happens along side the MagicPacket interrupt
and the link change interrupt is ignored the interrupt handler will
return and the wakeup event is not register. Fix this by moving the
MagicPacket check before the link change check.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@...natech.se>
Reported-by: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
---
drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index f9134c818ac6ef53..54248775f227b062 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -1605,6 +1605,8 @@ static void sh_eth_emac_interrupt(struct net_device *ndev)
sh_eth_write(ndev, felic_stat, ECSR); /* clear int */
if (felic_stat & ECSR_ICD)
ndev->stats.tx_carrier_errors++;
+ if (felic_stat & ECSR_MPD)
+ pm_wakeup_event(&mdp->pdev->dev, 0);
if (felic_stat & ECSR_LCHNG) {
/* Link Changed */
if (mdp->cd->no_psr || mdp->no_ether_link)
@@ -1624,8 +1626,6 @@ static void sh_eth_emac_interrupt(struct net_device *ndev)
sh_eth_rcv_snd_enable(ndev);
}
}
- if (felic_stat & ECSR_MPD)
- pm_wakeup_event(&mdp->pdev->dev, 0);
}
/* error control function */
--
2.11.0
Powered by blists - more mailing lists