All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jon Mason <jon.mason@broadcom.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "David Miller" <davem@davemloft.net>,
	"Rafał Miłecki" <rafal@milecki.pl>,
	"BCM Kernel Feedback" <bcm-kernel-feedback-list@broadcom.com>,
	"Network Development" <netdev@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Joey Zhong" <zhongx@broadcom.com>
Subject: Re: [PATCH 3/3] net: ethernet: bgmac: driver power manangement
Date: Mon, 6 Feb 2017 11:30:18 -0500	[thread overview]
Message-ID: <CAC3K-4rMxYgLEN3Y2Cq-+Otm-eZfY5jZJ7yEMwA_H_g3bEWYbw@mail.gmail.com> (raw)
In-Reply-To: <74efc661-f07d-93d5-613d-7f563c0fe732@gmail.com>

On Fri, Feb 3, 2017 at 9:16 PM, Florian Fainelli <f.fainelli@gmail.com> wrote:
> On 02/03/2017 01:39 PM, Jon Mason wrote:
>> From: Joey Zhong <zhongx@broadcom.com>
>>
>> Implements suspend/resume, external phy 54810 is assumed
>> to remain powered up during deep-sleep for wake-on-lane.
>
> s/wake-on-lane/Wake-on-LAN, are you positive phy_stop() is not
> suspending the PHY and issuing BMCR_PWRDOWN write?
>
> This also seems incomplete in that, if the device is really configured
> for Wake-on-LAN (through ethtool) you should call
> device_set_wakeup_capable() and then check for device_may_wakeup()
> during suspend or resume to know which part of the suspend/resume
> portion should be done. You could refer to bcmgenet for an example.

After some internal discussion, WOL is not supported by our SVK.  So,
we have no way of testing it.  Given this limitation, I'm removing the
WOL comment until such time as we can actually test the logic.

>>
>> +int bgmac_enet_suspend(struct bgmac *bgmac)
>> +{
>> +     netdev_info(bgmac->net_dev, "Suspending\n");
>
> remove that message
>
>> +
>> +     if (netif_running(bgmac->net_dev)) {
>> +             netif_stop_queue(bgmac->net_dev);
>> +
>> +             napi_disable(&bgmac->napi);
>> +
>> +             netif_tx_lock(bgmac->net_dev);
>> +             netif_device_detach(bgmac->net_dev);
>> +             netif_tx_unlock(bgmac->net_dev);
>> +
>> +             bgmac_chip_intrs_off(bgmac);
>> +             bgmac_chip_reset(bgmac);
>> +             bgmac_dma_cleanup(bgmac);
>> +     }
>
> Can you change the indentation to test for netiff_running() first and
> return 0 in that case?
>
>> +
>> +     phy_stop(bgmac->net_dev->phydev);
>> +
>> +     return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(bgmac_enet_suspend);
>> +
>> +int bgmac_enet_resume(struct bgmac *bgmac)
>> +{
>> +     int rc;
>> +
>> +     netdev_info(bgmac->net_dev, "Resuming\n");
>
> Same here, this needs to be removed.

Will do this and above.

Thanks,
Jon

>
>> +
>> +     phy_start(bgmac->net_dev->phydev);
>> +
>> +     if (netif_running(bgmac->net_dev)) {
>> +             rc = bgmac_dma_init(bgmac);
>> +             if (rc)
>> +                     return rc;
>> +
>> +             bgmac_chip_init(bgmac);
>> +
>> +             napi_enable(&bgmac->napi);
>> +
>> +             netif_tx_lock(bgmac->net_dev);
>> +             netif_device_attach(bgmac->net_dev);
>> +             netif_tx_unlock(bgmac->net_dev);
>> +
>> +             netif_start_queue(bgmac->net_dev);
>> +     }
> --
> Florian

      reply	other threads:[~2017-02-06 16:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-03 21:39 [PATCH net-next 0/3] net: ethernet: bgmac: PM support and clean-ups Jon Mason
2017-02-03 21:39 ` [PATCH 1/3] net: ethernet: bgmac: use #defines for MAX size Jon Mason
2017-02-03 21:39 ` [PATCH 2/3] net: ethernet: bgmac: unify code of the same family Jon Mason
2017-02-03 21:48   ` Rafał Miłecki
2017-02-03 22:35     ` Jon Mason
2017-02-03 21:39 ` [PATCH 3/3] net: ethernet: bgmac: driver power manangement Jon Mason
2017-02-04  2:16   ` Florian Fainelli
2017-02-06 16:30     ` Jon Mason [this message]

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=CAC3K-4rMxYgLEN3Y2Cq-+Otm-eZfY5jZJ7yEMwA_H_g3bEWYbw@mail.gmail.com \
    --to=jon.mason@broadcom.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rafal@milecki.pl \
    --cc=zhongx@broadcom.com \
    /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.