I am trying to get my system to suspend-to-ram (echo mem > /sys/power/state) and it works great and wakes up with my assigned gpio-key without issue. However, if the gpio is pressed while the system is going into suspend it locks up and won't come out. The same occurs with the console. So if i spam the button while executing echo mem > /sys/power/state the system goes to sleep fine:
PM: Syncing filesystems ... done.
Freezing user space processes ... (elapsed 0.001 seconds) done.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
PM: suspend of devices complete after 126.463 msecs
PM: suspend devices took 0.130 seconds
PM: late suspend of devices complete after 1.323 msecs
PM: noirq suspend of devices complete after 1.377 msecs
Disabling non-boot CPUs ...
But it never wakes back up from any interrupt. The same exact thing happens with the console interrupt if i spam a key after sending the suspend command so that leads me to believe it is any interrupt that occurs while trying to suspend. I can't seem to find any other mention of this issue? Something I am missing? I am using gpio7_13 for the button and am using an i.mx6 quad plus and running imx linux 4.1.15_1.1.0_ga.