[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB7PR04MB40108B020348197573BF5AF090159@DB7PR04MB4010.eurprd04.prod.outlook.com>
Date: Wed, 30 Nov 2022 11:39:59 +0000
From: Bough Chen <haibo.chen@....com>
To: Marc Kleine-Budde <mkl@...gutronix.de>
CC: "wg@...ndegger.com" <wg@...ndegger.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org"
<krzysztof.kozlowski+dt@...aro.org>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
dl-linux-imx <linux-imx@....com>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: RE: [PATCH 1/3] can: flexcan: add auto stop mode for IMX93 to support
wakeup
> -----Original Message-----
> From: Marc Kleine-Budde <mkl@...gutronix.de>
> Sent: 2022年11月30日 18:54
> To: Bough Chen <haibo.chen@....com>
> Cc: wg@...ndegger.com; davem@...emloft.net; edumazet@...gle.com;
> kuba@...nel.org; pabeni@...hat.com; robh+dt@...nel.org;
> krzysztof.kozlowski+dt@...aro.org; shawnguo@...nel.org;
> s.hauer@...gutronix.de; kernel@...gutronix.de; festevam@...il.com;
> dl-linux-imx <linux-imx@....com>; linux-can@...r.kernel.org;
> netdev@...r.kernel.org; devicetree@...r.kernel.org
> Subject: Re: [PATCH 1/3] can: flexcan: add auto stop mode for IMX93 to support
> wakeup
>
> On 22.11.2022 19:32:30, haibo.chen@....com wrote:
> > From: Haibo Chen <haibo.chen@....com>
> >
> > IMX93 do not contain a GPR to config the stop mode, it will set the
> > flexcan into stop mode automatically once the ARM core go into low
> > power mode (WFI instruct) and gate off the flexcan related clock
> > automatically. But to let these logic work as expect, before ARM core
> > go into low power mode, need to make sure the flexcan related clock
> > keep on.
> >
> > To support stop mode and wakeup feature on imx93, this patch add a new
> > fsl_imx93_devtype_data to separate from imx8mp.
> >
> > Signed-off-by: Haibo Chen <haibo.chen@....com>
> > ---
> > drivers/net/can/flexcan/flexcan-core.c | 37 +++++++++++++++++++++++---
> > drivers/net/can/flexcan/flexcan.h | 2 ++
> > 2 files changed, 36 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/can/flexcan/flexcan-core.c
> > b/drivers/net/can/flexcan/flexcan-core.c
> > index 9bdadd716f4e..0aeff34e5ae1 100644
> > --- a/drivers/net/can/flexcan/flexcan-core.c
> > +++ b/drivers/net/can/flexcan/flexcan-core.c
>
> [...]
>
> > @@ -2299,8 +2322,16 @@ static int __maybe_unused
> flexcan_noirq_suspend(struct device *device)
> > if (netif_running(dev)) {
> > int err;
> >
> > - if (device_may_wakeup(device))
> > + if (device_may_wakeup(device)) {
> > flexcan_enable_wakeup_irq(priv, true);
> > + /* For auto stop mode, need to keep the clock on before
> > + * system go into low power mode. After system go into
> > + * low power mode, hardware will config the flexcan into
> > + * stop mode, and gate off the clock automatically.
> > + */
> > + if (priv->devtype_data.quirks &
> FLEXCAN_QUIRK_AUTO_STOP_MODE)
> > + return 0;
> > + }
>
> With this change the flexcan_noirq_resume() is not symmetrical any more:
> pm_runtime_force_suspend() is not called for mx93, but
> pm_runtime_force_resume() is called.
Yes, I do not understand the logic of pm_runtime_force_suspend correctly. I also find there is an unbalance warning show up. My bad.
Will fix this and send a V2 patch.
Best Regards
Haibo Chen
>
> >
> > err = pm_runtime_force_suspend(device);
> > if (err)
>
> 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 |
Powered by blists - more mailing lists