[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DB7PR04MB40105C2B16E710DBD3F8BB9E9000A@DB7PR04MB4010.eurprd04.prod.outlook.com>
Date: Wed, 26 Jul 2023 11:10:38 +0000
From: Bough Chen <haibo.chen@....com>
To: Marc Kleine-Budde <mkl@...gutronix.de>
CC: "robh+dt@...nel.org" <robh+dt@...nel.org>,
"krzysztof.kozlowski+dt@...aro.org" <krzysztof.kozlowski+dt@...aro.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>, "shawnguo@...nel.org"
<shawnguo@...nel.org>, "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"wg@...ndegger.com" <wg@...ndegger.com>, "kernel@...gutronix.de"
<kernel@...gutronix.de>, dl-linux-imx <linux-imx@....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>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, "linux-can@...r.kernel.org"
<linux-can@...r.kernel.org>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>
Subject: RE: [PATCH v2 3/3] can: flexcan: lack of stop mode dts properity
should not block driver probe
> -----Original Message-----
> From: Marc Kleine-Budde <mkl@...gutronix.de>
> Sent: 2023年7月26日 18:17
> To: Bough Chen <haibo.chen@....com>
> Cc: robh+dt@...nel.org; krzysztof.kozlowski+dt@...aro.org;
> conor+dt@...nel.org; shawnguo@...nel.org; s.hauer@...gutronix.de;
> wg@...ndegger.com; kernel@...gutronix.de; dl-linux-imx
> <linux-imx@....com>; davem@...emloft.net; edumazet@...gle.com;
> kuba@...nel.org; pabeni@...hat.com; devicetree@...r.kernel.org;
> linux-can@...r.kernel.org; netdev@...r.kernel.org
> Subject: Re: [PATCH v2 3/3] can: flexcan: lack of stop mode dts properity should
> not block driver probe
>
> On 26.07.2023 17:09:09, haibo.chen@....com wrote:
> > From: Haibo Chen <haibo.chen@....com>
> >
> > If SoC claim to support stop mode, but dts file do not contain the
> > stop mode properity, this should not block the driver probe. For this
> > case, the driver only need to skip the wakeup capable setting which
> > means this device do not support the feature to wakeup system.
>
> This still breaks old DTS on kernels with patch 2 applied, but not 3.
> Please squash this into 2.
Okay.
>
> >
> > Signed-off-by: Haibo Chen <haibo.chen@....com>
> > ---
> > drivers/net/can/flexcan/flexcan-core.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/can/flexcan/flexcan-core.c
> > b/drivers/net/can/flexcan/flexcan-core.c
> > index a3f3a9c909be..d8be69f4a0c3 100644
> > --- a/drivers/net/can/flexcan/flexcan-core.c
> > +++ b/drivers/net/can/flexcan/flexcan-core.c
> > @@ -1987,7 +1987,14 @@ static int flexcan_setup_stop_mode(struct
> platform_device *pdev)
> > /* return 0 directly if doesn't support stop mode feature */
> > return 0;
> >
> > - if (ret)
> > + /* If ret is -EINVAL, this means SoC claim to support stop mode, but
> > + * dts file lack the stop mode property definition. For this case,
> > + * directly return 0, this will skip the wakeup capable setting and
> > + * will not block the driver probe.
> > + */
> > + if (ret == -EINVAL)
> > + return 0;
> > + else if (ret)
> > return ret;
> >
> > device_set_wakeup_capable(&pdev->dev, true);
> > --
> > 2.34.1
> >
> >
>
> regards,
> Marc
>
> --
> Pengutronix e.K. | Marc Kleine-Budde |
> Embedded Linux | https://www.pengutronix.de |
> Vertretung Nürnberg | Phone: +49-5121-206917-129 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Powered by blists - more mailing lists