Skip to content

Commit 6c461e3

Browse files
Radhey Shyam Pandeykuba-moo
authored andcommitted
net: macb: In ZynqMP resume always configure PS GTR for non-wakeup source
On Zynq UltraScale+ MPSoC ubuntu platform when systemctl issues suspend, network manager bring down the interface and goes into suspend. When it wakes up it again enables the interface. This leads to xilinx-psgtr "PLL lock timeout" on interface bringup, as the power management controller power down the entire FPD (including SERDES) if none of the FPD devices are in use and serdes is not initialized on resume. $ sudo rtcwake -m no -s 120 -v $ sudo systemctl suspend <this does ifconfig eth1 down> $ ifconfig eth1 up xilinx-psgtr fd400000.phy: lane 0 (type 10, protocol 5): PLL lock timeout phy phy-fd400000.phy.0: phy poweron failed --> -110 macb driver is called in this way: 1. macb_close: Stop network interface. In this function, it reset MACB IP and disables PHY and network interface. 2. macb_suspend: It is called in kernel suspend flow. But because network interface has been disabled(netif_running(ndev) is false), it does nothing and returns directly; 3. System goes into suspend state. Some time later, system is waken up by RTC wakeup device; 4. macb_resume: It does nothing because network interface has been disabled; 5. macb_open: It is called to enable network interface again. ethernet interface is initialized in this API but serdes which is power-off by PMUFW during FPD-off suspend is not initialized again and so we hit GT PLL lock issue on open. To resolve this PLL timeout issue always do PS GTR initialization when ethernet device is configured as non-wakeup source. Fixes: f22bd29 ("net: macb: Fix ZynqMP SGMII non-wakeup source resume failure") Fixes: 8b73fa3 ("net: macb: Added ZynqMP-specific initialization") Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com> Link: https://lore.kernel.org/r/1691414091-2260697-1-git-send-email-radhey.shyam.pandey@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 855067d commit 6c461e3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5194,6 +5194,9 @@ static int __maybe_unused macb_suspend(struct device *dev)
51945194
unsigned int q;
51955195
int err;
51965196

5197+
if (!device_may_wakeup(&bp->dev->dev))
5198+
phy_exit(bp->sgmii_phy);
5199+
51975200
if (!netif_running(netdev))
51985201
return 0;
51995202

@@ -5254,7 +5257,6 @@ static int __maybe_unused macb_suspend(struct device *dev)
52545257
if (!(bp->wol & MACB_WOL_ENABLED)) {
52555258
rtnl_lock();
52565259
phylink_stop(bp->phylink);
5257-
phy_exit(bp->sgmii_phy);
52585260
rtnl_unlock();
52595261
spin_lock_irqsave(&bp->lock, flags);
52605262
macb_reset_hw(bp);
@@ -5284,6 +5286,9 @@ static int __maybe_unused macb_resume(struct device *dev)
52845286
unsigned int q;
52855287
int err;
52865288

5289+
if (!device_may_wakeup(&bp->dev->dev))
5290+
phy_init(bp->sgmii_phy);
5291+
52875292
if (!netif_running(netdev))
52885293
return 0;
52895294

@@ -5344,8 +5349,6 @@ static int __maybe_unused macb_resume(struct device *dev)
53445349
macb_set_rx_mode(netdev);
53455350
macb_restore_features(bp);
53465351
rtnl_lock();
5347-
if (!device_may_wakeup(&bp->dev->dev))
5348-
phy_init(bp->sgmii_phy);
53495352

53505353
phylink_start(bp->phylink);
53515354
rtnl_unlock();

0 commit comments

Comments
 (0)