netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
@ 2025-07-05 17:03 Biju Das
  2025-07-05 19:31 ` Russell King (Oracle)
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Biju Das @ 2025-07-05 17:03 UTC (permalink / raw)
  To: Lad Prabhakar, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue
  Cc: Biju Das, netdev, linux-renesas-soc, linux-stm32,
	linux-arm-kernel, linux-kernel, Geert Uytterhoeven, Biju Das

Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.

The PM deep entry is executed by pressing the SLEEP button and exit from
entry is by pressing the power button.

Logs:
root@smarc-rzg3e:~# PM: suspend entry (deep)
Filesystems sync: 0.115 seconds
Freezing user space processes
Freezing user space processes completed (elapsed 0.002 seconds)
OOM killer disabled.
Freezing remaining freezable tasks
Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
printk: Suspending console(s) (use no_console_suspend to debug)
NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
NOTICE:  BL2: SYS_LSI_PRR: 0x0
NOTICE:  BL2: Booting BL31
renesas-gbeth 15c30000.ethernet end0: Link is Down
Disabling non-boot CPUs ...
psci: CPU3 killed (polled 0 ms)
psci: CPU2 killed (polled 0 ms)
psci: CPU1 killed (polled 0 ms)
Enabling non-boot CPUs ...
Detected VIPT I-cache on CPU1
GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
CPU1 is up
Detected VIPT I-cache on CPU2
GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
CPU2 is up
Detected VIPT I-cache on CPU3
GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
CPU3 is up
dwmac4: Master AXI performs fixed burst length
15c30000.ethernet end0: No Safety Features support found
15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
15c30000.ethernet end0: configuring for phy/rgmii-id link mode
dwmac4: Master AXI performs fixed burst length
15c40000.ethernet end1: No Safety Features support found
15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
15c40000.ethernet end1: configuring for phy/rgmii-id link mode
OOM killer enabled.
Restarting tasks: Starting
Restarting tasks: Done
random: crng reseeded on system resumption
PM: suspend exit

15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
root@smarc-rzg3e:~# ifconfig end0 192.168.10.7 up
root@smarc-rzg3e:~# ping 192.168.10.1
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
This patch is tested with out-of tree patch for save/restore
ethernet OEN registers in the pinctrl block.
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
index 9a774046455b..df4ca897a60c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
@@ -136,6 +136,7 @@ static struct platform_driver renesas_gbeth_driver = {
 	.probe  = renesas_gbeth_probe,
 	.driver = {
 		.name		= "renesas-gbeth",
+		.pm		= &stmmac_pltfr_pm_ops,
 		.of_match_table	= renesas_gbeth_match,
 	},
 };
-- 
2.43.0


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

* Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-05 17:03 [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks Biju Das
@ 2025-07-05 19:31 ` Russell King (Oracle)
  2025-07-05 20:26   ` Biju Das
  2025-07-16 18:19 ` Biju Das
  2025-07-16 19:26 ` Lad, Prabhakar
  2 siblings, 1 reply; 12+ messages in thread
From: Russell King (Oracle) @ 2025-07-05 19:31 UTC (permalink / raw)
  To: Biju Das
  Cc: Lad Prabhakar, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev, linux-renesas-soc, linux-stm32, linux-arm-kernel,
	linux-kernel, Geert Uytterhoeven, Biju Das

On Sat, Jul 05, 2025 at 06:03:24PM +0100, Biju Das wrote:
> Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.
> 
> The PM deep entry is executed by pressing the SLEEP button and exit from
> entry is by pressing the power button.
> 
> Logs:
> root@smarc-rzg3e:~# PM: suspend entry (deep)
> Filesystems sync: 0.115 seconds
> Freezing user space processes
> Freezing user space processes completed (elapsed 0.002 seconds)
> OOM killer disabled.
> Freezing remaining freezable tasks
> Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> printk: Suspending console(s) (use no_console_suspend to debug)
> NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> NOTICE:  BL2: SYS_LSI_PRR: 0x0
> NOTICE:  BL2: Booting BL31
> renesas-gbeth 15c30000.ethernet end0: Link is Down
> Disabling non-boot CPUs ...
> psci: CPU3 killed (polled 0 ms)
> psci: CPU2 killed (polled 0 ms)
> psci: CPU1 killed (polled 0 ms)
> Enabling non-boot CPUs ...
> Detected VIPT I-cache on CPU1
> GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> CPU1 is up
> Detected VIPT I-cache on CPU2
> GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> CPU2 is up
> Detected VIPT I-cache on CPU3
> GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> CPU3 is up
> dwmac4: Master AXI performs fixed burst length
> 15c30000.ethernet end0: No Safety Features support found
> 15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
> 15c30000.ethernet end0: configuring for phy/rgmii-id link mode
> dwmac4: Master AXI performs fixed burst length
> 15c40000.ethernet end1: No Safety Features support found
> 15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
> 15c40000.ethernet end1: configuring for phy/rgmii-id link mode
> OOM killer enabled.
> Restarting tasks: Starting
> Restarting tasks: Done
> random: crng reseeded on system resumption
> PM: suspend exit
> 
> 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
> root@smarc-rzg3e:~# ifconfig end0 192.168.10.7 up
> root@smarc-rzg3e:~# ping 192.168.10.1
> PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
> 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
> 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms

You should also test with the interface configured before suspend/resume
and confirm that it continues working afterwards without being
reconfigured.

> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>

Thanks!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

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

* RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-05 19:31 ` Russell King (Oracle)
@ 2025-07-05 20:26   ` Biju Das
  2025-07-06  8:45     ` Biju Das
  0 siblings, 1 reply; 12+ messages in thread
From: Biju Das @ 2025-07-05 20:26 UTC (permalink / raw)
  To: Russell King
  Cc: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au



> -----Original Message-----
> From: Russell King <linux@armlinux.org.uk>
> Sent: 05 July 2025 20:31
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>;
> Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; Alexandre Torgue <alexandre.torgue@foss.st.com>; netdev@vger.kernel.org;
> linux-renesas-soc@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>; biju.das.au <biju.das.au@gmail.com>
> Subject: Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
> 
> On Sat, Jul 05, 2025 at 06:03:24PM +0100, Biju Das wrote:
> > Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.
> >
> > The PM deep entry is executed by pressing the SLEEP button and exit
> > from entry is by pressing the power button.
> >
> > Logs:
> > root@smarc-rzg3e:~# PM: suspend entry (deep) Filesystems sync: 0.115
> > seconds Freezing user space processes Freezing user space processes
> > completed (elapsed 0.002 seconds) OOM killer disabled.
> > Freezing remaining freezable tasks
> > Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> > printk: Suspending console(s) (use no_console_suspend to debug)
> > NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> > NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> > NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> > NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> > NOTICE:  BL2: SYS_LSI_PRR: 0x0
> > NOTICE:  BL2: Booting BL31
> > renesas-gbeth 15c30000.ethernet end0: Link is Down Disabling non-boot
> > CPUs ...
> > psci: CPU3 killed (polled 0 ms)
> > psci: CPU2 killed (polled 0 ms)
> > psci: CPU1 killed (polled 0 ms)
> > Enabling non-boot CPUs ...
> > Detected VIPT I-cache on CPU1
> > GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> > CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> > CPU1 is up
> > Detected VIPT I-cache on CPU2
> > GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> > CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> > CPU2 is up
> > Detected VIPT I-cache on CPU3
> > GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> > CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> > CPU3 is up
> > dwmac4: Master AXI performs fixed burst length 15c30000.ethernet end0:
> > No Safety Features support found 15c30000.ethernet end0: IEEE
> > 1588-2008 Advanced Timestamp supported 15c30000.ethernet end0:
> > configuring for phy/rgmii-id link mode
> > dwmac4: Master AXI performs fixed burst length 15c40000.ethernet end1:
> > No Safety Features support found 15c40000.ethernet end1: IEEE
> > 1588-2008 Advanced Timestamp supported 15c40000.ethernet end1:
> > configuring for phy/rgmii-id link mode OOM killer enabled.
> > Restarting tasks: Starting
> > Restarting tasks: Done
> > random: crng reseeded on system resumption
> > PM: suspend exit
> >
> > 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
> > root@smarc-rzg3e:~# ifconfig end0 192.168.10.7 up root@smarc-rzg3e:~#
> > ping 192.168.10.1 PING 192.168.10.1 (192.168.10.1) 56(84) bytes of
> > data.
> > 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
> > 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms
> 
> You should also test with the interface configured before suspend/resume and confirm that it continues
> working afterwards without being reconfigured.

Yes, I confirm it works without reconfiguration.

Please see the logs:
root@smarc-rzg3e:~# ifconfig
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
        inet 192.168.10.7  netmask 255.255.255.0  broadcast 192.168.10.255
        ether 00:11:22:33:44:55  txqueuelen 1000  (Ethernet)
        RX packets 35  bytes 2208 (2.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27  bytes 5368 (5.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 20

root@smarc-rzg3e:~# ping 192.168.10.1
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.866 ms
64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.900 ms
64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=0.938 ms
64 bytes from 192.168.10.1: icmp_seq=4 ttl=64 time=0.929 ms
64 bytes from 192.168.10.1: icmp_seq=5 ttl=64 time=0.890 ms
64 bytes from 192.168.10.1: icmp_seq=6 ttl=64 time=1.02 ms
[   75.812501] PM: suspend entry (deep)
[   75.849939] Filesystems sync: 0.033 seconds
[   75.855680] Freezing user space processes
[   75.861550] Freezing user space processes completed (elapsed 0.001 seconds)
[   75.868559] OOM killer disabled.
[   75.871788] Freezing remaining freezable tasks
[   75.877342] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   75.884724] printk: Suspending console(s) (use no_console_suspend to debug)
NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
NOTICE:  BL2: SYS_LSI_PRR: 0x0
NOTICE:  BL2: Booting BL31
[   75.939455] renesas-gbeth 15c30000.ethernet eth0: Link is Down
[   75.948464] Disabling non-boot CPUs ...
[   75.952584] psci: CPU3 killed (polled 0 ms)
[   75.957722] psci: CPU2 killed (polled 0 ms)
[   75.963385] psci: CPU1 killed (polled 4 ms)
[   75.967815] Enabling non-boot CPUs ...
[   75.968025] Detected VIPT I-cache on CPU1
[   75.968069] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
[   75.968107] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[   75.968786] CPU1 is up
[   75.968882] Detected VIPT I-cache on CPU2
[   75.968902] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
[   75.968922] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[   75.969351] CPU2 is up
[   75.969446] Detected VIPT I-cache on CPU3
[   75.969466] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
[   75.969486] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[   75.969980] CPU3 is up
[   75.987181] dwmac4: Master AXI performs fixed burst length
[   75.988097] renesas-gbeth 15c30000.ethernet eth0: No Safety Features support found
[   75.988117] renesas-gbeth 15c30000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   75.991717] renesas-gbeth 15c30000.ethernet eth0: configuring for phy/rgmii-id link mode
[   76.007851] dwmac4: Master AXI performs fixed burst length
[   76.008761] renesas-gbeth 15c40000.ethernet eth1: No Safety Features support found
[   76.008777] renesas-gbeth 15c40000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
[   76.012353] renesas-gbeth 15c40000.ethernet eth1: configuring for phy/rgmii-id link mode
[   76.204477] OOM killer enabled.
[   76.207609] Restarting tasks: Starting
[   76.212024] Restarting tasks: Done
[   76.215550] random: crng reseeded on system resumption
[   76.220909] PM: suspend exit
[   78.612495] renesas-gbeth 15c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
From 192.168.10.7 icmp_seq=7 Destination Host Unreachable
From 192.168.10.7 icmp_seq=8 Destination Host Unreachable
From 192.168.10.7 icmp_seq=9 Destination Host Unreachable
64 bytes from 192.168.10.1: icmp_seq=11 ttl=64 time=0.663 ms
64 bytes from 192.168.10.1: icmp_seq=12 ttl=64 time=1.19 ms

Cheers,
Biju

> 
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> 
> Thanks!
> 
> --
> RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
> FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

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

* RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-05 20:26   ` Biju Das
@ 2025-07-06  8:45     ` Biju Das
  2025-07-06  9:55       ` Biju Das
  2025-07-06 10:06       ` Russell King (Oracle)
  0 siblings, 2 replies; 12+ messages in thread
From: Biju Das @ 2025-07-06  8:45 UTC (permalink / raw)
  To: Biju Das, Russell King
  Cc: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au

Hi Russell King,

> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: 05 July 2025 21:27
> Subject: RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
> 
> 
> 
> > -----Original Message-----
> > From: Russell King <linux@armlinux.org.uk>
> > Subject: Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM
> > suspend/resume callbacks
> >
> > On Sat, Jul 05, 2025 at 06:03:24PM +0100, Biju Das wrote:
> > > Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.
> > >
> > > The PM deep entry is executed by pressing the SLEEP button and exit
> > > from entry is by pressing the power button.
> > >
> > > Logs:
> > > root@smarc-rzg3e:~# PM: suspend entry (deep) Filesystems sync: 0.115
> > > seconds Freezing user space processes Freezing user space processes
> > > completed (elapsed 0.002 seconds) OOM killer disabled.
> > > Freezing remaining freezable tasks
> > > Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> > > printk: Suspending console(s) (use no_console_suspend to debug)
> > > NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> > > NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> > > NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> > > NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> > > NOTICE:  BL2: SYS_LSI_PRR: 0x0
> > > NOTICE:  BL2: Booting BL31
> > > renesas-gbeth 15c30000.ethernet end0: Link is Down Disabling
> > > non-boot CPUs ...
> > > psci: CPU3 killed (polled 0 ms)
> > > psci: CPU2 killed (polled 0 ms)
> > > psci: CPU1 killed (polled 0 ms)
> > > Enabling non-boot CPUs ...
> > > Detected VIPT I-cache on CPU1
> > > GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> > > CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> > > CPU1 is up
> > > Detected VIPT I-cache on CPU2
> > > GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> > > CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> > > CPU2 is up
> > > Detected VIPT I-cache on CPU3
> > > GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> > > CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> > > CPU3 is up
> > > dwmac4: Master AXI performs fixed burst length 15c30000.ethernet end0:
> > > No Safety Features support found 15c30000.ethernet end0: IEEE
> > > 1588-2008 Advanced Timestamp supported 15c30000.ethernet end0:
> > > configuring for phy/rgmii-id link mode
> > > dwmac4: Master AXI performs fixed burst length 15c40000.ethernet end1:
> > > No Safety Features support found 15c40000.ethernet end1: IEEE
> > > 1588-2008 Advanced Timestamp supported 15c40000.ethernet end1:
> > > configuring for phy/rgmii-id link mode OOM killer enabled.
> > > Restarting tasks: Starting
> > > Restarting tasks: Done
> > > random: crng reseeded on system resumption
> > > PM: suspend exit
> > >
> > > 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
> > > root@smarc-rzg3e:~# ifconfig end0 192.168.10.7 up
> > > root@smarc-rzg3e:~# ping 192.168.10.1 PING 192.168.10.1
> > > (192.168.10.1) 56(84) bytes of data.
> > > 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
> > > 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms
> >
> > You should also test with the interface configured before
> > suspend/resume and confirm that it continues working afterwards without being reconfigured.
> 
> Yes, I confirm it works without reconfiguration.
> 
> Please see the logs:
> root@smarc-rzg3e:~# ifconfig
> eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
>         inet 192.168.10.7  netmask 255.255.255.0  broadcast 192.168.10.255
>         ether 00:11:22:33:44:55  txqueuelen 1000  (Ethernet)
>         RX packets 35  bytes 2208 (2.1 KiB)
>         RX errors 0  dropped 0  overruns 0  frame 0
>         TX packets 27  bytes 5368 (5.2 KiB)
>         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
>         device interrupt 20
> 
> root@smarc-rzg3e:~# ping 192.168.10.1
> PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
> 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.866 ms
> 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.900 ms
> 64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=0.938 ms
> 64 bytes from 192.168.10.1: icmp_seq=4 ttl=64 time=0.929 ms
> 64 bytes from 192.168.10.1: icmp_seq=5 ttl=64 time=0.890 ms
> 64 bytes from 192.168.10.1: icmp_seq=6 ttl=64 time=1.02 ms
> [   75.812501] PM: suspend entry (deep)
> [   75.849939] Filesystems sync: 0.033 seconds
> [   75.855680] Freezing user space processes
> [   75.861550] Freezing user space processes completed (elapsed 0.001 seconds)
> [   75.868559] OOM killer disabled.
> [   75.871788] Freezing remaining freezable tasks
> [   75.877342] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> [   75.884724] printk: Suspending console(s) (use no_console_suspend to debug)
> NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> NOTICE:  BL2: SYS_LSI_PRR: 0x0
> NOTICE:  BL2: Booting BL31
> [   75.939455] renesas-gbeth 15c30000.ethernet eth0: Link is Down
> [   75.948464] Disabling non-boot CPUs ...
> [   75.952584] psci: CPU3 killed (polled 0 ms)
> [   75.957722] psci: CPU2 killed (polled 0 ms)
> [   75.963385] psci: CPU1 killed (polled 4 ms)
> [   75.967815] Enabling non-boot CPUs ...
> [   75.968025] Detected VIPT I-cache on CPU1
> [   75.968069] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> [   75.968107] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> [   75.968786] CPU1 is up
> [   75.968882] Detected VIPT I-cache on CPU2
> [   75.968902] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> [   75.968922] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> [   75.969351] CPU2 is up
> [   75.969446] Detected VIPT I-cache on CPU3
> [   75.969466] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> [   75.969486] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> [   75.969980] CPU3 is up
> [   75.987181] dwmac4: Master AXI performs fixed burst length
> [   75.988097] renesas-gbeth 15c30000.ethernet eth0: No Safety Features support found
> [   75.988117] renesas-gbeth 15c30000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
> [   75.991717] renesas-gbeth 15c30000.ethernet eth0: configuring for phy/rgmii-id link mode
> [   76.007851] dwmac4: Master AXI performs fixed burst length
> [   76.008761] renesas-gbeth 15c40000.ethernet eth1: No Safety Features support found
> [   76.008777] renesas-gbeth 15c40000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
> [   76.012353] renesas-gbeth 15c40000.ethernet eth1: configuring for phy/rgmii-id link mode
> [   76.204477] OOM killer enabled.
> [   76.207609] Restarting tasks: Starting
> [   76.212024] Restarting tasks: Done
> [   76.215550] random: crng reseeded on system resumption
> [   76.220909] PM: suspend exit
> [   78.612495] renesas-gbeth 15c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
> From 192.168.10.7 icmp_seq=7 Destination Host Unreachable From 192.168.10.7 icmp_seq=8 Destination
> Host Unreachable From 192.168.10.7 icmp_seq=9 Destination Host Unreachable
> 64 bytes from 192.168.10.1: icmp_seq=11 ttl=64 time=0.663 ms
> 64 bytes from 192.168.10.1: icmp_seq=12 ttl=64 time=1.19 ms
> 

FYI, The above testing is done with rootFS mounted on SD card.

But when I mount rootFS on NFS, after wakeup, I am not able to contact the NFS server.

The below patch makes it to work[1].
Not sure, why the original code is failing if the rootFS is mounted on NFS?

Cheers,
Biju

[1]
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
index df4ca897a60c..434ef1802195 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
@@ -25,6 +25,8 @@ struct renesas_gbeth {
        struct plat_stmmacenet_data *plat_dat;
        struct reset_control *rstc;
        struct device *dev;
+
+       bool suspend;
 };
 
 static const char *const renesas_gbeth_clks[] = {
@@ -50,6 +52,13 @@ static int renesas_gbeth_init(struct platform_device *pdev, void *priv)
        if (ret)
                reset_control_assert(gbeth->rstc);
 
+       if (gbeth->suspend) {
+               struct net_device *ndev = platform_get_drvdata(pdev);
+
+               gbeth->suspend = false;
+               phy_init_hw(ndev->phydev);
+       }
+
        return ret;
 }
 
@@ -66,6 +75,8 @@ static void renesas_gbeth_exit(struct platform_device *pdev, void *priv)
        ret = reset_control_assert(gbeth->rstc);
        if (ret)
                dev_err(gbeth->dev, "Reset assert failed\n");
+
+       gbeth->suspend = true;
 }

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

* RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-06  8:45     ` Biju Das
@ 2025-07-06  9:55       ` Biju Das
  2025-07-06 10:10         ` Russell King (Oracle)
  2025-07-06 10:06       ` Russell King (Oracle)
  1 sibling, 1 reply; 12+ messages in thread
From: Biju Das @ 2025-07-06  9:55 UTC (permalink / raw)
  To: Russell King
  Cc: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au



> -----Original Message-----
> From: Biju Das
> Sent: 06 July 2025 09:45
> Subject: RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
> 
> Hi Russell King,
> 
> > -----Original Message-----
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> > Sent: 05 July 2025 21:27
> > Subject: RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM
> > suspend/resume callbacks
> >
> >
> >
> > > -----Original Message-----
> > > From: Russell King <linux@armlinux.org.uk>
> > > Subject: Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add
> > > PM suspend/resume callbacks
> > >
> > > On Sat, Jul 05, 2025 at 06:03:24PM +0100, Biju Das wrote:
> > > > Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.
> > > >
> > > > The PM deep entry is executed by pressing the SLEEP button and
> > > > exit from entry is by pressing the power button.
> > > >
> > > > Logs:
> > > > root@smarc-rzg3e:~# PM: suspend entry (deep) Filesystems sync:
> > > > 0.115 seconds Freezing user space processes Freezing user space
> > > > processes completed (elapsed 0.002 seconds) OOM killer disabled.
> > > > Freezing remaining freezable tasks Freezing remaining freezable
> > > > tasks completed (elapsed 0.001 seconds)
> > > > printk: Suspending console(s) (use no_console_suspend to debug)
> > > > NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> > > > NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> > > > NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> > > > NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> > > > NOTICE:  BL2: SYS_LSI_PRR: 0x0
> > > > NOTICE:  BL2: Booting BL31
> > > > renesas-gbeth 15c30000.ethernet end0: Link is Down Disabling
> > > > non-boot CPUs ...
> > > > psci: CPU3 killed (polled 0 ms)
> > > > psci: CPU2 killed (polled 0 ms)
> > > > psci: CPU1 killed (polled 0 ms)
> > > > Enabling non-boot CPUs ...
> > > > Detected VIPT I-cache on CPU1
> > > > GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> > > > CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> > > > CPU1 is up
> > > > Detected VIPT I-cache on CPU2
> > > > GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> > > > CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> > > > CPU2 is up
> > > > Detected VIPT I-cache on CPU3
> > > > GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> > > > CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> > > > CPU3 is up
> > > > dwmac4: Master AXI performs fixed burst length 15c30000.ethernet end0:
> > > > No Safety Features support found 15c30000.ethernet end0: IEEE
> > > > 1588-2008 Advanced Timestamp supported 15c30000.ethernet end0:
> > > > configuring for phy/rgmii-id link mode
> > > > dwmac4: Master AXI performs fixed burst length 15c40000.ethernet end1:
> > > > No Safety Features support found 15c40000.ethernet end1: IEEE
> > > > 1588-2008 Advanced Timestamp supported 15c40000.ethernet end1:
> > > > configuring for phy/rgmii-id link mode OOM killer enabled.
> > > > Restarting tasks: Starting
> > > > Restarting tasks: Done
> > > > random: crng reseeded on system resumption
> > > > PM: suspend exit
> > > >
> > > > 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control
> > > > rx/tx root@smarc-rzg3e:~# ifconfig end0 192.168.10.7 up
> > > > root@smarc-rzg3e:~# ping 192.168.10.1 PING 192.168.10.1
> > > > (192.168.10.1) 56(84) bytes of data.
> > > > 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
> > > > 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms
> > >
> > > You should also test with the interface configured before
> > > suspend/resume and confirm that it continues working afterwards without being reconfigured.
> >
> > Yes, I confirm it works without reconfiguration.
> >
> > Please see the logs:
> > root@smarc-rzg3e:~# ifconfig
> > eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC>  mtu 1500
> >         inet 192.168.10.7  netmask 255.255.255.0  broadcast 192.168.10.255
> >         ether 00:11:22:33:44:55  txqueuelen 1000  (Ethernet)
> >         RX packets 35  bytes 2208 (2.1 KiB)
> >         RX errors 0  dropped 0  overruns 0  frame 0
> >         TX packets 27  bytes 5368 (5.2 KiB)
> >         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> >         device interrupt 20
> >
> > root@smarc-rzg3e:~# ping 192.168.10.1
> > PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
> > 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.866 ms
> > 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.900 ms
> > 64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=0.938 ms
> > 64 bytes from 192.168.10.1: icmp_seq=4 ttl=64 time=0.929 ms
> > 64 bytes from 192.168.10.1: icmp_seq=5 ttl=64 time=0.890 ms
> > 64 bytes from 192.168.10.1: icmp_seq=6 ttl=64 time=1.02 ms
> > [   75.812501] PM: suspend entry (deep)
> > [   75.849939] Filesystems sync: 0.033 seconds
> > [   75.855680] Freezing user space processes
> > [   75.861550] Freezing user space processes completed (elapsed 0.001 seconds)
> > [   75.868559] OOM killer disabled.
> > [   75.871788] Freezing remaining freezable tasks
> > [   75.877342] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> > [   75.884724] printk: Suspending console(s) (use no_console_suspend to debug)
> > NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> > NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> > NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> > NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> > NOTICE:  BL2: SYS_LSI_PRR: 0x0
> > NOTICE:  BL2: Booting BL31
> > [   75.939455] renesas-gbeth 15c30000.ethernet eth0: Link is Down
> > [   75.948464] Disabling non-boot CPUs ...
> > [   75.952584] psci: CPU3 killed (polled 0 ms)
> > [   75.957722] psci: CPU2 killed (polled 0 ms)
> > [   75.963385] psci: CPU1 killed (polled 4 ms)
> > [   75.967815] Enabling non-boot CPUs ...
> > [   75.968025] Detected VIPT I-cache on CPU1
> > [   75.968069] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> > [   75.968107] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> > [   75.968786] CPU1 is up
> > [   75.968882] Detected VIPT I-cache on CPU2
> > [   75.968902] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> > [   75.968922] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> > [   75.969351] CPU2 is up
> > [   75.969446] Detected VIPT I-cache on CPU3
> > [   75.969466] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> > [   75.969486] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> > [   75.969980] CPU3 is up
> > [   75.987181] dwmac4: Master AXI performs fixed burst length
> > [   75.988097] renesas-gbeth 15c30000.ethernet eth0: No Safety Features support found
> > [   75.988117] renesas-gbeth 15c30000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
> > [   75.991717] renesas-gbeth 15c30000.ethernet eth0: configuring for phy/rgmii-id link mode
> > [   76.007851] dwmac4: Master AXI performs fixed burst length
> > [   76.008761] renesas-gbeth 15c40000.ethernet eth1: No Safety Features support found
> > [   76.008777] renesas-gbeth 15c40000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
> > [   76.012353] renesas-gbeth 15c40000.ethernet eth1: configuring for phy/rgmii-id link mode
> > [   76.204477] OOM killer enabled.
> > [   76.207609] Restarting tasks: Starting
> > [   76.212024] Restarting tasks: Done
> > [   76.215550] random: crng reseeded on system resumption
> > [   76.220909] PM: suspend exit
> > [   78.612495] renesas-gbeth 15c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
> > From 192.168.10.7 icmp_seq=7 Destination Host Unreachable From
> > 192.168.10.7 icmp_seq=8 Destination Host Unreachable From 192.168.10.7
> > icmp_seq=9 Destination Host Unreachable
> > 64 bytes from 192.168.10.1: icmp_seq=11 ttl=64 time=0.663 ms
> > 64 bytes from 192.168.10.1: icmp_seq=12 ttl=64 time=1.19 ms
> >
> 
> FYI, The above testing is done with rootFS mounted on SD card.
> 
> But when I mount rootFS on NFS, after wakeup, I am not able to contact the NFS server.
> 
> The below patch makes it to work[1].
> Not sure, why the original code is failing if the rootFS is mounted on NFS?
> 
> Cheers,
> Biju
> 
> [1]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> index df4ca897a60c..434ef1802195 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> @@ -25,6 +25,8 @@ struct renesas_gbeth {
>         struct plat_stmmacenet_data *plat_dat;
>         struct reset_control *rstc;
>         struct device *dev;
> +
> +       bool suspend;
>  };
> 
>  static const char *const renesas_gbeth_clks[] = { @@ -50,6 +52,13 @@ static int
> renesas_gbeth_init(struct platform_device *pdev, void *priv)
>         if (ret)
>                 reset_control_assert(gbeth->rstc);
> 
> +       if (gbeth->suspend) {
> +               struct net_device *ndev = platform_get_drvdata(pdev);
> +
> +               gbeth->suspend = false;
> +               phy_init_hw(ndev->phydev);
> +       }
> +
>         return ret;
>  }
> 
> @@ -66,6 +75,8 @@ static void renesas_gbeth_exit(struct platform_device *pdev, void *priv)
>         ret = reset_control_assert(gbeth->rstc);
>         if (ret)
>                 dev_err(gbeth->dev, "Reset assert failed\n");
> +
> +       gbeth->suspend = true;
>  }

Just adding some logs:
Currently PHY resume is called twice
[   35.754933]  kszphy_resume+0x3c/0xf0
[   35.754940]  phy_resume+0x3c/0x74
[   35.754949]  phylink_prepare_resume+0x58/0xa0
[   35.754957]  stmmac_resume+0x90/0x2a0
[   35.771296]  stmmac_pltfr_resume+0x3c/0x4c

and

[   35.771258]  kszphy_resume+0x3c/0xf0
[   35.771263]  __phy_resume+0x28/0x54
[   35.771270]  phy_start+0x7c/0xb4
[   35.771275]  phylink_start+0xb8/0x210
[   35.771282]  phylink_resume+0x7c/0xc4
[   35.771288]  stmmac_resume+0x1ec/0x2a0
[   35.771296]  stmmac_pltfr_resume+0x3c/0x4c

With patch[1], there is only one kszphy_resume() call.

1) Detailed logs working case RootFS mounted on SD:

root@smarc-rzg3e:~# [   35.599061] PM: suspend entry (deep)
[   35.635942] Filesystems sync: 0.033 seconds
[   35.642070] Freezing user space processes
[   35.647741] Freezing user space processes completed (elapsed 0.001 seconds)
[   35.654826] OOM killer disabled.
[   35.658042] Freezing remaining freezable tasks
[   35.663649] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   35.671047] printk: Suspending console(s) (use no_console_suspend to debug)
NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
NOTICE:  BL2: SYS_LSI_PRR: 0x0
NOTICE:  BL2: Booting BL31
[   35.722047] libphy: #######phy_suspend 1908
[   35.722082] ########kszphy_suspend 2350
[   35.722142] renesas-gbeth 15c30000.ethernet eth0: Link is Down
[   35.722823] ########kszphy_suspend 2356
[   35.723183] ########kszphy_generic_suspend 2343
[   35.723215] libphy: #######phy_suspend 1925
[   35.730939] Disabling non-boot CPUs ...
[   35.734909] psci: CPU3 killed (polled 4 ms)
[   35.741526] psci: CPU2 killed (polled 0 ms)
[   35.746911] psci: CPU1 killed (polled 4 ms)
[   35.749344] Enabling non-boot CPUs ...
[   35.749557] Detected VIPT I-cache on CPU1
[   35.749601] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
[   35.749639] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[   35.750293] CPU1 is up
[   35.750385] Detected VIPT I-cache on CPU2
[   35.750406] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
[   35.750427] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[   35.750879] CPU2 is up
[   35.750973] Detected VIPT I-cache on CPU3
[   35.750993] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
[   35.751015] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[   35.751483] CPU3 is up
[   35.754875] ########kszphy_resume 2389
[   35.754887] CPU: 1 UID: 0 PID: 281 Comm: systemd-sleep Not tainted 6.16.0-rc4-next-20250703-gf2ebaf5365aa-dirty #63 PREEMPT
[   35.754895] Hardware name: Renesas SMARC EVK version 2 based on r9a09g047e57 (DT)
[   35.754898] Call trace:
[   35.754902]  show_stack+0x18/0x24 (C)
[   35.754917]  dump_stack_lvl+0x78/0x90
[   35.754927]  dump_stack+0x18/0x24
[   35.754933]  kszphy_resume+0x3c/0xf0
[   35.754940]  phy_resume+0x3c/0x74
[   35.754949]  phylink_prepare_resume+0x58/0xa0
[   35.754957]  stmmac_resume+0x90/0x2a0
[   35.754967]  stmmac_pltfr_resume+0x3c/0x4c
[   35.754974]  device_resume+0x108/0x1ec
[   35.754983]  dpm_resume+0x198/0x1b8
[   35.754990]  dpm_resume_end+0x20/0x38
[   35.754996]  suspend_devices_and_enter+0x4a8/0x58c
[   35.755006]  pm_suspend+0x180/0x20c
[   35.755011]  state_store+0x80/0xec
[   35.755017]  kobj_attr_store+0x18/0x2c
[   35.755023]  sysfs_kf_write+0x7c/0x94
[   35.755031]  kernfs_fop_write_iter+0x120/0x1ec
[   35.755037]  vfs_write+0x238/0x370
[   35.755045]  ksys_write+0x6c/0x100
[   35.755051]  __arm64_sys_write+0x1c/0x28
[   35.755056]  invoke_syscall+0x48/0x110
[   35.755065]  el0_svc_common.constprop.0+0xc0/0xe0
[   35.755072]  do_el0_svc+0x1c/0x28
[   35.755078]  el0_svc+0x34/0xf0
[   35.755086]  el0t_64_sync_handler+0xa0/0xe4
[   35.755093]  el0t_64_sync+0x198/0x19c
[   35.755099] ########kszphy_generic_resume 2328
[   35.757673] ########kszphy_resume 2413
[   35.766674] dwmac4: Master AXI performs fixed burst length
[   35.767591] renesas-gbeth 15c30000.ethernet eth0: No Safety Features support found
[   35.767611] renesas-gbeth 15c30000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   35.771205] renesas-gbeth 15c30000.ethernet eth0: configuring for phy/rgmii-id link mode
[   35.771221] ########kszphy_resume 2389
[   35.771227] CPU: 1 UID: 0 PID: 281 Comm: systemd-sleep Not tainted 6.16.0-rc4-next-20250703-gf2ebaf5365aa-dirty #63 PREEMPT
[   35.771234] Hardware name: Renesas SMARC EVK version 2 based on r9a09g047e57 (DT)
[   35.771236] Call trace:
[   35.771238]  show_stack+0x18/0x24 (C)
[   35.771245]  dump_stack_lvl+0x78/0x90
[   35.771252]  dump_stack+0x18/0x24
[   35.771258]  kszphy_resume+0x3c/0xf0
[   35.771263]  __phy_resume+0x28/0x54
[   35.771270]  phy_start+0x7c/0xb4
[   35.771275]  phylink_start+0xb8/0x210
[   35.771282]  phylink_resume+0x7c/0xc4
[   35.771288]  stmmac_resume+0x1ec/0x2a0
[   35.771296]  stmmac_pltfr_resume+0x3c/0x4c
[   35.771303]  device_resume+0x108/0x1ec
[   35.771309]  dpm_resume+0x198/0x1b8
[   35.771316]  dpm_resume_end+0x20/0x38
[   35.771322]  suspend_devices_and_enter+0x4a8/0x58c
[   35.771329]  pm_suspend+0x180/0x20c
[   35.771334]  state_store+0x80/0xec
[   35.771340]  kobj_attr_store+0x18/0x2c
[   35.771345]  sysfs_kf_write+0x7c/0x94
[   35.771351]  kernfs_fop_write_iter+0x120/0x1ec
[   35.771356]  vfs_write+0x238/0x370
[   35.771363]  ksys_write+0x6c/0x100
[   35.771368]  __arm64_sys_write+0x1c/0x28
[   35.771374]  invoke_syscall+0x48/0x110
[   35.771381]  el0_svc_common.constprop.0+0xc0/0xe0
[   35.771388]  do_el0_svc+0x1c/0x28
[   35.771394]  el0_svc+0x34/0xf0
[   35.771401]  el0t_64_sync_handler+0xa0/0xe4
[   35.771407]  el0t_64_sync+0x198/0x19c
[   35.771412] ########kszphy_generic_resume 2328
[   35.773979] ########kszphy_resume 2413
[   36.018701] SDHI2-VQMMC: disabling
[   36.228208] OOM killer enabled.
[   36.231349] Restarting tasks: Starting
[   36.235635] Restarting tasks: Done
[   36.239154] random: crng reseeded on system resumption
[   36.244473] PM: suspend exit

root@smarc-rzg3e:~# [   38.520643] renesas-gbeth 15c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

