Wake up on CAN does not work after suspend

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Wake up on CAN does not work after suspend

2,109 Views
sanchayanmaity
Contributor III

Hello,

I am using a Toradex Apalis iMX6Q module with 4.1.39 kernel based on NXP's downstream kernel release. After a suspend operation, the module does not wake up from suspend on a CAN frame reception.

The driver does seem to implement the self wakeup mechanism to wake from suspend on CAN frame receive however it does not seem to work at the moment.  As per the TRM, the flexcan peripheral has a stop-mode which supports a waking up the processor if the following configuration is done:

“In the Self Wake mechanism, if the SLF_WAK bit in MCR Register was set at the time FlexCAN entered Stop Mode, then upon detection of a recessive to dominant transition on the CAN bus, FlexCAN sets the WAK_INT bit in the ESR Register and, if enabled by the WAK_MSK bit in MCR, generates a Wake Up interrupt to the ARM. Upon receiving the interrupt, the ARM should resume the clocks and remove the Stop Mode request manually”

Looking at the flexcan driver it seems that both SLF_WAK bit as well as WAK_INT bits are set during initialization in probe().  So from the code the device should wake up on interrupt. Also as per the TRM

“To enter stop mode, the CPU should manually assert a global Stop Mode request (see the CAN1_STOP_REQ and CAN2_STOP_REQ bit in the register IOMUXC_GPR4)and check the acknowledgement asserted by the FlexCAN (see the CAN1_STOP_ACK and CAN2_STOP_ACK in the register IOMUXC_GPR4) . The CPU must only consider the FlexCAN in Stop Mode when both request and acknowledgement conditions are satisfied”

However it does not seem to check the ACK at all in flexcan_enter_stop_mode so the implementation seems incorrect or incomplete. Is there a known fix available?

Regards,

Sanchayan.

Labels (2)
Tags (3)
0 Kudos
Reply
6 Replies

1,612 Views
sanchayanmaity
Contributor III

This patch fixes the issue.

Current downstream NXP 4.1 kernel is broken with regards to suspend resume on CAN frame reception.

Regards,

Sanchayan.

0 Kudos
Reply

1,612 Views
sanchayanmaity
Contributor III

Hello Igor,

It's 4.1.39 because we merged the upstream stable release into NXP's downstream 4.1.15. It still implies a bug in the NXP downstream flexcan kernel driver.

Our customer also reports that the same worked with older 3.14.28 kernel release so there is also a regression.

0 Kudos
Reply

1,612 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sanchayan

please try to reproduce it on nxp i.MX6Q  sabre ai reference board

with demo images on

http://www.nxp.com/webapp/Download?colCode=IMX6_N7.1.1_1.0.0_ANDROID_DEMO_AI_BSP&appType=license&loc... 

Best regards
igor

0 Kudos
Reply

1,612 Views
sanchayanmaity
Contributor III

Hello Igor,

Sorry but I do not have access to a Sabre reference board.

0 Kudos
Reply

1,612 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sanchayan

suggest to borrow on local office.

If you think this is nxp bsp/chip issue, this should be

reproduced on nxp i.MX6Q  sabre ai reference board with demo images.

Best regards
igor

0 Kudos
Reply

1,612 Views
igorpadykov
NXP Employee
NXP Employee

Hi Sanchayan

please check with nxp official bsps described on

i.MX 6 / i.MX 7 Series Software and Development Tool|NXP 

and imx-test package, folder /test/can

imx-test
www.nxp.com/lgfiles/NMG/MAD/YOCTO/imx-test-5.7.tar.gz

Note 4.1.39 kernel and third party boards bsps are not supported by nxp

and should be supported by vendors of these products. Also this may be

posted to meta-fsl-arm mailing list
https://lists.yoctoproject.org/listinfo/meta-freescale

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply