summaryrefslogtreecommitdiff
path: root/drivers/net/can
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2015-02-11 15:12:44 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:20:42 +0300
commit7f5f0a6d4a7edb01e02a55ccea79536028d967cc (patch)
tree1ac5b327799263858bb4e231e5a23e2cfb18496e /drivers/net/can
parent1a7179941e20ab8a44b07fb44b2508a60bef309f (diff)
MLK-10211 can: flexcan: fix resume failed issue
We can observe the following error during system resume. dpm_run_callback(): platform_pm_resume+0x0/0x4c returns -110 PM: Device 2090000.can failed to resume: error -110 It is caused by the flexcan is in disable state and the clock is disabled by default while the CAN is not up. During resume, the calling of flexcan_chip_enable will obviously fail due to no clock. The issue only happened when CAN device is not up. If CAN is up, clock is there and no issue will happen. Because the CAN is always in disabled state by default if it's not up. We don't have to disable it again during suspend and enable it after resume. This patch simply the suspend/resume to only enter/exit disabled mode if CAN is up. Signed-off-by: Dong Aisheng <b29396@freescale.com> (cherry picked from commit d976d7c9d408c1275075d5870ccf6cb425720434)
Diffstat (limited to 'drivers/net/can')
-rw-r--r--drivers/net/can/flexcan.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index d996e71a43c1..9988fff8a974 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -1393,8 +1393,6 @@ static int __maybe_unused flexcan_suspend(struct device *device)
} else {
err = flexcan_chip_disable(priv);
}
- } else {
- err = flexcan_chip_disable(priv);
}
priv->can.state = CAN_STATE_SLEEPING;
@@ -1418,8 +1416,6 @@ static int __maybe_unused flexcan_resume(struct device *device)
} else {
err = flexcan_chip_enable(priv);
}
- } else {
- err = flexcan_chip_enable(priv);
}
return err;