linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC v1 7/7] net: cpsw: resume/suspend PHY on port start/stop
Date: Wed, 20 Nov 2013 21:57:08 +0100	[thread overview]
Message-ID: <528D2224.9090106@gmail.com> (raw)
In-Reply-To: <CAGVrzcZ+5oaucp+OSeGGe=6MBjEwi4K=E_NbCm3PjR_Owyxstw@mail.gmail.com>

On 11/20/2013 09:48 PM, Florian Fainelli wrote:
> 2013/11/20 Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>:
>> Network PHYs consume a noticable amount of power. This adds phy_resume
>> on slave_open and phy_suspend on slave_stop to save this power if the
>> port is down anyway.
>>
>> Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
>> ---
>> Cc: David S. Miller <davem@davemloft.net>
>> Cc: netdev at vger.kernel.org
>> Cc: linux-arm-kernel at lists.infradead.org
>> Cc: linux-kernel at vger.kernel.org
>> ---
>>   drivers/net/ethernet/ti/cpsw.c |    2 ++
>>   1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
>> index 90d41d2..f1dc54f 100644
>> --- a/drivers/net/ethernet/ti/cpsw.c
>> +++ b/drivers/net/ethernet/ti/cpsw.c
>> @@ -1013,6 +1013,7 @@ static void cpsw_slave_open(struct cpsw_slave *slave, struct cpsw_priv *priv)
>>          } else {
>>                  dev_info(priv->dev, "phy found : id is : 0x%x\n",
>>                           slave->phy->phy_id);
>> +               phy_resume(slave->phy);
>>                  phy_start(slave->phy);
>
> Cannot phy_start() figure this out for us based on the internal PHY
> device state machine?

Yeah, as I said in the cover letter, I started with mv643xx_eth which
is not using phy_start/stop as it probably should be. As soon as I
looked at mvneta/cpsw, I also came to the conclusion that
phy_suspend/resume should be hidden in phy_start/stop.

> I would imagine that you would want to call phy_suspend/resume from an
> Ethernet driver's PM suspend/resume callbacks to make sure that the
> PHY also enters a low power mode, but I do not want to have to
> remember that I need to call phy_resume before phy_start for instance.
> As of today we have PHY_HALTED/PHY_RESUMING, and I think we certainly
> need at least a PHY_SUSPENDED state to help us with that.
>
>>
>>                  /* Configure GMII_SEL register */
>> @@ -1081,6 +1082,7 @@ static void cpsw_slave_stop(struct cpsw_slave *slave, struct cpsw_priv *priv)
>>          if (!slave->phy)
>>                  return;
>>          phy_stop(slave->phy);
>> +       phy_suspend(slave->phy);
>
> Same here, why is not that hidden in phy_stop? If there is any fear
> that this breaks setups where WoL is used or such, we could add a new
> argument to phy_connect() and friends which says whether it is okay to
> auto-suspend the PHY upon PHY_stop
>
>>          phy_disconnect(slave->phy);
>>          slave->phy = NULL;
>>   }
>> --
>> 1.7.2.5
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo at vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at  http://www.tux.org/lkml/
>
>
>

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

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

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=528D2224.9090106@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 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).