All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Claudiu.Beznea@microchip.com
Cc: hkallweit1@gmail.com, andrew@lunn.ch, davem@davemloft.net,
	kuba@kernel.org, rjw@rjwysocki.net, pavel@ucw.cz,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH] net: phy: micrel: reconfigure the phy on resume
Date: Thu, 14 Jan 2021 10:25:08 +0000	[thread overview]
Message-ID: <20210114102508.GO1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <d9fcf8da-c0b0-0f18-48e9-a7534948bc93@microchip.com>

On Thu, Jan 14, 2021 at 10:12:13AM +0000, Claudiu.Beznea@microchip.com wrote:
> Up to this moment we treat this backup mode as S2R mode since the memory
> was kept in self-refresh mode. Each driver was saving/restoring in/from RAM
> the content of associated registers in the suspend/resume phase.

This is exactly what suspend-to-RAM is. The system is largely powered
down with the state saved in RAM, and the RAM placed in self-refresh
mode. Some devices or parts of devices may remain powered up if needed
to be a wake-up source.

> The questions that arries this topic (Heiner, Russel, anyone involved in
> the discussion, correct me if I wrongly understood):
> 1/ is it OK to still treat this backup mode as a S2R mode or as a hibernate
> mode? Since hibernate would treat the devices (including Ethernet PHY in
> this case) as they were just powered and restore the registers content but
> taking into account that in backup mode we keep the RAM in self-refresh?

Hibernate mode is a deeper power-saving mode, where all that applies
with suspend-to-ram applies, plus the critical contents of the RAM is
stored to non-volatile media, and the RAM powered down in addition to
what would also be powered down in the suspend-to-ram case.

If you are placing the RAM in self-refresh and powering the system down,
you are in suspend-to-ram mode, not hibernate mode.

> 2/ is it OK to have these kind of reconfiguration of one device that end up
> in suspend mode with no power (in this case the Ethernet PHY) due to a
> system power cut off (in this case CPU + PMIC)?

You have nothing out of the ordinary here.  Going back years, the
Assabet/Neponest (SA1110 based platform) does this. When the CPU
enters suspend mode, a pin on the processor indicates to the external
world that has happened, and that cuts power to most of the system
including the smc91x and integrated PHY. (it doesn't use phylib.)

So there's really nothing special about your situation; from what you
have described, it's a pretty standard suspend-to-ram implementation.

As I've said, if phylib/PHY driver is not restoring the state of the
PHY on resume from suspend-to-ram, then that's an issue with phylib
and/or the phy driver.

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

  reply	other threads:[~2021-01-14 10:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 15:45 [PATCH] net: phy: micrel: reconfigure the phy on resume Claudiu Beznea
2021-01-08 16:10 ` Andrew Lunn
2021-01-08 16:31 ` Heiner Kallweit
2021-01-13  9:29   ` Claudiu.Beznea
2021-01-13 11:09     ` Heiner Kallweit
2021-01-13 12:36       ` Claudiu.Beznea
2021-01-13 21:34         ` Heiner Kallweit
2021-01-13 22:01           ` Russell King - ARM Linux admin
2021-01-14  7:30             ` Heiner Kallweit
2021-01-14 10:12           ` Claudiu.Beznea
2021-01-14 10:25             ` Russell King - ARM Linux admin [this message]
2021-01-14 10:41               ` Claudiu.Beznea
2021-01-14 11:05                 ` Heiner Kallweit
2021-02-11 11:18                   ` Claudiu.Beznea
2021-02-11 12:17                   ` Pavel Machek
2021-02-11 12:36                     ` Heiner Kallweit
2021-02-11 20:34                       ` Pavel Machek
2021-01-13 23:28 ` Jakub Kicinski

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=20210114102508.GO1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    /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.