[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<DU0PR04MB9496EC52CF54A8F635F1408690D22@DU0PR04MB9496.eurprd04.prod.outlook.com>
Date: Fri, 14 Mar 2025 09:48:06 +0000
From: Bough Chen <haibo.chen@....com>
To: Marc Kleine-Budde <mkl@...gutronix.de>
CC: "mailhol.vincent@...adoo.fr" <mailhol.vincent@...adoo.fr>, "Ciprian Marian
Costea (OSS)" <ciprianmarian.costea@....nxp.com>, Han Xu <han.xu@....com>,
"u.kleine-koenig@...libre.com" <u.kleine-koenig@...libre.com>,
"linux-can@...r.kernel.org" <linux-can@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"imx@...ts.linux.dev" <imx@...ts.linux.dev>
Subject: RE: [PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE when
resume has no issue
> -----Original Message-----
> From: Marc Kleine-Budde <mkl@...gutronix.de>
> Sent: 2025年3月14日 17:43
> To: Bough Chen <haibo.chen@....com>
> Cc: mailhol.vincent@...adoo.fr; Ciprian Marian Costea (OSS)
> <ciprianmarian.costea@....nxp.com>; Han Xu <han.xu@....com>;
> u.kleine-koenig@...libre.com; linux-can@...r.kernel.org;
> linux-kernel@...r.kernel.org; imx@...ts.linux.dev
> Subject: Re: [PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE
> when resume has no issue
>
> On 14.03.2025 10:13:08, Marc Kleine-Budde wrote:
> > On 06.03.2025 14:59:20, haibo.chen@....com wrote:
> > > From: Haibo Chen <haibo.chen@....com>
> > >
> > > Only set CAN state to CAN_STATE_ERROR_ACTIVE when resume process has
> > > no issue, otherwise keep in CAN_STATE_SLEEPING as suspend did.
> >
> > When looking at the code, it makes no sense to set the can.state to
> > CAN_STATE_ERROR_ACTIVE, if the device isn't up.
> >
> > The suspend function doesn't look correct, either. I'll send a v3.
>
> After a suspend/resume cycle on a down interface, it will come up as
> ERROR-ACTIVE.
Seems only need to handle the priv->can.state when netif_running(dev) return true in PM.
Regards
Haibo Chen
>
> | $ ip -details -s -s a s dev flexcan0
> | 3: flexcan0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN group default
> qlen 10
> | link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0
> | can state STOPPED (berr-counter tx 0 rx 0) restart-ms 1000
> |
> | $ sudo systemctl suspend
> |
> | $ ip -details -s -s a s dev flexcan0
> | 3: flexcan0: <NOARP,ECHO> mtu 16 qdisc pfifo_fast state DOWN group default
> qlen 10
> | link/can promiscuity 0 allmulti 0 minmtu 0 maxmtu 0
> | can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 1000
>
> 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