I am currently facing a problem I can't understand.
I need to develop a Linux kernel module on a i.MX6UL-based embedded system. I would use this module to wake up my system from suspend mode after some delay, using the EPIT to raise an interrupt (which would be the wake-up event).
My system runs Debian Linux 8 ("Jessie"), and thus the version 4.1.15 of the Linux kernel.
I began to develop a module to control the i.MX6UL EPIT. Its source code is in the attached file.
When modprobe-ing my module, everything goes okay, until I try to access (read or write) the IO memory reserved and allocated for the EPIT modules: the system then freezes! I have to power off and on my embedded device to be able to reboot Linux!
If I comment out the lines in the disable_epit() function after my comments, the module installs modprobes without problem, and I have the following dmesg output:
[60641.899705] EPIT1 base address : a0f70000
[60641.899797] EPIT2 base address : a0f78000
[60641.899836] CR address = a0f70000
[60641.899869] EPIT module initialised.
I can only conclude that the problem does not come from the request_mem_region() or ioremap() functions, since I check for errors, and I get back valid virtual IO memory addresses...
I absolutely can't understand what's happening. Any help, advice and solution would be greatly appreciated.
Thanks, and best regards,