netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Jakub Kicinski <kuba@kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	linux-phy@lists.infradead.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	nicolas.ferre@microchip.com, claudiu.beznea@microchip.com,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	robert.hancock@calian.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, git@amd.com
Subject: Re: [PATCH net] net: macb: In ZynqMP resume always configure PS GTR for non-wakeup source
Date: Thu, 10 Aug 2023 00:04:01 +0100	[thread overview]
Message-ID: <ZNQbYQ3zuGI3MbK0@shell.armlinux.org.uk> (raw)
In-Reply-To: <20230809154121.673ec04b@kernel.org>

On Wed, Aug 09, 2023 at 03:41:21PM -0700, Jakub Kicinski wrote:
> On Mon, 7 Aug 2023 18:44:51 +0530 Radhey Shyam Pandey wrote:
> > 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: f22bd29ba19a ("net: macb: Fix ZynqMP SGMII non-wakeup source resume failure")
> > Fixes: 8b73fa3ae02b ("net: macb: Added ZynqMP-specific initialization")
> > Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> 
> Could be more of a PHY than MAC question. Adding remaining PHY
> maintainers to CC.

This is not ethernet PHY stuff (drivers/net/phy), it's serdes PHY
(drivers/phy). Their requirements vary a lot.

Given the above description...

In (1), phy_power_off() gets called. If this is actually done by
the serdes PHY driver, then the clocks from the serdes PHY stop.

Whether the PHY is re-initialised or not during the suspend/resume
should not affect it - we haven't asked for it to be powered up
again.

So in (5), I assume that the problem occurs because macb_init_hw()
is called before phy_power_on()... but what do I know... with these
randomly generated abbreviations that are designed to exclude people
from understanding what is going on which seem to be common in the
computing world. FPD? GT? Shrug, utterly meaningless.

However, surely phy_init() while the PHY is supposed to be powered
off should fail? Don't know, this is outside of my area of knowledge.
Adding generic phy maintainers and list...

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

  reply	other threads:[~2023-08-09 23:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-07 13:14 [PATCH net] net: macb: In ZynqMP resume always configure PS GTR for non-wakeup source Radhey Shyam Pandey
2023-08-09 22:41 ` Jakub Kicinski
2023-08-09 23:04   ` Russell King (Oracle) [this message]
2023-08-15  2:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZNQbYQ3zuGI3MbK0@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=git@amd.com \
    --cc=hkallweit1@gmail.com \
    --cc=kishon@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=pabeni@redhat.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=robert.hancock@calian.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).