How to debug the machine freezing on suspend even with s2idle?

The machine freezes completely and does not respond to anything including alt-ctrl-del and alt-ctrl-backspace except the hard reset every time I suspend it either by closing the lid, keeping it standby or manually calling echo mem | sudo tee /sys/power/state. The cat /sys/power/mem_sleep shows s2idle [deep]. I tried setting it to s2idle and suspending, but…

Details