]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
can: flexcan: fix resume function
authorFabio Estevam <fabio.estevam@nxp.com>
Wed, 17 Aug 2016 15:41:08 +0000 (12:41 -0300)
committerSasha Levin <alexander.levin@verizon.com>
Thu, 6 Oct 2016 02:40:20 +0000 (22:40 -0400)
commit0b5f2bd0dfa47e81a2c2104849c27c5be920782e
treed69e0456d0a01e084a852a6520609c288974587a
parent8694542801332f0019b6a0f12bdf64a358057804
can: flexcan: fix resume function

[ Upstream commit 4de349e786a3a2d51bd02d56f3de151bbc3c3df9 ]

On a imx6ul-pico board the following error is seen during system suspend:

dpm_run_callback(): platform_pm_resume+0x0/0x54 returns -110
PM: Device 2090000.flexcan failed to resume: error -110

The reason for this suspend error is because when the CAN interface is not
active the clocks are disabled and then flexcan_chip_enable() will
always fail due to a timeout error.

In order to fix this issue, only call flexcan_chip_enable/disable()
when the CAN interface is active.

Based on a patch from Dong Aisheng in the NXP kernel.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/net/can/flexcan.c