Colibri iMX7 kernel panic hang

Hello,

I have encountered an issue with Colibri iMX7 Dual 1GB, running Linux version 4.14.117-3.0.2 on a custom board.
Reboot support is functioning properly when triggered by a reboot command, but it’s hanging in case of a kernel panic.

I used the following command to force a kernel panic during fs mounting, in order to be able to reproduce the issue reliably without modifying the kernel:

dd if=/dev/zero of=/dev/mmcblk0p2 bs=512 count=10

After further debugging, it turns out that it gets stuck when calling regmap_update_bits(), inside function rn5t618_trigger_poweroff_sequence(), in the file drivers/mfd/rn5t618.c

Possible work-arounds for are the following:

Removing smp_send_stop() call in function panic(), in the file kernel/panic.c
Removing smp_send_stop() call in function machine_restart(), in the file arch/arm/kernel/reboot.c

Or alternativelly:

Adding migrate_to_reboot_cpu() call to the beginning of function panic(), in the file kernel/panic.c

Based on this data, it seems that I2C communication gets stuck if the CPU 0 is not executing the reboot code. This can be managed by the migrate_to_reboot_cpu() solution.

Or simply, it occurs in the case when CPU 0 has been disabled, which is can be prevented by the removal of smp_send_stop() calls mentioned in the first work-around.

Have you encountered a similar issue, or could you perhaps point out an approach for a proper solution?
Thank you in advance!

We meanwhile released BSP 3.0.4. Please upgrade at your earliest convenience and re-test. Thanks!