netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] sh_eth: fixes for MagicPacket handling
@ 2017-02-01 14:41 Niklas Söderlund
  2017-02-01 14:41 ` [PATCH 1/2] sh_eth: align usage of sh_eth_modify() with rest of driver Niklas Söderlund
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Niklas Söderlund @ 2017-02-01 14:41 UTC (permalink / raw)
  To: Sergei Shtylyov, Simon Horman, netdev
  Cc: linux-renesas-soc, Geert Uytterhoeven, Niklas Söderlund

Hi,

This series contain two fixes for MagicPacket handling. It's based on 
top of net-next and is tested on Koelsch.

Niklas Söderlund (2):
  sh_eth: align usage of sh_eth_modify() with rest of driver
  sh_eth: fix wakeup event reporting from MagicPacket

 drivers/net/ethernet/renesas/sh_eth.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/2] sh_eth: align usage of sh_eth_modify() with rest of driver
  2017-02-01 14:41 [PATCH 0/2] sh_eth: fixes for MagicPacket handling Niklas Söderlund
@ 2017-02-01 14:41 ` Niklas Söderlund
  2017-02-01 15:55   ` Sergei Shtylyov
  2017-02-01 14:41 ` [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket Niklas Söderlund
  2017-02-01 17:54 ` [PATCH 0/2] sh_eth: fixes for MagicPacket handling David Miller
  2 siblings, 1 reply; 8+ messages in thread
From: Niklas Söderlund @ 2017-02-01 14:41 UTC (permalink / raw)
  To: Sergei Shtylyov, Simon Horman, netdev
  Cc: linux-renesas-soc, Geert Uytterhoeven, Niklas Söderlund

To be consistent with the rest of the driver when setting bits using
sh_eth_modify() the same bit should also be cleared. This have no
functional change and should have been done from the start.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
---
 drivers/net/ethernet/renesas/sh_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index 2f08d2735fe25e4d..f9134c818ac6ef53 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -3271,7 +3271,7 @@ static int sh_eth_wol_setup(struct net_device *ndev)
 	sh_eth_write(ndev, EESIPR_ECIIP, EESIPR);
 
 	/* Enable MagicPacket */
-	sh_eth_modify(ndev, ECMR, 0, ECMR_MPDE);
+	sh_eth_modify(ndev, ECMR, ECMR_MPDE, ECMR_MPDE);
 
 	/* Increased clock usage so device won't be suspended */
 	clk_enable(mdp->clk);
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket
  2017-02-01 14:41 [PATCH 0/2] sh_eth: fixes for MagicPacket handling Niklas Söderlund
  2017-02-01 14:41 ` [PATCH 1/2] sh_eth: align usage of sh_eth_modify() with rest of driver Niklas Söderlund
@ 2017-02-01 14:41 ` Niklas Söderlund
  2017-02-01 15:56   ` Sergei Shtylyov
  2017-02-01 15:56   ` Sergei Shtylyov
  2017-02-01 17:54 ` [PATCH 0/2] sh_eth: fixes for MagicPacket handling David Miller
  2 siblings, 2 replies; 8+ messages in thread
From: Niklas Söderlund @ 2017-02-01 14:41 UTC (permalink / raw)
  To: Sergei Shtylyov, Simon Horman, netdev
  Cc: linux-renesas-soc, Geert Uytterhoeven, Niklas Söderlund

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@ragnatech.se>
Reported-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] sh_eth: align usage of sh_eth_modify() with rest of driver
  2017-02-01 14:41 ` [PATCH 1/2] sh_eth: align usage of sh_eth_modify() with rest of driver Niklas Söderlund
@ 2017-02-01 15:55   ` Sergei Shtylyov
  0 siblings, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2017-02-01 15:55 UTC (permalink / raw)
  To: Niklas Söderlund, Simon Horman, netdev
  Cc: linux-renesas-soc, Geert Uytterhoeven

Hello!

On 02/01/2017 05:41 PM, Niklas Söderlund wrote:

> To be consistent with the rest of the driver when setting bits using
> sh_eth_modify() the same bit should also be cleared. This have no
> functional change and should have been done from the start.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket
  2017-02-01 14:41 ` [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket Niklas Söderlund
@ 2017-02-01 15:56   ` Sergei Shtylyov
  2017-02-01 15:56   ` Sergei Shtylyov
  1 sibling, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2017-02-01 15:56 UTC (permalink / raw)
  To: Niklas Söderlund, Simon Horman, netdev
  Cc: linux-renesas-soc, Geert Uytterhoeven

On 02/01/2017 05:41 PM, Niklas Söderlund wrote:

> 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@ragnatech.se>
> Reported-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket
  2017-02-01 14:41 ` [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket Niklas Söderlund
  2017-02-01 15:56   ` Sergei Shtylyov
@ 2017-02-01 15:56   ` Sergei Shtylyov
  1 sibling, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2017-02-01 15:56 UTC (permalink / raw)
  To: Niklas Söderlund, Simon Horman, netdev
  Cc: linux-renesas-soc, Geert Uytterhoeven

On 02/01/2017 05:41 PM, Niklas Söderlund wrote:

> 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

    Registered?

> MagicPacket check before the link change check.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Reported-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] sh_eth: fixes for MagicPacket handling
  2017-02-01 14:41 [PATCH 0/2] sh_eth: fixes for MagicPacket handling Niklas Söderlund
  2017-02-01 14:41 ` [PATCH 1/2] sh_eth: align usage of sh_eth_modify() with rest of driver Niklas Söderlund
  2017-02-01 14:41 ` [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket Niklas Söderlund
@ 2017-02-01 17:54 ` David Miller
  2017-02-01 18:06   ` Niklas Söderlund
  2 siblings, 1 reply; 8+ messages in thread
From: David Miller @ 2017-02-01 17:54 UTC (permalink / raw)
  To: niklas.soderlund+renesas
  Cc: sergei.shtylyov, horms+renesas, netdev, linux-renesas-soc, geert

From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Date: Wed,  1 Feb 2017 15:41:53 +0100

> This series contain two fixes for MagicPacket handling. It's based on 
> top of net-next and is tested on Koelsch.

Series applied, thanks.

I fixed the "register" --> "registered" thing in the commit message
for patch #2 when I applied this.

Thanks again.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 0/2] sh_eth: fixes for MagicPacket handling
  2017-02-01 17:54 ` [PATCH 0/2] sh_eth: fixes for MagicPacket handling David Miller
@ 2017-02-01 18:06   ` Niklas Söderlund
  0 siblings, 0 replies; 8+ messages in thread
From: Niklas Söderlund @ 2017-02-01 18:06 UTC (permalink / raw)
  To: David Miller
  Cc: sergei.shtylyov, horms+renesas, netdev, linux-renesas-soc, geert

On 2017-02-01 12:54:41 -0500, David Miller wrote:
> From: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> Date: Wed,  1 Feb 2017 15:41:53 +0100
> 
> > This series contain two fixes for MagicPacket handling. It's based on 
> > top of net-next and is tested on Koelsch.
> 
> Series applied, thanks.
> 
> I fixed the "register" --> "registered" thing in the commit message
> for patch #2 when I applied this.

Thanks for applying and thanks for fixing the typo.

> 
> Thanks again.

-- 
Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-02-01 18:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-01 14:41 [PATCH 0/2] sh_eth: fixes for MagicPacket handling Niklas Söderlund
2017-02-01 14:41 ` [PATCH 1/2] sh_eth: align usage of sh_eth_modify() with rest of driver Niklas Söderlund
2017-02-01 15:55   ` Sergei Shtylyov
2017-02-01 14:41 ` [PATCH 2/2] sh_eth: fix wakeup event reporting from MagicPacket Niklas Söderlund
2017-02-01 15:56   ` Sergei Shtylyov
2017-02-01 15:56   ` Sergei Shtylyov
2017-02-01 17:54 ` [PATCH 0/2] sh_eth: fixes for MagicPacket handling David Miller
2017-02-01 18:06   ` Niklas Söderlund

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).