On 12/10/19 8:16 AM, Joakim Zhang wrote: > Disable clocks during CAN in stop mode. > > Signed-off-by: Joakim Zhang <qiangqing.zhang@xxxxxxx> > --- > 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 |
Attachment:
signature.asc
Description: OpenPGP digital signature