RE: [PATCH 2/2] can: flexcan: remove the auto stop mode for IMX93

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>
> Sent: 2023年7月26日 14:36
> To: Bough Chen <haibo.chen@xxxxxxx>
> Cc: robh+dt@xxxxxxxxxx; krzysztof.kozlowski+dt@xxxxxxxxxx;
> conor+dt@xxxxxxxxxx; shawnguo@xxxxxxxxxx; s.hauer@xxxxxxxxxxxxxx;
> wg@xxxxxxxxxxxxxx; kernel@xxxxxxxxxxxxxx; dl-linux-imx
> <linux-imx@xxxxxxx>; davem@xxxxxxxxxxxxx; edumazet@xxxxxxxxxx;
> kuba@xxxxxxxxxx; pabeni@xxxxxxxxxx; devicetree@xxxxxxxxxxxxxxx;
> linux-can@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH 2/2] can: flexcan: remove the auto stop mode for IMX93
> 
> On 26.07.2023 11:50:32, haibo.chen@xxxxxxx wrote:
> > From: Haibo Chen <haibo.chen@xxxxxxx>
> >
> > 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@xxxxxxx>
> > ---
> >  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   |




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux