Kernel freeze on mmap TIMER module enable

128 views
Skip to first unread message

Leonardo Romor

unread,
Dec 27, 2017, 4:48:27 PM12/27/17
to BeagleBoard
Hello,

could someone explain me why running this code freezes the kernel?


It should turn on the beaglebone TIMER4.
I have tested this code on 3.8 kernel and it works.

thank you,

Leo

Henner Zeller

unread,
Dec 29, 2017, 9:22:55 AM12/29/17
to Beagle Board
On 27 December 2017 at 13:48, Leonardo Romor <leonard...@gmail.com> wrote:
> Hello,
>
> could someone explain me why running this code freezes the kernel?
>
> https://gist.github.com/lromor/e303c88cfb8a065d411f2ba0bc52324b

Thanks Leonardo to measure and put together this report of this issue
when using 4.4.91-ti-r137.

>
> It should turn on the beaglebone TIMER4.
> I have tested this code on 3.8 kernel and it works.

This currently prevents PWM to work in BeagleG in newer kernels; so it
would be good to know from some of the people familiar with the
kernel/GPIO interaction could chime in and explain what is going on
and if there is a way to work-around it or if the initialization
should be different altogether.

Thanks
Henner.

Robert Nelson

unread,
Dec 29, 2017, 9:53:28 AM12/29/17
to Beagle Board
Let's see, your mmap'ing a clock that "was" being handled by the
kernel's pwm subsystem, and now the system freezes...

Well, stop mmap'ing or disable the pwm driver..

Regards,

--
Robert Nelson
https://rcn-ee.com/

Leonardo Romor

unread,
Jan 2, 2018, 10:41:23 AM1/2/18
to BeagleBoard

Hello, 
thank you for the answer and sorry for the late reply,
is it possible to disable the driver without recompiling the kernel?

I see there are 4 drivers present for the am335x:


kernel/drivers/pwm/pwm-tiecap.ko
kernel/drivers/pwm/pwm-tiehrpwm.ko
kernel/drivers/regulator/pwm-regulator.ko
kernel/drivers/video/backlight/pwm_bl.ko

What's the difference between the first two?

The folder I assumed to be filled (/sys/class/pwm) when the drivers are enabled is empty. 

Also:
Does the kernel manages the timer and pwm with same driver?

Thank you,

-l

Henner Zeller

unread,
Jan 5, 2018, 12:35:59 PM1/5/18
to Beagle Board
Ping - it would be really interesting to know if disabling the kernel
driver is simple thing that can be configured from user-space, or
maybe if there are alternatives.

So far I enjoyed that it is possible to relatively simply just read
the datasheet and set the registers, but that seems to increasingly
getting complicated with the kernel doing its own thing. Which is fine
I suppose, but is there a documentation how to use the PWM subsystem
in that case ?

-h
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/e93eaf41-49ef-4db1-b7ac-bae099b0dab2%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages