netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: nicolas.ferre@microchip.com,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
	Claudiu Beznea <claudiu.beznea@microchip.com>,
	harini.katakam@xilinx.com
Cc: linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	sergio.prado@e-labworks.com, antoine.tenart@bootlin.com,
	linux@armlinux.org.uk, andrew@lunn.ch, michal.simek@xilinx.com
Subject: Re: [PATCH v2 5/7] net: macb: fix call to pm_runtime in the suspend/resume functions
Date: Tue, 21 Apr 2020 10:21:18 -0700	[thread overview]
Message-ID: <1bd761fc-5eeb-bef5-5a6b-86d67fed3a7f@gmail.com> (raw)
In-Reply-To: <1c537d1287aaf57b8b20a923686dbb551e1727f0.1587463802.git.nicolas.ferre@microchip.com>



On 4/21/2020 3:41 AM, nicolas.ferre@microchip.com wrote:
> From: Nicolas Ferre <nicolas.ferre@microchip.com>
> 
> The calls to pm_runtime_force_suspend/resume() functions are only
> relevant if the device is not configured to act as a WoL wakeup source.
> Add the device_may_wakeup() test before calling them.
> 
> Fixes: 3e2a5e153906 ("net: macb: add wake-on-lan support via magic packet")
> Cc: Claudiu Beznea <claudiu.beznea@microchip.com>
> Cc: Harini Katakam <harini.katakam@xilinx.com>
> Cc: Sergio Prado <sergio.prado@e-labworks.com>
> Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
> ---
> Changes in v2:
> - new in v2 serries
> 
>   drivers/net/ethernet/cadence/macb_main.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 72b8983a763a..8cf8e21fbb07 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4564,7 +4564,8 @@ static int __maybe_unused macb_suspend(struct device *dev)
>   
>   	if (bp->ptp_info)
>   		bp->ptp_info->ptp_remove(netdev);
> -	pm_runtime_force_suspend(dev);
> +	if (!(device_may_wakeup(dev)))
> +		pm_runtime_force_suspend(dev);

Only if you need to respin, the parenthesis around device_may_wakeup() 
are not required:

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

  reply	other threads:[~2020-04-21 17:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 10:40 [PATCH v2 0/7] net: macb: Wake-on-Lan magic packet fixes and GEM handling nicolas.ferre
2020-04-21 10:40 ` [PATCH v2 1/7] net: macb: fix wakeup test in runtime suspend/resume routines nicolas.ferre
2020-04-21 10:40 ` [PATCH v2 2/7] net: macb: mark device wake capable when "magic-packet" property present nicolas.ferre
2020-04-21 10:41 ` [PATCH v2 3/7] net: macb: fix macb_get/set_wol() when moving to phylink nicolas.ferre
2020-04-21 10:41 ` [PATCH v2 4/7] net: macb: fix macb_suspend() by removing call to netif_carrier_off() nicolas.ferre
2020-04-21 17:16   ` Florian Fainelli
2020-04-21 10:41 ` [PATCH v2 5/7] net: macb: fix call to pm_runtime in the suspend/resume functions nicolas.ferre
2020-04-21 17:21   ` Florian Fainelli [this message]
2020-04-21 10:41 ` [PATCH v2 6/7] net: macb: WoL support for GEM type of Ethernet controller nicolas.ferre
2020-04-21 15:13   ` Claudiu.Beznea
2020-04-21 15:37     ` Nicolas Ferre
2020-04-21 10:41 ` [PATCH v2 7/7] net: macb: Add WoL interrupt support for MACB " nicolas.ferre
2020-04-21 17:22   ` Florian Fainelli

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=1bd761fc-5eeb-bef5-5a6b-86d67fed3a7f@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=antoine.tenart@bootlin.com \
    --cc=claudiu.beznea@microchip.com \
    --cc=davem@davemloft.net \
    --cc=harini.katakam@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=sergio.prado@e-labworks.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 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).