IMX Keypad Port Driver - Linux 4.1.15 Kernel Freeze

In hopes of help regarding a kernel freeze . I am using Toradex Colibri iMX7D using the attached device tree with the attached kernel output. The freeze only occurs when adding any linux,keymap value, if no linux,keymap value is added but &kpp status=“okay”, the kernel with not freeze but obviously the keymap will not be registered. I have also changed the static 8 rows and cols to 3 with no change. Any help is appreciated.

That the freeze does not happen when not specifying linux,keymap is because this is a mandatory property. The driver doesn’t completely load without that property, hence the kernel does not crash:

[    1.739005] imx_keypad_probe
[    1.744201] imx-keypad 30320000.kpp: OF: linux,keymap property not defined in /soc/aips-bus@30000000/kpp@30320000
[    1.758936] imx-keypad 30320000.kpp: failed to build keymap
[    1.766834] imx-keypad: probe of 30320000.kpp failed with error -2

Looking into why it exactly crashes it seems that a single read to the Keypad Data Register (KPDR) is responsible. It is currently not clear why that happens. It seems also to happen on the NXP Sabre reference board… I opened a support request with NXP:

This turned out to be a missing clock. Two patches adding the missing clock seem to fix the issue. The changes are available in our -next branches:

Also tracked in our roadmap as issue 21704.