[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ccfc7ac-b860-8254-ad39-66e2f50a5f3c@pengutronix.de>
Date: Tue, 10 Dec 2019 09:31:47 +0100
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Joakim Zhang <qiangqing.zhang@....com>,
"sean@...nix.com" <sean@...nix.com>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>
Cc: dl-linux-imx <linux-imx@....com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/2] can: flexcan: disable clocks during stop mode
On 12/10/19 8:16 AM, Joakim Zhang wrote:
> Disable clocks during CAN in stop mode.
>
> Signed-off-by: Joakim Zhang <qiangqing.zhang@....com>
> ---
> drivers/net/can/flexcan.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
> index 6c1ccf9f6c08..d767f85c80d3 100644
> --- a/drivers/net/can/flexcan.c
> +++ b/drivers/net/can/flexcan.c
> @@ -1786,10 +1786,16 @@ static int __maybe_unused flexcan_noirq_suspend(struct device *device)
> {
> struct net_device *dev = dev_get_drvdata(device);
> struct flexcan_priv *priv = netdev_priv(dev);
> + int err;
>
> - if (netif_running(dev) && device_may_wakeup(device))
> + if (netif_running(dev) && device_may_wakeup(device)) {
> flexcan_enable_wakeup_irq(priv, true);
>
> + err = pm_runtime_force_suspend(device);
> + if (err)
> + return err;
> + }
What about moving the pm_runtime_force_suspend() call for both cases
"device_may_wakeup()" and "!device_may_wakeup()" into the
flexcan_noirq_suspend() handler?
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists