All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v2 0/2] net: phy: improve PHY suspend/resume
Date: Sat, 2 Jun 2018 22:27:50 +0200	[thread overview]
Message-ID: <28a8846a-f7a7-3266-3aec-7f58fe8dac72@gmail.com> (raw)
In-Reply-To: <20180601001043.GA2303@lunn.ch>

On 01.06.2018 02:10, Andrew Lunn wrote:
>> Configuring the different WoL options isn't handled by writing to
>> the PHY registers but by writing to chip / MAC registers.
>> Therefore phy_suspend() isn't able to figure out whether WoL is
>> enabled or not. Only the parent has the full picture.
> 
> Hi Heiner
> 
> I think you need to look at your different runtime PM domains.  If i
> understand the code right, you runtime suspend if there is no
> link. But for this to work correctly, your PHY needs to keep working.
> You also cannot assume all accesses to the PHY go via the MAC. Some
> calls will go direct to the PHY, and they can trigger MDIO bus
> accesses.  So i think you need two runtime PM domains. MAC and MDIO
> bus.  Maybe just the pll? An MDIO bus is a device, so it can have its
> on PM callbacks. It is not clear what you need to resume in order to
> make MDIO work.
> 
Thanks for your comments!
The actual problem is quite small: I get an error at MDIO suspend,
the PHY however is suspended later by the driver's suspend callback
anyway. Because the problem is small I'm somewhat reluctant to
consider bigger changes like introducing different PM domains.

Primary reason for the error is that the network chip is in PCI D3hot
at that moment. In addition to that for some of the chips supported by
the driver also MDIO-relevant PLL's might be disabled.

By the way:
When checking PM handling for PHY/MDIO I stumbled across something
that can be improved IMO, I'll send a patch for your review.

> It might also help if you do the phy_connect in .ndo_open and
> disconnect in .ndo_stop. This is a common pattern in drivers. But some
> also do it is probe and remove.
> 
Thanks for the hint. I will move phy_connect_direct accordingly.

>      Andrew
> 
Heiner

  reply	other threads:[~2018-06-02 20:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 20:15 [PATCH net-next v2 0/2] net: phy: improve PHY suspend/resume Heiner Kallweit
2018-05-23 20:16 ` [PATCH net-next v2 1/2] net: phy: improve check for when to call phy_resume in mdio_bus_phy_resume Heiner Kallweit
2018-05-23 20:17 ` [PATCH net-next v2 2/2] net: phy: improve checks when to suspend the PHY Heiner Kallweit
2018-05-23 22:04 ` [PATCH net-next v2 0/2] net: phy: improve PHY suspend/resume Andrew Lunn
2018-05-24  5:52   ` Heiner Kallweit
2018-05-30 20:22   ` Heiner Kallweit
2018-05-30 20:35     ` Andrew Lunn
2018-05-31 15:58       ` Heiner Kallweit
2018-05-31 18:30         ` Andrew Lunn
2018-05-31 20:28           ` Heiner Kallweit
2018-06-01  0:10             ` Andrew Lunn
2018-06-02 20:27               ` Heiner Kallweit [this message]
2018-06-05 19:39                 ` Heiner Kallweit
2018-06-08  6:09                   ` Heiner Kallweit

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=28a8846a-f7a7-3266-3aec-7f58fe8dac72@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.