[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<TY3PR01MB11346A275022D7B74E8FDDB27864CA@TY3PR01MB11346.jpnprd01.prod.outlook.com>
Date: Sun, 6 Jul 2025 10:17:21 +0000
From: Biju Das <biju.das.jz@...renesas.com>
To: Russell King <linux@...linux.org.uk>
CC: Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@...renesas.com>, Andrew
Lunn <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, Eric
Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>, Alexandre
Torgue <alexandre.torgue@...s.st.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "linux-renesas-soc@...r.kernel.org"
<linux-renesas-soc@...r.kernel.org>,
"linux-stm32@...md-mailman.stormreply.com"
<linux-stm32@...md-mailman.stormreply.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Geert Uytterhoeven <geert+renesas@...der.be>,
biju.das.au <biju.das.au@...il.com>
Subject: RE: [PATCH net-next] net: stmmac: dwmac-renesas-gbeth: Add PM
suspend/resume callbacks
Hi Russell King,
> -----Original Message-----
> From: Russell King <linux@...linux.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@...rc-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@...rc-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@...rc-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
Powered by blists - more mailing lists