BUG:在Linux内核中从无效的上下文-振动器驱动程序中调用的睡眠函数

时间:2022-05-16 16:55:34

everyone. I was porting 3.0.x kernel for my Galaxy Mini 2, I've been able to solve most of the problems myself, but one thing in vibrator driver. I am new to working in Linux kernel, so I am not able to solve it myself. Whenever the vibrator gets enabled, this comes up in logs: https://gist.github.com/TheWhisp/6133946

每一个人。我是3.0移植。我的Galaxy Mini 2的x内核,我已经能够自己解决大部分问题,但振动器驱动程序中有一件事。我是Linux内核的新手,所以我自己不能解决它。每当启用振动器时,它就会出现在日志中:https://gist. github.com/the/6133946。

This is the source code of the vibrator driver: https://github.com/TheWhisp/android_kernel_samsung_msm7x27a/blob/jb-3.0/arch/arm/mach-msm/msm_vibrator_samsung.c

这是振动器驱动程序的源代码:https://github.com/thelistener /android_kernel_samsung_msm7x27a/blob/jb-3.0/arch/arm/mach- msm_ator_samsung.c。

If I am correct, I've narrowed it down to the function that starts on line 176

如果我是对的,我将它缩小到从第176行开始的函数

Thanks, any help would be appreciated. :)

谢谢,任何帮助都将不胜感激。:)

1 个解决方案

#1


3  

I can't agree with rakib on the solution he suggested although his analysis make sense.

我不同意拉基布提出的解决办法,尽管他的分析有道理。

The msm_vibrator_power() is called in hrtimer handler. And hrtimer is running in software irq context.

在hrtimer处理程序中调用msm_vibrator_power()。hrtimer在软件irq上下文中运行。

The OOPS information complains that msm_vibrator_power() calls _regulator_get() which uses mutex inside it.

OOPS信息抱怨msm_振动器_power()调用_regulator_get(),它在其中使用互斥。

The solution to this issue is: avoid to use any blocking/sleeping functions inside the hrtimer handler. That means to re-design the hrtimer handler, avoid to call mutex() kinds of blocking/sleeping functions.

这个问题的解决方案是:避免在hrtimer处理程序中使用任何阻塞/睡眠函数。这意味着要重新设计hrtimer处理程序,避免调用mutex()类型的阻塞/睡眠函数。

#1


3  

I can't agree with rakib on the solution he suggested although his analysis make sense.

我不同意拉基布提出的解决办法,尽管他的分析有道理。

The msm_vibrator_power() is called in hrtimer handler. And hrtimer is running in software irq context.

在hrtimer处理程序中调用msm_vibrator_power()。hrtimer在软件irq上下文中运行。

The OOPS information complains that msm_vibrator_power() calls _regulator_get() which uses mutex inside it.

OOPS信息抱怨msm_振动器_power()调用_regulator_get(),它在其中使用互斥。

The solution to this issue is: avoid to use any blocking/sleeping functions inside the hrtimer handler. That means to re-design the hrtimer handler, avoid to call mutex() kinds of blocking/sleeping functions.

这个问题的解决方案是:避免在hrtimer处理程序中使用任何阻塞/睡眠函数。这意味着要重新设计hrtimer处理程序,避免调用mutex()类型的阻塞/睡眠函数。