• Fabio Estevam's avatar
    can: flexcan: fix resume function · 0b5f2bd0
    Fabio Estevam authored
    [ Upstream commit 4de349e7 ]
    
    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: default avatarFabio Estevam <fabio.estevam@nxp.com>
    Cc: linux-stable <stable@vger.kernel.org>
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
    0b5f2bd0
flexcan.c 36.3 KB