2) Detailed logs NON working case RootFS mounted on NFS:
NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
NOTICE:  BL2: SYS_LSI_PRR: 0x0
NOTICE:  BL2: Booting BL31
[   21.156070] libphy: #######phy_suspend 1908
[   21.156109] ########kszphy_suspend 2350
[   21.156161] renesas-gbeth 15c30000.ethernet eth0: Link is Down
[   21.156788] ########kszphy_suspend 2356
[   21.157144] ########kszphy_generic_suspend 2343
[   21.157174] libphy: #######phy_suspend 1925
[   21.165512] Disabling non-boot CPUs ...
[   21.169679] psci: CPU3 killed (polled 4 ms)
[   21.180952] psci: CPU2 killed (polled 0 ms)
[   21.188027] psci: CPU1 killed (polled 0 ms)
[   21.190677] Enabling non-boot CPUs ...
[   21.190883] Detected VIPT I-cache on CPU1
[   21.190929] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
[   21.190967] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[   21.191653] CPU1 is up
[   21.191748] Detected VIPT I-cache on CPU2
[   21.191769] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
[   21.191789] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[   21.192225] CPU2 is up
[   21.192321] Detected VIPT I-cache on CPU3
[   21.192341] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
[   21.192362] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[   21.192879] CPU3 is up
[   21.197553] ########kszphy_resume 2389
[   21.197566] CPU: 3 UID: 0 PID: 288 Comm: systemd-sleep Not tainted 6.16.0-rc4-next-20250703-gf2ebaf5365aa-dirty #63 PREEMPT
[   21.197574] Hardware name: Renesas SMARC EVK version 2 based on r9a09g047e57 (DT)
[   21.197578] Call trace:
[   21.197581]  show_stack+0x18/0x24 (C)
[   21.197595]  dump_stack_lvl+0x78/0x90
[   21.197606]  dump_stack+0x18/0x24
[   21.197612]  kszphy_resume+0x3c/0xf0
[   21.197619]  phy_resume+0x3c/0x74
[   21.197628]  phylink_prepare_resume+0x58/0xa0
[   21.197636]  stmmac_resume+0x90/0x2a0
[   21.197646]  stmmac_pltfr_resume+0x3c/0x4c
[   21.197653]  device_resume+0x108/0x1ec
[   21.197663]  dpm_resume+0x198/0x1b8
[   21.197669]  dpm_resume_end+0x20/0x38
[   21.197675]  suspend_devices_and_enter+0x4a8/0x58c
[   21.197684]  pm_suspend+0x180/0x20c
[   21.197689]  state_store+0x80/0xec
[   21.197695]  kobj_attr_store+0x18/0x2c
[   21.197702]  sysfs_kf_write+0x7c/0x94
[   21.197709]  kernfs_fop_write_iter+0x120/0x1ec
[   21.197714]  vfs_write+0x238/0x370
[   21.197723]  ksys_write+0x6c/0x100
[   21.197729]  __arm64_sys_write+0x1c/0x28
[   21.197735]  invoke_syscall+0x48/0x110
[   21.197743]  el0_svc_common.constprop.0+0xc0/0xe0
[   21.197749]  do_el0_svc+0x1c/0x28
[   21.197756]  el0_svc+0x34/0xf0
[   21.197763]  el0t_64_sync_handler+0xa0/0xe4
[   21.197770]  el0t_64_sync+0x198/0x19c
[   21.197776] ########kszphy_generic_resume 2328
[   21.200350] ########kszphy_resume 2413
[   21.209338] dwmac4: Master AXI performs fixed burst length
[   21.210253] renesas-gbeth 15c30000.ethernet eth0: No Safety Features support found
[   21.210273] renesas-gbeth 15c30000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   21.213870] renesas-gbeth 15c30000.ethernet eth0: configuring for phy/rgmii-id link mode
[   21.213886] ########kszphy_resume 2389
[   21.213891] CPU: 3 UID: 0 PID: 288 Comm: systemd-sleep Not tainted 6.16.0-rc4-next-20250703-gf2ebaf5365aa-dirty #63 PREEMPT
[   21.213897] Hardware name: Renesas SMARC EVK version 2 based on r9a09g047e57 (DT)
[   21.213900] Call trace:
[   21.213902]  show_stack+0x18/0x24 (C)
[   21.213909]  dump_stack_lvl+0x78/0x90
[   21.213917]  dump_stack+0x18/0x24
[   21.213922]  kszphy_resume+0x3c/0xf0
[   21.213928]  __phy_resume+0x28/0x54
[   21.213935]  phy_start+0x7c/0xb4
[   21.213940]  phylink_start+0xb8/0x210
[   21.213948]  phylink_resume+0x7c/0xc4
[   21.213955]  stmmac_resume+0x1ec/0x2a0
[   21.213962]  stmmac_pltfr_resume+0x3c/0x4c
[   21.213969]  device_resume+0x108/0x1ec
[   21.213976]  dpm_resume+0x198/0x1b8
[   21.213982]  dpm_resume_end+0x20/0x38
[   21.213988]  suspend_devices_and_enter+0x4a8/0x58c
[   21.213995]  pm_suspend+0x180/0x20c
[   21.214001]  state_store+0x80/0xec
[   21.214006]  kobj_attr_store+0x18/0x2c
[   21.214011]  sysfs_kf_write+0x7c/0x94
[   21.214018]  kernfs_fop_write_iter+0x120/0x1ec
[   21.214023]  vfs_write+0x238/0x370
[   21.214030]  ksys_write+0x6c/0x100
[   21.214035]  __arm64_sys_write+0x1c/0x28
[   21.214041]  invoke_syscall+0x48/0x110
[   21.214048]  el0_svc_common.constprop.0+0xc0/0xe0
[   21.214055]  do_el0_svc+0x1c/0x28
[   21.214062]  el0_svc+0x34/0xf0
[   21.214068]  el0t_64_sync_handler+0xa0/0xe4
[   21.214074]  el0t_64_sync+0x198/0x19c
[   21.214080] ########kszphy_generic_resume 2328
[   21.216646] ########kszphy_resume 2413
[   22.661587] OOM killer enabled.
[   22.668623] Restarting tasks: Starting

[   22.673694] Restarting tasks: Done
[   22.677226] random: crng reseeded on system resumption
[   22.682799] PM: suspend exit
root@smarc-rzg3e:~# [   23.801866] renesas-gbeth 15c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx

3) Detailed logs working case RootFS mounted on NFS with patch[1] above:

root@smarc-rzg3e:~# [   20.859463] PM: suspend entry (deep)
[   20.863297] Filesystems sync: 0.000 seconds
[   20.870616] Freezing user space processes
[   20.876719] Freezing user space processes completed (elapsed 0.001 seconds)
[   20.883685] OOM killer disabled.
[   20.886912] Freezing remaining freezable tasks
[   20.892475] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   20.899863] printk: Suspending console(s) (use no_console_suspend to debug)
NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
NOTICE:  BL2: SYS_LSI_PRR: 0x0
NOTICE:  BL2: Booting BL31
[   20.953817] libphy: #######phy_suspend 1908
[   20.953853] ########kszphy_suspend 2350
[   20.953912] renesas-gbeth 15c30000.ethernet eth0: Link is Down
[   20.954530] ########kszphy_suspend 2356
[   20.954880] ########kszphy_generic_suspend 2343
[   20.954911] libphy: #######phy_suspend 1925
[   20.963329] Disabling non-boot CPUs ...
[   20.967649] psci: CPU3 killed (polled 0 ms)
[   20.975948] psci: CPU2 killed (polled 0 ms)
[   20.984986] psci: CPU1 killed (polled 0 ms)
[   20.990162] Enabling non-boot CPUs ...
[   20.990375] Detected VIPT I-cache on CPU1
[   20.990419] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
[   20.990456] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[   20.991154] CPU1 is up
[   20.991248] Detected VIPT I-cache on CPU2
[   20.991269] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
[   20.991289] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[   20.991736] CPU2 is up
[   20.991833] Detected VIPT I-cache on CPU3
[   20.991854] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
[   20.991875] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[   20.992378] CPU3 is up
[   21.068746] dwmac4: Master AXI performs fixed burst length
[   21.069681] renesas-gbeth 15c30000.ethernet eth0: No Safety Features support found
[   21.069701] renesas-gbeth 15c30000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   21.073298] renesas-gbeth 15c30000.ethernet eth0: configuring for phy/rgmii-id link mode
[   21.073315] ########kszphy_resume 2389
[   21.073325] CPU: 1 UID: 0 PID: 285 Comm: systemd-sleep Not tainted 6.16.0-rc4-next-20250703-gf2ebaf5365aa-dirty #64 PREEMPT
[   21.073332] Hardware name: Renesas SMARC EVK version 2 based on r9a09g047e57 (DT)
[   21.073336] Call trace:
[   21.073340]  show_stack+0x18/0x24 (C)
[   21.073354]  dump_stack_lvl+0x78/0x90
[   21.073364]  dump_stack+0x18/0x24
[   21.073370]  kszphy_resume+0x3c/0xf0
[   21.073377]  __phy_resume+0x28/0x54
[   21.073385]  phy_start+0x7c/0xb4
[   21.073390]  phylink_start+0xb8/0x210
[   21.073398]  phylink_resume+0x7c/0xc4
[   21.073404]  stmmac_resume+0x1ec/0x2a0
[   21.073413]  stmmac_pltfr_resume+0x3c/0x4c
[   21.073420]  device_resume+0x108/0x1ec
[   21.073429]  dpm_resume+0x198/0x1b8
[   21.073435]  dpm_resume_end+0x20/0x38
[   21.073441]  suspend_devices_and_enter+0x4a8/0x58c
[   21.073450]  pm_suspend+0x180/0x20c
[   21.073456]  state_store+0x80/0xec
[   21.073462]  kobj_attr_store+0x18/0x2c
[   21.073469]  sysfs_kf_write+0x7c/0x94
[   21.073476]  kernfs_fop_write_iter+0x120/0x1ec
[   21.073481]  vfs_write+0x238/0x370
[   21.073489]  ksys_write+0x6c/0x100
[   21.073496]  __arm64_sys_write+0x1c/0x28
[   21.073502]  invoke_syscall+0x48/0x110
[   21.073510]  el0_svc_common.constprop.0+0xc0/0xe0
[   21.073517]  do_el0_svc+0x1c/0x28
[   21.073523]  el0_svc+0x34/0xf0
[   21.073531]  el0t_64_sync_handler+0xa0/0xe4
[   21.073537]  el0t_64_sync+0x198/0x19c
[   21.073543] ########kszphy_generic_resume 2328
[   21.076110] ########kszphy_resume 2413
[   22.393352] OOM killer enabled.
[   22.400389] Restarting tasks: Starting

