mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE when resume has no issue
@ 2025-03-06  6:59 haibo.chen
  2025-03-06  6:59 ` [PATCH v2 2/2] can: flexcan: disable transceiver during system PM haibo.chen
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: haibo.chen @ 2025-03-06  6:59 UTC (permalink / raw)
  To: mkl, mailhol.vincent
  Cc: haibo.chen, ciprianmarian.costea, han.xu, u.kleine-koenig,
	linux-can, linux-kernel, imx

From: Haibo Chen <haibo.chen@nxp.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.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/net/can/flexcan/flexcan-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index b347a1c93536..8415ef71f1b1 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -2311,7 +2311,6 @@ static int __maybe_unused flexcan_resume(struct device *device)
 	struct flexcan_priv *priv = netdev_priv(dev);
 	int err;
 
-	priv->can.state = CAN_STATE_ERROR_ACTIVE;
 	if (netif_running(dev)) {
 		netif_device_attach(dev);
 		netif_start_queue(dev);
@@ -2332,6 +2331,7 @@ static int __maybe_unused flexcan_resume(struct device *device)
 			flexcan_chip_interrupts_enable(dev);
 		}
 	}
+	priv->can.state = CAN_STATE_ERROR_ACTIVE;
 
 	return 0;
 }
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-03-14  9:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-06  6:59 [PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE when resume has no issue haibo.chen
2025-03-06  6:59 ` [PATCH v2 2/2] can: flexcan: disable transceiver during system PM haibo.chen
2025-03-06  7:15   ` Vincent Mailhol
2025-03-06 15:04   ` Frank Li
2025-03-06  7:15 ` [PATCH 1/2] can: flexcan: only set CAN_STATE_ERROR_ACTIVE when resume has no issue Vincent Mailhol
2025-03-06 15:03 ` Frank Li
2025-03-14  9:13 ` Marc Kleine-Budde
2025-03-14  9:42   ` Marc Kleine-Budde
2025-03-14  9:48     ` Bough Chen
2025-03-14  9:53       ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®