linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v3 0/2] net: ravb: Fix potential issues
@ 2023-01-24  0:02 Yoshihiro Shimoda
  2023-01-24  0:02 ` [PATCH net v3 1/2] net: ravb: Fix lack of register setting after system resumed for Gen3 Yoshihiro Shimoda
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2023-01-24  0:02 UTC (permalink / raw)
  To: s.shtylyov, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-renesas-soc, Yoshihiro Shimoda

Fix potentiall issues on the ravb driver.

Changes from v2:
https://lore.kernel.org/all/20230123131331.1425648-1-yoshihiro.shimoda.uh@renesas.com/
 - Add Reviewed-by in the patch [2/2].
 - Add a commit description in the patch [2/2].

Changes from v1:
https://lore.kernel.org/all/20230119043920.875280-1-yoshihiro.shimoda.uh@renesas.com/
 - Fix typo in the patch [1/2].
 - Add Reviewed-by in the patch [1/2].
 - Fix "Fixed" tag in the patch [2/2].
 - Fix a comment indentation of the code in the patch [2/2].

Yoshihiro Shimoda (2):
  net: ravb: Fix lack of register setting after system resumed for Gen3
  net: ravb: Fix possible hang if RIS2_QFF1 happen

 drivers/net/ethernet/renesas/ravb_main.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
2.25.1


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

* [PATCH net v3 1/2] net: ravb: Fix lack of register setting after system resumed for Gen3
  2023-01-24  0:02 [PATCH net v3 0/2] net: ravb: Fix potential issues Yoshihiro Shimoda
@ 2023-01-24  0:02 ` Yoshihiro Shimoda
  2023-01-24  0:02 ` [PATCH net v3 2/2] net: ravb: Fix possible hang if RIS2_QFF1 happen Yoshihiro Shimoda
  2023-01-25 13:10 ` [PATCH net v3 0/2] net: ravb: Fix potential issues patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2023-01-24  0:02 UTC (permalink / raw)
  To: s.shtylyov, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-renesas-soc, Yoshihiro Shimoda

After system entered Suspend to RAM, registers setting of this
hardware is reset because the SoC will be turned off. On R-Car Gen3
(info->ccc_gac), ravb_ptp_init() is called in ravb_probe() only. So,
after system resumed, it lacks of the initial settings for ptp. So,
add ravb_ptp_{init,stop}() into ravb_{resume,suspend}().

Fixes: f5d7837f96e5 ("ravb: ptp: Add CONFIG mode support")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/net/ethernet/renesas/ravb_main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index b4e0fc7f65bd..3f61100c02f4 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -2973,6 +2973,9 @@ static int __maybe_unused ravb_suspend(struct device *dev)
 	else
 		ret = ravb_close(ndev);
 
+	if (priv->info->ccc_gac)
+		ravb_ptp_stop(ndev);
+
 	return ret;
 }
 
@@ -3011,6 +3014,9 @@ static int __maybe_unused ravb_resume(struct device *dev)
 	/* Restore descriptor base address table */
 	ravb_write(ndev, priv->desc_bat_dma, DBAT);
 
+	if (priv->info->ccc_gac)
+		ravb_ptp_init(ndev, priv->pdev);
+
 	if (netif_running(ndev)) {
 		if (priv->wol_enabled) {
 			ret = ravb_wol_restore(ndev);
-- 
2.25.1


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

* [PATCH net v3 2/2] net: ravb: Fix possible hang if RIS2_QFF1 happen
  2023-01-24  0:02 [PATCH net v3 0/2] net: ravb: Fix potential issues Yoshihiro Shimoda
  2023-01-24  0:02 ` [PATCH net v3 1/2] net: ravb: Fix lack of register setting after system resumed for Gen3 Yoshihiro Shimoda
@ 2023-01-24  0:02 ` Yoshihiro Shimoda
  2023-01-25 13:10 ` [PATCH net v3 0/2] net: ravb: Fix potential issues patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Yoshihiro Shimoda @ 2023-01-24  0:02 UTC (permalink / raw)
  To: s.shtylyov, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-renesas-soc, Yoshihiro Shimoda

Since this driver enables the interrupt by RIC2_QFE1, this driver
should clear the interrupt flag if it happens. Otherwise, the interrupt
causes to hang the system.

Note that this also fix a minor coding style (a comment indentation)
around the fixed code.

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/net/ethernet/renesas/ravb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 3f61100c02f4..0f54849a3823 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -1101,14 +1101,14 @@ static void ravb_error_interrupt(struct net_device *ndev)
 	ravb_write(ndev, ~(EIS_QFS | EIS_RESERVED), EIS);
 	if (eis & EIS_QFS) {
 		ris2 = ravb_read(ndev, RIS2);
-		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_RFFF | RIS2_RESERVED),
+		ravb_write(ndev, ~(RIS2_QFF0 | RIS2_QFF1 | RIS2_RFFF | RIS2_RESERVED),
 			   RIS2);
 
 		/* Receive Descriptor Empty int */
 		if (ris2 & RIS2_QFF0)
 			priv->stats[RAVB_BE].rx_over_errors++;
 
-		    /* Receive Descriptor Empty int */
+		/* Receive Descriptor Empty int */
 		if (ris2 & RIS2_QFF1)
 			priv->stats[RAVB_NC].rx_over_errors++;
 
-- 
2.25.1


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

* Re: [PATCH net v3 0/2] net: ravb: Fix potential issues
  2023-01-24  0:02 [PATCH net v3 0/2] net: ravb: Fix potential issues Yoshihiro Shimoda
  2023-01-24  0:02 ` [PATCH net v3 1/2] net: ravb: Fix lack of register setting after system resumed for Gen3 Yoshihiro Shimoda
  2023-01-24  0:02 ` [PATCH net v3 2/2] net: ravb: Fix possible hang if RIS2_QFF1 happen Yoshihiro Shimoda
@ 2023-01-25 13:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-01-25 13:10 UTC (permalink / raw)
  To: Yoshihiro Shimoda
  Cc: s.shtylyov, davem, edumazet, kuba, pabeni, netdev, linux-renesas-soc

Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue, 24 Jan 2023 09:02:09 +0900 you wrote:
> Fix potentiall issues on the ravb driver.
> 
> Changes from v2:
> https://lore.kernel.org/all/20230123131331.1425648-1-yoshihiro.shimoda.uh@renesas.com/
>  - Add Reviewed-by in the patch [2/2].
>  - Add a commit description in the patch [2/2].
> 
> [...]

Here is the summary with links:
  - [net,v3,1/2] net: ravb: Fix lack of register setting after system resumed for Gen3
    https://git.kernel.org/netdev/net/c/c2b6cdee1d13
  - [net,v3,2/2] net: ravb: Fix possible hang if RIS2_QFF1 happen
    https://git.kernel.org/netdev/net/c/f3c07758c900

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-01-25 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24  0:02 [PATCH net v3 0/2] net: ravb: Fix potential issues Yoshihiro Shimoda
2023-01-24  0:02 ` [PATCH net v3 1/2] net: ravb: Fix lack of register setting after system resumed for Gen3 Yoshihiro Shimoda
2023-01-24  0:02 ` [PATCH net v3 2/2] net: ravb: Fix possible hang if RIS2_QFF1 happen Yoshihiro Shimoda
2023-01-25 13:10 ` [PATCH net v3 0/2] net: ravb: Fix potential issues patchwork-bot+netdevbpf

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