This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WHY pwm driver works when insmod as module, while crash when build-in kernel?

Hi,

I am debugging a pwm driver in am3517, I found a curious problem, when I compile the driver as .ko, and insmod, it works well, but when I build it into kernel, the kernel will crash.

This file is my pwm driver file:

1586.am3517_bl.c.txt


The following is error console log:
4300.console-log.txt

Thanks,
Kevin
  • Looking at the crash, it looks like the clock is disabled for the module and you are trying to access the register. Try disabling option "CONFIG_OMAP_RESET_CLOCKS" in kernel config.

    Side NOTE: From Linux point of view the Driver is written very badly, request you to follow Linux framework (and possible Linux coding style).

    Thanks,

    Vaibhav

  • Thanks very much.

    Vaibhav Hiremath said:
    Looking at the crash, it looks like the clock is disabled for the module and you are trying to access the register. Try disabling option "CONFIG_OMAP_RESET_CLOCKS" in kernel config.

    It seems the reason for that problem, and I will improve my driver to better format.

    Regards,

    Kevin