All of lore.kernel.org
 help / color / mirror / Atom feed
From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC v1 0/7] net: phy: Ethernet PHY powerdown optimization
Date: Wed, 20 Nov 2013 22:20:50 +0100	[thread overview]
Message-ID: <528D27B2.4000707@gmail.com> (raw)
In-Reply-To: <CAGVrzcZ5wV2eHPNfr-xToOEc6jbBJXiNQ+OtZv2j+yGbS9YW-w@mail.gmail.com>

On 11/20/2013 10:10 PM, Florian Fainelli wrote:
> 2013/11/20 Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>:
>> On 11/20/2013 09:36 PM, David Miller wrote:
>>>
>>> From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>>> Date: Wed, 20 Nov 2013 21:21:46 +0100
>>>
>>>> Ethernet PHYs consume a significant amount of power when link is
>>>> detected.
>>>> Especially, for embedded systems it can be easily 20-40% of total system
>>>> power. Now, currently most likely all ethernet drivers leave PHYs powered
>>>> on, even if the device is taken down. Also, some stupid boot loaders
>>>> power
>>>> on all PHYs available.
>>>>
>>>> This RFC deals with saving power consumed by ethernet PHYs, that have no
>>>> corresponding ethernet device driver or are attached to ethernet devices
>>>> which are taken down by user request, i.e. ifconfig ethN down. Ports with
>>>> no link, i.e. cable removed, are already quite good at power saving due
>>>> to
>>>> PHY internal link detection.
>>>
>>>
>>> The idea is sound and the goal is of course valuable, but it brings up
>>> a chronically reoccurring issue as of late.
>>>
>>> You cannot reset the PHY or take it down without somehow retaining the
>>> settings the PHY had when you bring it back up.
>>
>>
>> Right, as far as I understand BMCR powerdown, i.e. what is called in
>> genphy_suspend/resume, powers down the PHY but _does_ retain PHY config.
>> It is not resetting the device.
>
> Right that's also my understanding of how BMCR powerdown works. That
> said, I am relatively sure that we can find PHY devices for which this
> is not true.

No doubt.

> As for the PHY state machine, I think we need a new state
> PHY_SUSPENDED  and upon calling phy_start() we make sure that we treat
> PHY_SUSPENDED just like we treat PHY_HALTED today since that would
> make sure that the PHY parameters are applied correctly upon resume
> (interrupt configuration, autoneg and and such).
>
> There is still some discussion on how we should deal with
> auto-suspending the PHY when phy_stop() is called, and how does that
> differ from the PHY_HALTED state? So this also raises the question of
> whether PHY_HALTED is really different from PHY_SUSPENDED. The only
> difference with your patches would be that we have put the PHY into a
> low-power mode.

Well, I haven't thought about WoL and stuff and how the driver should
leave the PHY for that to work. Suspend support isn't really spread
among ARM SoCs :P

But if you can run some tests on non-ARM platforms you might already
been testing with, I am sure we can work it out. Maybe, we just have
PHY_SUSPENDED and deal with it differently if any regressions pop up?

Also, suspend_unused and auto-suspend on phy_stop can be disabled by
default for some kernel versions until we have enough coverage?

>> I haven't checked a lot of datasheets but [1] notes that "registers will
>> preserve their configuration". Even if we have PHYs that do not preserve
>> it, they should have a device specific callback for suspend/resume that
>> takes care of preserving it.
>
> Right, but the PHY driver should only take care of restoring "state
> less" PHY context, while the PHY state machine has to restore a "state
> aware" PHY device context. So for quirky PHY chips, or those having
> advanced power management features, we definitively need the two to be
> helping each other.

I see it was a good idea to send the RFC early. The savings are
impressive but I was already quite sure that it has the potential to
break (at least) the quirky PHYs.

Sebastian

>>
>> [1] http://www.ti.com/lit/an/snoa463a/snoa463a.pdf
>>
>>
>>> If I ifdown/ifup a device, my ethtool link configuration better be
>>> retained.
>>>
>>> This means the PHY layer must have a way to reprogram the device when
>>> it is brought back up, with whatever settings the software state
>>> things are there.
>>>
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
>

WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: David Miller <davem@davemloft.net>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH RFC v1 0/7] net: phy: Ethernet PHY powerdown optimization
Date: Wed, 20 Nov 2013 22:20:50 +0100	[thread overview]
Message-ID: <528D27B2.4000707@gmail.com> (raw)
In-Reply-To: <CAGVrzcZ5wV2eHPNfr-xToOEc6jbBJXiNQ+OtZv2j+yGbS9YW-w@mail.gmail.com>

On 11/20/2013 10:10 PM, Florian Fainelli wrote:
> 2013/11/20 Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>:
>> On 11/20/2013 09:36 PM, David Miller wrote:
>>>
>>> From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>>> Date: Wed, 20 Nov 2013 21:21:46 +0100
>>>
>>>> Ethernet PHYs consume a significant amount of power when link is
>>>> detected.
>>>> Especially, for embedded systems it can be easily 20-40% of total system
>>>> power. Now, currently most likely all ethernet drivers leave PHYs powered
>>>> on, even if the device is taken down. Also, some stupid boot loaders
>>>> power
>>>> on all PHYs available.
>>>>
>>>> This RFC deals with saving power consumed by ethernet PHYs, that have no
>>>> corresponding ethernet device driver or are attached to ethernet devices
>>>> which are taken down by user request, i.e. ifconfig ethN down. Ports with
>>>> no link, i.e. cable removed, are already quite good at power saving due
>>>> to
>>>> PHY internal link detection.
>>>
>>>
>>> The idea is sound and the goal is of course valuable, but it brings up
>>> a chronically reoccurring issue as of late.
>>>
>>> You cannot reset the PHY or take it down without somehow retaining the
>>> settings the PHY had when you bring it back up.
>>
>>
>> Right, as far as I understand BMCR powerdown, i.e. what is called in
>> genphy_suspend/resume, powers down the PHY but _does_ retain PHY config.
>> It is not resetting the device.
>
> Right that's also my understanding of how BMCR powerdown works. That
> said, I am relatively sure that we can find PHY devices for which this
> is not true.

No doubt.

> As for the PHY state machine, I think we need a new state
> PHY_SUSPENDED  and upon calling phy_start() we make sure that we treat
> PHY_SUSPENDED just like we treat PHY_HALTED today since that would
> make sure that the PHY parameters are applied correctly upon resume
> (interrupt configuration, autoneg and and such).
>
> There is still some discussion on how we should deal with
> auto-suspending the PHY when phy_stop() is called, and how does that
> differ from the PHY_HALTED state? So this also raises the question of
> whether PHY_HALTED is really different from PHY_SUSPENDED. The only
> difference with your patches would be that we have put the PHY into a
> low-power mode.

Well, I haven't thought about WoL and stuff and how the driver should
leave the PHY for that to work. Suspend support isn't really spread
among ARM SoCs :P

But if you can run some tests on non-ARM platforms you might already
been testing with, I am sure we can work it out. Maybe, we just have
PHY_SUSPENDED and deal with it differently if any regressions pop up?

Also, suspend_unused and auto-suspend on phy_stop can be disabled by
default for some kernel versions until we have enough coverage?

>> I haven't checked a lot of datasheets but [1] notes that "registers will
>> preserve their configuration". Even if we have PHYs that do not preserve
>> it, they should have a device specific callback for suspend/resume that
>> takes care of preserving it.
>
> Right, but the PHY driver should only take care of restoring "state
> less" PHY context, while the PHY state machine has to restore a "state
> aware" PHY device context. So for quirky PHY chips, or those having
> advanced power management features, we definitively need the two to be
> helping each other.

I see it was a good idea to send the RFC early. The savings are
impressive but I was already quite sure that it has the potential to
break (at least) the quirky PHYs.

Sebastian

>>
>> [1] http://www.ti.com/lit/an/snoa463a/snoa463a.pdf
>>
>>
>>> If I ifdown/ifup a device, my ethtool link configuration better be
>>> retained.
>>>
>>> This means the PHY layer must have a way to reprogram the device when
>>> it is brought back up, with whatever settings the software state
>>> things are there.
>>>
>>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
>
>


  reply	other threads:[~2013-11-20 21:20 UTC|newest]

Thread overview: 116+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20 20:21 [PATCH RFC v1 0/7] net: phy: Ethernet PHY powerdown optimization Sebastian Hesselbarth
2013-11-20 20:21 ` Sebastian Hesselbarth
2013-11-20 20:21 ` [PATCH RFC v1 1/7] net: phy: marvell: provide genphy suspend/resume Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:21 ` [PATCH RFC v1 2/7] net: phy: provide phy_resume/phy_suspend helpers Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:36   ` Florian Fainelli
2013-11-20 20:36     ` Florian Fainelli
2013-11-20 20:21 ` [PATCH RFC v1 3/7] net: phy: resume/suspend PHYs on attach/detach Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:21 ` [PATCH RFC v1 4/7] net: phy: suspend unused PHYs on mdio_bus in late_initcall Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:58   ` Florian Fainelli
2013-11-20 20:58     ` Florian Fainelli
2013-11-20 21:05     ` Sebastian Hesselbarth
2013-11-20 21:05       ` Sebastian Hesselbarth
2013-11-20 22:36       ` Florian Fainelli
2013-11-20 22:36         ` Florian Fainelli
2013-11-20 20:21 ` [PATCH RFC v1 5/7] net: mv643xx_eth: resume/suspend PHY on port start/stop Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:21 ` [PATCH RFC v1 6/7] net: mvneta: " Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:21 ` [PATCH RFC v1 7/7] net: cpsw: " Sebastian Hesselbarth
2013-11-20 20:21   ` Sebastian Hesselbarth
2013-11-20 20:48   ` Florian Fainelli
2013-11-20 20:48     ` Florian Fainelli
2013-11-20 20:57     ` Sebastian Hesselbarth
2013-11-20 20:57       ` Sebastian Hesselbarth
2013-11-21  8:35   ` Mugunthan V N
2013-11-21  8:35     ` Mugunthan V N
2013-11-21  8:35     ` Mugunthan V N
2013-11-21  8:41     ` Sebastian Hesselbarth
2013-11-21  8:41       ` Sebastian Hesselbarth
2013-11-20 20:36 ` [PATCH RFC v1 0/7] net: phy: Ethernet PHY powerdown optimization David Miller
2013-11-20 20:36   ` David Miller
2013-11-20 20:54   ` Sebastian Hesselbarth
2013-11-20 20:54     ` Sebastian Hesselbarth
2013-11-20 21:10     ` Florian Fainelli
2013-11-20 21:10       ` Florian Fainelli
2013-11-20 21:20       ` Sebastian Hesselbarth [this message]
2013-11-20 21:20         ` Sebastian Hesselbarth
2013-11-20 22:15     ` David Miller
2013-11-20 22:15       ` David Miller
2013-12-04 15:44 ` [PATCH RFCv2 0/6] " Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-05  7:57   ` Mugunthan V N
2013-12-05  7:57     ` Mugunthan V N
2013-12-06  0:16     ` Florian Fainelli
2013-12-06  0:16       ` Florian Fainelli
2013-12-08 14:40   ` [PATCH v1 " Sebastian Hesselbarth
2013-12-08 14:40     ` Sebastian Hesselbarth
2013-12-08 14:40     ` [PATCH v1 1/6] net: mv643xx_eth: properly start/stop phy device Sebastian Hesselbarth
2013-12-08 14:40       ` Sebastian Hesselbarth
2013-12-11  2:52       ` David Miller
2013-12-11  2:52         ` David Miller
2013-12-11  2:56         ` David Miller
2013-12-11  2:56           ` David Miller
2013-12-11  2:56           ` David Miller
2013-12-11  7:06           ` Sebastian Hesselbarth
2013-12-11  7:06             ` Sebastian Hesselbarth
2013-12-11  7:06             ` Sebastian Hesselbarth
2013-12-11 17:28             ` David Miller
2013-12-11 17:28               ` David Miller
2013-12-11 17:28               ` David Miller
2013-12-08 14:40     ` [PATCH v1 2/6] net: phy: marvell: provide genphy suspend/resume Sebastian Hesselbarth
2013-12-08 14:40       ` Sebastian Hesselbarth
2013-12-08 14:40     ` [PATCH v1 3/6] net: phy: provide phy_resume/phy_suspend helpers Sebastian Hesselbarth
2013-12-08 14:40       ` Sebastian Hesselbarth
2013-12-08 14:40     ` [PATCH v1 4/6] net: phy: resume/suspend PHYs on attach/detach Sebastian Hesselbarth
2013-12-08 14:40       ` Sebastian Hesselbarth
2013-12-08 14:40     ` [PATCH v1 5/6] net: phy: suspend unused PHYs on mdio_bus in late_initcall Sebastian Hesselbarth
2013-12-08 14:40       ` Sebastian Hesselbarth
2013-12-08 14:40     ` [PATCH v1 6/6] net: phy: suspend phydev when going to HALTED Sebastian Hesselbarth
2013-12-08 14:40       ` Sebastian Hesselbarth
2013-12-13  9:20     ` [PATCH v2 0/5] net: phy: Ethernet PHY powerdown optimization Sebastian Hesselbarth
2013-12-13  9:20       ` Sebastian Hesselbarth
2013-12-17 19:43       ` David Miller
2013-12-17 19:43         ` David Miller
2014-02-04 19:38         ` Sebastian Hesselbarth
2014-02-04 19:38           ` Sebastian Hesselbarth
2014-02-04 22:51           ` Florian Fainelli
2014-02-04 22:51             ` Florian Fainelli
2014-02-06 16:57           ` Ezequiel Garcia
2014-02-06 16:57             ` Ezequiel Garcia
2013-12-13  9:20     ` [PATCH v2 1/5] net: mv643xx_eth: properly start/stop phy device Sebastian Hesselbarth
2013-12-13  9:20       ` Sebastian Hesselbarth
2013-12-13  9:20     ` [PATCH v2 2/5] net: phy: marvell: provide genphy suspend/resume Sebastian Hesselbarth
2013-12-13  9:20       ` Sebastian Hesselbarth
2013-12-13  9:20     ` [PATCH v2 3/5] net: phy: provide phy_resume/phy_suspend helpers Sebastian Hesselbarth
2013-12-13  9:20       ` Sebastian Hesselbarth
2013-12-13  9:20     ` [PATCH v2 4/5] net: phy: resume/suspend PHYs on attach/detach Sebastian Hesselbarth
2013-12-13  9:20       ` Sebastian Hesselbarth
2013-12-13  9:20       ` Sebastian Hesselbarth
2013-12-13  9:20     ` [PATCH v2 5/5] net: phy: suspend phydev when going to HALTED Sebastian Hesselbarth
2013-12-13  9:20       ` Sebastian Hesselbarth
2013-12-04 15:44 ` [PATCH RFCv2 1/6] net: mv643xx_eth: properly start/stop phy device Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-04 15:44 ` [PATCH RFCv2 2/6] net: phy: marvell: provide genphy suspend/resume Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-04 15:44 ` [PATCH RFCv2 3/6] net: phy: provide phy_resume/phy_suspend helpers Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-06  0:08   ` Florian Fainelli
2013-12-06  0:08     ` Florian Fainelli
2013-12-04 15:44 ` [PATCH RFCv2 4/6] net: phy: resume/suspend PHYs on attach/detach Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-04 15:44 ` [PATCH RFCv2 5/6] net: phy: suspend unused PHYs on mdio_bus in late_initcall Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth
2013-12-04 21:05   ` Sergei Shtylyov
2013-12-04 21:05     ` Sergei Shtylyov
2013-12-06  0:02   ` Florian Fainelli
2013-12-06  0:02     ` Florian Fainelli
2013-12-04 15:44 ` [PATCH RFCv2 6/6] net: phy: suspend phydev when going to HALTED Sebastian Hesselbarth
2013-12-04 15:44   ` Sebastian Hesselbarth

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=528D27B2.4000707@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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.