I am using Linux kernel 4.9 on the i.MX6 series.
If using ethernet MAC and IPSEC (for VPN), sometimes the system goes into deadlock.
The problem is in xfrm_input.c, in the xfrm_input() function.
This function is called for each incomming network packet, and also for each decrypted packet.
Both calls came from (different) soft irqs, and as the resources were protected with spin_lock(), there will be a deadlock if both calls came at the same time.
The solution is to convert all spinlock functions in xfrm_input() to use spinlock_bh() funktions.
Look at this patch: