lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Wed, 26 Jul 2023 08:04:54 +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 2/2] can: flexcan: remove the auto stop mode for IMX93

> -----Original Message-----
> From: Marc Kleine-Budde <mkl@...gutronix.de>
> Sent: 2023年7月26日 14:36
> 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 2/2] can: flexcan: remove the auto stop mode for IMX93
> 
> On 26.07.2023 11:50:32, haibo.chen@....com wrote:
> > From: Haibo Chen <haibo.chen@....com>
> >
> > IMX93 A0 chip involve the internal q-channel handshake in LPCG and CCM
> > to automatically handle the Flex-CAN IPG STOP signal. Only after
> > FLEX-CAN enter stop mode then can support the self-wakeup feature.
> >
> > But meet issue when do the continue system PM stress test. When config
> > the CAN as wakeup source, the first time after system suspend, any
> > data on CAN bus can wakeup the system, this is as expect. But the
> > second time when system suspend, data on CAN bus can't wakeup the
> > system. If continue this test, we find in odd time system enter
> > suspend, CAN can wakeup the system, but in even number system enter
> > suspend, CAN can't wakeup the system.
> >
> > IC find a bug in the auto stop mode logic when handle the q-channel,
> > and can't fix it easily. So for the new imx93 A1, IC drop the auto
> > stop mode and involve the GPR to support stop mode (used before). IC
> > define a bit in GPR which can trigger the IPG STOP signal to Flex-CAN,
> > let it go into stop mode.
> >
> > Now NXP claim to drop IMX93 A0, and only support IMX93 A1. So this
> > patch remove the auto stop mode, and add flag
> > FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR to imx93.
> >
> > 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, 5 insertions(+), 34 deletions(-)
> >
> > diff --git a/drivers/net/can/flexcan/flexcan-core.c
> > b/drivers/net/can/flexcan/flexcan-core.c
> > index ff0fc18baf13..a3f3a9c909be 100644
> > --- a/drivers/net/can/flexcan/flexcan-core.c
> > +++ b/drivers/net/can/flexcan/flexcan-core.c
> > @@ -348,7 +348,7 @@ static struct flexcan_devtype_data
> > fsl_imx8mp_devtype_data = {  static struct flexcan_devtype_data
> fsl_imx93_devtype_data = {
> >  	.quirks = FLEXCAN_QUIRK_DISABLE_RXFG |
> FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
> >  		FLEXCAN_QUIRK_DISABLE_MECR |
> FLEXCAN_QUIRK_USE_RX_MAILBOX |
> > -		FLEXCAN_QUIRK_BROKEN_PERR_STATE |
> FLEXCAN_QUIRK_AUTO_STOP_MODE |
> > +		FLEXCAN_QUIRK_BROKEN_PERR_STATE |
> FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR
> > +|
> 
> AFAICS this change breaks systems with old device trees (i.e. without
> "fsl,stop-mode") and new kernels. The flexcan driver will not probe anymore.

You are right. Lack of "fsl,stop-mode" should not break the flexcan driver probe.
I will send V2 patch to fix this.

Best Regards
Haibo Chen
> 
> 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