[   22.405808] Restarting tasks: Done
[   22.409360] random: crng reseeded on system resumption
[   22.414809] PM: suspend exit
root@smarc-rzg3e:~# [   23.786523] renesas-gbeth 15c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   24.929734] 8021q: 802.1Q VLAN Support v1.8
[   24.934021] 8021q: adding VLAN 0 to HW filter on device eth0


Cheers,
Biju


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

* Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-06  8:45     ` Biju Das
  2025-07-06  9:55       ` Biju Das
@ 2025-07-06 10:06       ` Russell King (Oracle)
  2025-07-06 10:17         ` Biju Das
  1 sibling, 1 reply; 12+ messages in thread
From: Russell King (Oracle) @ 2025-07-06 10:06 UTC (permalink / raw)
  To: Biju Das
  Cc: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au

On Sun, Jul 06, 2025 at 08:45:14AM +0000, Biju Das wrote:
> Hi Russell King,
> 
> FYI, The above testing is done with rootFS mounted on SD card.
> 
> But when I mount rootFS on NFS, after wakeup, I am not able to contact the NFS server.
> 
> The below patch makes it to work[1].
> Not sure, why the original code is failing if the rootFS is mounted on NFS?

It would be good to understand exactly what is going on there.

As stmmac sets mac_managed_pm to true, which is propagated to phylib,
this means the mdiobus suspend/resume will be no-ops, as the MAC driver
needs to do everything necessar to resume the PHY.

Is your PHY losing power over suspend/resume?

Maybe phylink_prepare_resume() needs to call phy_init_hw() as well,
like mdio_bus_phy_resume() does?

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

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

* Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-06  9:55       ` Biju Das
@ 2025-07-06 10:10         ` Russell King (Oracle)
  2025-07-06 14:06           ` Biju Das
  0 siblings, 1 reply; 12+ messages in thread
From: Russell King (Oracle) @ 2025-07-06 10:10 UTC (permalink / raw)
  To: Biju Das
  Cc: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au

On Sun, Jul 06, 2025 at 09:55:28AM +0000, Biju Das wrote:
> Just adding some logs:
> Currently PHY resume is called twice
> [   35.754933]  kszphy_resume+0x3c/0xf0
> [   35.754940]  phy_resume+0x3c/0x74
> [   35.754949]  phylink_prepare_resume+0x58/0xa0
> [   35.754957]  stmmac_resume+0x90/0x2a0
> [   35.771296]  stmmac_pltfr_resume+0x3c/0x4c
> 
> and
> 
> [   35.771258]  kszphy_resume+0x3c/0xf0
> [   35.771263]  __phy_resume+0x28/0x54
> [   35.771270]  phy_start+0x7c/0xb4
> [   35.771275]  phylink_start+0xb8/0x210
> [   35.771282]  phylink_resume+0x7c/0xc4
> [   35.771288]  stmmac_resume+0x1ec/0x2a0
> [   35.771296]  stmmac_pltfr_resume+0x3c/0x4c

This shouldn't be a problem. Phylib will do this, and PHY drivers are
expected to cope.

For example, on non-MAC managed PM PHYs, mdio_bus_phy_resume() will
call phy_init_hw() followed by phy_resume(). If a MAC subsequently is
brought up, phy_start() will be called, which will also call
__phy_resume().

If this is upsetting the KSZ PHY, then the KSZ PHY driver needs fixing.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

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

* RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-06 10:06       ` Russell King (Oracle)
@ 2025-07-06 10:17         ` Biju Das
  0 siblings, 0 replies; 12+ messages in thread
From: Biju Das @ 2025-07-06 10:17 UTC (permalink / raw)
  To: Russell King
  Cc: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au

Hi Russell King,

> -----Original Message-----
> From: Russell King <linux@armlinux.org.uk>
> Sent: 06 July 2025 11:06
> Subject: Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
> 
> On Sun, Jul 06, 2025 at 08:45:14AM +0000, Biju Das wrote:
> > Hi Russell King,
> >
> > FYI, The above testing is done with rootFS mounted on SD card.
> >
> > But when I mount rootFS on NFS, after wakeup, I am not able to contact the NFS server.
> >
> > The below patch makes it to work[1].
> > Not sure, why the original code is failing if the rootFS is mounted on NFS?
> 
> It would be good to understand exactly what is going on there.
> 
> As stmmac sets mac_managed_pm to true, which is propagated to phylib, this means the mdiobus
> suspend/resume will be no-ops, as the MAC driver needs to do everything necessar to resume the PHY.
> 
> Is your PHY losing power over suspend/resume?

Yes, it is losing power during suspend.

> 
> Maybe phylink_prepare_resume() needs to call phy_init_hw() as well, like mdio_bus_phy_resume() does?

The below patch fixes the issue.

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 67218d278ce6..511d87481631 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -2593,8 +2593,10 @@ void phylink_prepare_resume(struct phylink *pl)
         * then resume the PHY. Note that 802.3 allows PHYs 500ms before
         * the clock meets requirements. We do not implement this delay.
         */
-       if (pl->config->mac_requires_rxc && phydev && phydev->suspended)
+       if (pl->config->mac_requires_rxc && phydev && phydev->suspended) {
+               phy_init_hw(phydev);
                phy_resume(phydev);
+       }


root@smarc-rzg3e:~# [   21.382260] PM: suspend entry (deep)
[   21.386144] Filesystems sync: 0.000 seconds
[   21.394055] Freezing user space processes
[   21.399743] Freezing user space processes completed (elapsed 0.001 seconds)
[   21.406775] OOM killer disabled.
[   21.410020] Freezing remaining freezable tasks
[   21.415642] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[   21.423051] printk: Suspending console(s) (use no_console_suspend to debug)
NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
NOTICE:  BL2: SYS_LSI_PRR: 0x0
NOTICE:  BL2: Booting BL31
[   21.469365] libphy: #######phy_suspend 1908
[   21.469401] ########kszphy_suspend 2350
[   21.469457] renesas-gbeth 15c30000.ethernet eth0: Link is Down
[   21.470144] ########kszphy_suspend 2356
[   21.470503] ########kszphy_generic_suspend 2343
[   21.470535] libphy: #######phy_suspend 1925
[   21.478742] Disabling non-boot CPUs ...
[   21.483025] psci: CPU3 killed (polled 0 ms)
[   21.490772] psci: CPU2 killed (polled 0 ms)
[   21.497394] psci: CPU1 killed (polled 4 ms)
[   21.500532] Enabling non-boot CPUs ...
[   21.500742] Detected VIPT I-cache on CPU1
[   21.500786] GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
[   21.500823] CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
[   21.501549] CPU1 is up
[   21.501644] Detected VIPT I-cache on CPU2
[   21.501665] GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
[   21.501686] CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
[   21.502106] CPU2 is up
[   21.502200] Detected VIPT I-cache on CPU3
[   21.502221] GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
[   21.502242] CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
[   21.502755] CPU3 is up
[   21.565815] ########kszphy_resume 2389
[   21.565828] CPU: 3 UID: 0 PID: 283 Comm: systemd-sleep Not tainted 6.16.0-rc4-next-20250703-gf2ebaf5365aa-dirty #65 PREEMPT
[   21.565837] Hardware name: Renesas SMARC EVK version 2 based on r9a09g047e57 (DT)
[   21.565841] Call trace:
[   21.565844]  show_stack+0x18/0x24 (C)
[   21.565859]  dump_stack_lvl+0x78/0x90
[   21.565870]  dump_stack+0x18/0x24
[   21.565876]  kszphy_resume+0x3c/0xf0
[   21.565884]  phy_resume+0x3c/0x74
[   21.565892]  phylink_prepare_resume+0x60/0xa8
[   21.565901]  stmmac_resume+0x90/0x2a0
[   21.565910]  stmmac_pltfr_resume+0x3c/0x4c
[   21.565918]  device_resume+0x108/0x1ec
[   21.565927]  dpm_resume+0x198/0x1b8
[   21.565933]  dpm_resume_end+0x20/0x38
[   21.565940]  suspend_devices_and_enter+0x4a8/0x58c
[   21.565948]  pm_suspend+0x180/0x20c
[   21.565954]  state_store+0x80/0xec
[   21.565960]  kobj_attr_store+0x18/0x2c
[   21.565967]  sysfs_kf_write+0x7c/0x94
[   21.565974]  kernfs_fop_write_iter+0x120/0x1ec
[   21.565980]  vfs_write+0x238/0x370
[   21.565988]  ksys_write+0x6c/0x100
[   21.565994]  __arm64_sys_write+0x1c/0x28
[   21.566001]  invoke_syscall+0x48/0x110
[   21.566009]  el0_svc_common.constprop.0+0xc0/0xe0
[   21.566016]  do_el0_svc+0x1c/0x28
[   21.566023]  el0_svc+0x34/0xf0
[   21.566031]  el0t_64_sync_handler+0xa0/0xe4
[   21.566037]  el0t_64_sync+0x198/0x19c
[   21.566044] ########kszphy_generic_resume 2328
[   21.568610] ########kszphy_resume 2413
[   21.579522] dwmac4: Master AXI performs fixed burst length
[   21.580438] renesas-gbeth 15c30000.ethernet eth0: No Safety Features support found
[   21.580457] renesas-gbeth 15c30000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   21.584111] renesas-gbeth 15c30000.ethernet eth0: configuring for phy/rgmii-id link mode
[   21.584126] ########kszphy_resume 2389
[   21.584131] CPU: 3 UID: 0 PID: 283 Comm: systemd-sleep Not tainted 6.16.0-rc4-next-20250703-gf2ebaf5365aa-dirty #65 PREEMPT
[   21.584138] Hardware name: Renesas SMARC EVK version 2 based on r9a09g047e57 (DT)
[   21.584141] Call trace:
[   21.584143]  show_stack+0x18/0x24 (C)
[   21.584150]  dump_stack_lvl+0x78/0x90
[   21.584158]  dump_stack+0x18/0x24
[   21.584163]  kszphy_resume+0x3c/0xf0
[   21.584168]  __phy_resume+0x28/0x54
[   21.584175]  phy_start+0x7c/0xb4
[   21.584180]  phylink_start+0xb8/0x210
[   21.584187]  phylink_resume+0x7c/0xc4
[   21.584194]  stmmac_resume+0x1ec/0x2a0
[   21.584200]  stmmac_pltfr_resume+0x3c/0x4c
[   21.584207]  device_resume+0x108/0x1ec
[   21.584214]  dpm_resume+0x198/0x1b8
[   21.584220]  dpm_resume_end+0x20/0x38
[   21.584226]  suspend_devices_and_enter+0x4a8/0x58c
[   21.584233]  pm_suspend+0x180/0x20c
[   21.584239]  state_store+0x80/0xec
[   21.584245]  kobj_attr_store+0x18/0x2c
[   21.584250]  sysfs_kf_write+0x7c/0x94
[   21.584256]  kernfs_fop_write_iter+0x120/0x1ec
[   21.584261]  vfs_write+0x238/0x370
[   21.584267]  ksys_write+0x6c/0x100
[   21.584273]  __arm64_sys_write+0x1c/0x28
[   21.584279]  invoke_syscall+0x48/0x110
[   21.584286]  el0_svc_common.constprop.0+0xc0/0xe0
[   21.584293]  do_el0_svc+0x1c/0x28
[   21.584299]  el0_svc+0x34/0xf0
[   21.584306]  el0t_64_sync_handler+0xa0/0xe4
[   21.584312]  el0t_64_sync+0x198/0x19c
[   21.584318] ########kszphy_generic_resume 2328
[   21.586896] ########kszphy_resume 2413
[   23.029414] OOM killer enabled.
[   23.036456] Restarting tasks: Starting

[   23.041654] Restarting tasks: Done
[   23.045259] random: crng reseeded on system resumption
[   23.050644] PM: suspend exit
root@smarc-rzg3e:~# p[   24.223019] renesas-gbeth 15c30000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
ing 1[   25.410201] 8021q: 802.1Q VLAN Support v1.8
[   25.414618] 8021q: adding VLAN 0 to HW filter on device eth0
root@smarc-rzg3e:~# ping 192.168.10.1
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=0.516 ms
64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.838 ms
64 bytes from 192.168.10.1: icmp_seq=3 ttl=64 time=1.03 ms
64 bytes from 192.168.10.1: icmp_seq=4 ttl=64 time=0.985 ms

Cheers,
Biju

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

* RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-06 10:10         ` Russell King (Oracle)
@ 2025-07-06 14:06           ` Biju Das
  0 siblings, 0 replies; 12+ messages in thread
From: Biju Das @ 2025-07-06 14:06 UTC (permalink / raw)
  To: Russell King
  Cc: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au



> -----Original Message-----
> From: Russell King <linux@armlinux.org.uk>
> Sent: 06 July 2025 11:11
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; Andrew Lunn
> <andrew+netdev@lunn.ch>; David S. Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>;
> Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; Alexandre Torgue <alexandre.torgue@foss.st.com>; netdev@vger.kernel.org;
> linux-renesas-soc@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>; biju.das.au <biju.das.au@gmail.com>
> Subject: Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
> 
> On Sun, Jul 06, 2025 at 09:55:28AM +0000, Biju Das wrote:
> > Just adding some logs:
> > Currently PHY resume is called twice
> > [   35.754933]  kszphy_resume+0x3c/0xf0
> > [   35.754940]  phy_resume+0x3c/0x74
> > [   35.754949]  phylink_prepare_resume+0x58/0xa0
> > [   35.754957]  stmmac_resume+0x90/0x2a0
> > [   35.771296]  stmmac_pltfr_resume+0x3c/0x4c
> >
> > and
> >
> > [   35.771258]  kszphy_resume+0x3c/0xf0
> > [   35.771263]  __phy_resume+0x28/0x54
> > [   35.771270]  phy_start+0x7c/0xb4
> > [   35.771275]  phylink_start+0xb8/0x210
> > [   35.771282]  phylink_resume+0x7c/0xc4
> > [   35.771288]  stmmac_resume+0x1ec/0x2a0
> > [   35.771296]  stmmac_pltfr_resume+0x3c/0x4c
> 
> This shouldn't be a problem. Phylib will do this, and PHY drivers are expected to cope.
> 
> For example, on non-MAC managed PM PHYs, mdio_bus_phy_resume() will call phy_init_hw() followed by
> phy_resume(). If a MAC subsequently is brought up, phy_start() will be called, which will also call
> __phy_resume().
> 
> If this is upsetting the KSZ PHY, then the KSZ PHY driver needs fixing.

By reconfiguring rgmii_delay during resume also fixes the issue.
Not sure, PHY device is expected to configure the delay during every resume?


	if (phy_interface_is_rgmii(phydev)) {
		ret = ksz9131_config_rgmii_delay(phydev);
		if (ret < 0)
			return ret;
	}

Cheers,
Biju

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

* RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-05 17:03 [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks Biju Das
  2025-07-05 19:31 ` Russell King (Oracle)
@ 2025-07-16 18:19 ` Biju Das
  2025-07-16 19:36   ` Biju Das
  2025-07-16 19:26 ` Lad, Prabhakar
  2 siblings, 1 reply; 12+ messages in thread
From: Biju Das @ 2025-07-16 18:19 UTC (permalink / raw)
  To: Biju Das, Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
	Alexandre Torgue
  Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au

Hi all,

> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: 05 July 2025 18:03
> Subject: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
> 
> Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.
> 
> The PM deep entry is executed by pressing the SLEEP button and exit from entry is by pressing the
> power button.
> 
> Logs:
> root@smarc-rzg3e:~# PM: suspend entry (deep) Filesystems sync: 0.115 seconds Freezing user space
> processes Freezing user space processes completed (elapsed 0.002 seconds) OOM killer disabled.
> Freezing remaining freezable tasks
> Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> printk: Suspending console(s) (use no_console_suspend to debug)
> NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> NOTICE:  BL2: SYS_LSI_PRR: 0x0
> NOTICE:  BL2: Booting BL31
> renesas-gbeth 15c30000.ethernet end0: Link is Down Disabling non-boot CPUs ...
> psci: CPU3 killed (polled 0 ms)
> psci: CPU2 killed (polled 0 ms)
> psci: CPU1 killed (polled 0 ms)
> Enabling non-boot CPUs ...
> Detected VIPT I-cache on CPU1
> GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> CPU1 is up
> Detected VIPT I-cache on CPU2
> GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> CPU2 is up
> Detected VIPT I-cache on CPU3
> GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> CPU3 is up
> dwmac4: Master AXI performs fixed burst length 15c30000.ethernet end0: No Safety Features support
> found 15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported 15c30000.ethernet end0:
> configuring for phy/rgmii-id link mode
> dwmac4: Master AXI performs fixed burst length 15c40000.ethernet end1: No Safety Features support
> found 15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported 15c40000.ethernet end1:
> configuring for phy/rgmii-id link mode OOM killer enabled.
> Restarting tasks: Starting
> Restarting tasks: Done
> random: crng reseeded on system resumption
> PM: suspend exit
> 
> 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx root@smarc-rzg3e:~# ifconfig end0
> 192.168.10.7 up root@smarc-rzg3e:~# ping 192.168.10.1 PING 192.168.10.1 (192.168.10.1) 56(84) bytes of
> data.
> 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
> 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> This patch is tested with out-of tree patch for save/restore ethernet OEN registers in the pinctrl
> block.
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> index 9a774046455b..df4ca897a60c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> @@ -136,6 +136,7 @@ static struct platform_driver renesas_gbeth_driver = {
>  	.probe  = renesas_gbeth_probe,
>  	.driver = {
>  		.name		= "renesas-gbeth",
> +		.pm		= &stmmac_pltfr_pm_ops,
>  		.of_match_table	= renesas_gbeth_match,
>  	},
>  };


Gentle ping.

Cheers,
Biju

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

* Re: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-05 17:03 [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks Biju Das
  2025-07-05 19:31 ` Russell King (Oracle)
  2025-07-16 18:19 ` Biju Das
@ 2025-07-16 19:26 ` Lad, Prabhakar
  2 siblings, 0 replies; 12+ messages in thread
From: Lad, Prabhakar @ 2025-07-16 19:26 UTC (permalink / raw)
  To: Biju Das
  Cc: Lad Prabhakar, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
	netdev, linux-renesas-soc, linux-stm32, linux-arm-kernel,
	linux-kernel, Geert Uytterhoeven, Biju Das

On Sat, Jul 5, 2025 at 6:03 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.
>
> The PM deep entry is executed by pressing the SLEEP button and exit from
> entry is by pressing the power button.
>
> Logs:
> root@smarc-rzg3e:~# PM: suspend entry (deep)
> Filesystems sync: 0.115 seconds
> Freezing user space processes
> Freezing user space processes completed (elapsed 0.002 seconds)
> OOM killer disabled.
> Freezing remaining freezable tasks
> Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> printk: Suspending console(s) (use no_console_suspend to debug)
> NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> NOTICE:  BL2: SYS_LSI_PRR: 0x0
> NOTICE:  BL2: Booting BL31
> renesas-gbeth 15c30000.ethernet end0: Link is Down
> Disabling non-boot CPUs ...
> psci: CPU3 killed (polled 0 ms)
> psci: CPU2 killed (polled 0 ms)
> psci: CPU1 killed (polled 0 ms)
> Enabling non-boot CPUs ...
> Detected VIPT I-cache on CPU1
> GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> CPU1 is up
> Detected VIPT I-cache on CPU2
> GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> CPU2 is up
> Detected VIPT I-cache on CPU3
> GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> CPU3 is up
> dwmac4: Master AXI performs fixed burst length
> 15c30000.ethernet end0: No Safety Features support found
> 15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
> 15c30000.ethernet end0: configuring for phy/rgmii-id link mode
> dwmac4: Master AXI performs fixed burst length
> 15c40000.ethernet end1: No Safety Features support found
> 15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
> 15c40000.ethernet end1: configuring for phy/rgmii-id link mode
> OOM killer enabled.
> Restarting tasks: Starting
> Restarting tasks: Done
> random: crng reseeded on system resumption
> PM: suspend exit
>
> 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
> root@smarc-rzg3e:~# ifconfig end0 192.168.10.7 up
> root@smarc-rzg3e:~# ping 192.168.10.1
> PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
> 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
> 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> This patch is tested with out-of tree patch for save/restore
> ethernet OEN registers in the pinctrl block.
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c | 1 +
>  1 file changed, 1 insertion(+)
>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> index 9a774046455b..df4ca897a60c 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> @@ -136,6 +136,7 @@ static struct platform_driver renesas_gbeth_driver = {
>         .probe  = renesas_gbeth_probe,
>         .driver = {
>                 .name           = "renesas-gbeth",
> +               .pm             = &stmmac_pltfr_pm_ops,
>                 .of_match_table = renesas_gbeth_match,
>         },
>  };
> --
> 2.43.0
>
>

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

* RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
  2025-07-16 18:19 ` Biju Das
@ 2025-07-16 19:36   ` Biju Das
  0 siblings, 0 replies; 12+ messages in thread
From: Biju Das @ 2025-07-16 19:36 UTC (permalink / raw)
  To: Prabhakar Mahadev Lad, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Maxime Coquelin, Alexandre Torgue
  Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Geert Uytterhoeven, biju.das.au



> -----Original Message-----
> From: Biju Das <biju.das.jz@bp.renesas.com>
> Sent: 16 July 2025 19:20
> Subject: RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks
> 
> Hi all,
> 
> > -----Original Message-----
> > From: Biju Das <biju.das.jz@bp.renesas.com>
> > Sent: 05 July 2025 18:03
> > Subject: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM
> > suspend/resume callbacks
> >
> > Add PM suspend/resume callbacks for RZ/G3E SMARC EVK.
> >
> > The PM deep entry is executed by pressing the SLEEP button and exit
> > from entry is by pressing the power button.
> >
> > Logs:
> > root@smarc-rzg3e:~# PM: suspend entry (deep) Filesystems sync: 0.115
> > seconds Freezing user space processes Freezing user space processes completed (elapsed 0.002
> seconds) OOM killer disabled.
> > Freezing remaining freezable tasks
> > Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> > printk: Suspending console(s) (use no_console_suspend to debug)
> > NOTICE:  BL2: v2.10.5(release):2.10.5/rz_soc_dev-162-g7148ba838
> > NOTICE:  BL2: Built : 14:23:58, Jul  5 2025
> > NOTICE:  BL2: SYS_LSI_MODE: 0x13e06
> > NOTICE:  BL2: SYS_LSI_DEVID: 0x8679447
> > NOTICE:  BL2: SYS_LSI_PRR: 0x0
> > NOTICE:  BL2: Booting BL31
> > renesas-gbeth 15c30000.ethernet end0: Link is Down Disabling non-boot CPUs ...
> > psci: CPU3 killed (polled 0 ms)
> > psci: CPU2 killed (polled 0 ms)
> > psci: CPU1 killed (polled 0 ms)
> > Enabling non-boot CPUs ...
> > Detected VIPT I-cache on CPU1
> > GICv3: CPU1: found redistributor 100 region 0:0x0000000014960000
> > CPU1: Booted secondary processor 0x0000000100 [0x412fd050]
> > CPU1 is up
> > Detected VIPT I-cache on CPU2
> > GICv3: CPU2: found redistributor 200 region 0:0x0000000014980000
> > CPU2: Booted secondary processor 0x0000000200 [0x412fd050]
> > CPU2 is up
> > Detected VIPT I-cache on CPU3
> > GICv3: CPU3: found redistributor 300 region 0:0x00000000149a0000
> > CPU3: Booted secondary processor 0x0000000300 [0x412fd050]
> > CPU3 is up
> > dwmac4: Master AXI performs fixed burst length 15c30000.ethernet end0:
> > No Safety Features support found 15c30000.ethernet end0: IEEE 1588-2008 Advanced Timestamp supported
> 15c30000.ethernet end0:
> > configuring for phy/rgmii-id link mode
> > dwmac4: Master AXI performs fixed burst length 15c40000.ethernet end1:
> > No Safety Features support found 15c40000.ethernet end1: IEEE 1588-2008 Advanced Timestamp supported
> 15c40000.ethernet end1:
> > configuring for phy/rgmii-id link mode OOM killer enabled.
> > Restarting tasks: Starting
> > Restarting tasks: Done
> > random: crng reseeded on system resumption
> > PM: suspend exit
> >
> > 15c30000.ethernet end0: Link is Up - 1Gbps/Full - flow control rx/tx
> > root@smarc-rzg3e:~# ifconfig end0
> > 192.168.10.7 up root@smarc-rzg3e:~# ping 192.168.10.1 PING
> > 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
> > 64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=2.05 ms
> > 64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=0.928 ms
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > This patch is tested with out-of tree patch for save/restore ethernet
> > OEN registers in the pinctrl block.
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> > b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> > index 9a774046455b..df4ca897a60c 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-renesas-gbeth.c
> > @@ -136,6 +136,7 @@ static struct platform_driver renesas_gbeth_driver = {
> >  	.probe  = renesas_gbeth_probe,
> >  	.driver = {
> >  		.name		= "renesas-gbeth",
> > +		.pm		= &stmmac_pltfr_pm_ops,
> >  		.of_match_table	= renesas_gbeth_match,
> >  	},
> >  };
> 
> 
> Gentle ping.

On the patchwork[1], I see this patch is marked as change requested.

The change is in PHY driver[2].

I will send V2 with collected logs.

[1] https://patchwork.kernel.org/project/netdevbpf/patch/20250705170326.106073-1-biju.das.jz@bp.renesas.com/

[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20250716&id=f25a7eaa897f21396e99f90809af82ca553c9d14

Cheers,
Biju

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

end of thread, other threads:[~2025-07-16 19:36 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-05 17:03 [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM suspend/resume callbacks Biju Das
2025-07-05 19:31 ` Russell King (Oracle)
2025-07-05 20:26   ` Biju Das
2025-07-06  8:45     ` Biju Das
2025-07-06  9:55       ` Biju Das
2025-07-06 10:10         ` Russell King (Oracle)
2025-07-06 14:06           ` Biju Das
2025-07-06 10:06       ` Russell King (Oracle)
2025-07-06 10:17         ` Biju Das
2025-07-16 18:19 ` Biju Das
2025-07-16 19:36   ` Biju Das
2025-07-16 19:26 ` Lad, Prabhakar

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