Skip to content

Commit 3bc2afc

Browse files
Haibo Chenmarckleinebudde
authored andcommitted
can: flexcan: avoid unbalanced pm_runtime_enable warning
When do suspend/resume, meet the following warning message: [ 30.028336] flexcan 425b0000.can: Unbalanced pm_runtime_enable! Balance the pm_runtime_force_suspend() and pm_runtime_force_resume(). Fixes: 8cb53b4 ("can: flexcan: add auto stop mode for IMX93 to support wakeup") Signed-off-by: Haibo Chen <[email protected]> Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 115dd54 commit 3bc2afc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

drivers/net/can/flexcan/flexcan-core.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,9 +2349,15 @@ static int __maybe_unused flexcan_noirq_resume(struct device *device)
23492349
if (netif_running(dev)) {
23502350
int err;
23512351

2352-
err = pm_runtime_force_resume(device);
2353-
if (err)
2354-
return err;
2352+
/* For the wakeup in auto stop mode, no need to gate on the
2353+
* clock here, hardware will do this automatically.
2354+
*/
2355+
if (!(device_may_wakeup(device) &&
2356+
priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)) {
2357+
err = pm_runtime_force_resume(device);
2358+
if (err)
2359+
return err;
2360+
}
23552361

23562362
if (device_may_wakeup(device))
23572363
flexcan_enable_wakeup_irq(priv, false);

0 commit comments

Comments
 (0)