mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
a78b174c2fb699be11006e43557137b8e602cfdc
The following trace can be seen if usb is connecting to Host while do rockchip_chg_detect_work. DEBUG_LOCKS_WARN_ON(rt_mutex_owner(lock) != current) WARNING: CPU: 6 PID: 512 at kernel/locking/rtmutex-debug.c:47 debug_rt_mutex_unlock+0x58/0x64 Modules linked in: CPU: 6 PID: 512 Comm: kworker/6:3 Not tainted 5.10.226-rt89 #186 Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT) Workqueue: events rockchip_chg_detect_work pstate: 60c00089 (nZCv daIf +PAN +UAO -TCO BTYPE=--) pc : debug_rt_mutex_unlock+0x58/0x64 lr : debug_rt_mutex_unlock+0x58/0x64 ...... Call trace: debug_rt_mutex_unlock+0x58/0x64 __rt_mutex_unlock+0x48/0xf8 _mutex_unlock+0xc/0x14 rockchip_chg_detect_work+0x44c/0x6f0 process_one_work+0x1bc/0x27c worker_thread+0x268/0x488 kthread+0x170/0x210 ret_from_fork+0x10/0x18 This issue can cause the preempt-rt Linux kernel to crash. The reason is that all mutexes in preempt-rt have been replaced with rt_mutexes. An rt_mutex has a PI (Priority Inversion) feature, which means that when a high-priority task waits for a lock held by a low-priority task, the priority of the low-priority task is elevated. A linked list is established on p->pi_waiters. This requires that lock/unlock operations be handled by the same task. If unlock is performed and pi_waiters is released by another task, the task that holds the lock will encounter an exception when accessing pi_waiters. When executing rockchip_chg_detect_work, a schedule_delayed_work operation is performed while holding the mutex lock, causing the mutex lock to be released by a different worker task, which triggers a kernel panic. This patch use kthread_work instead of delayed_work to avoid long-running chg work affecting other tasks in the system workqueue. And also avoid chg work to be scheduled while hold a mutex lock. Signed-off-by: William Wu <william.wu@rock-chips.com> Change-Id: I1e49a22f002b0dfcf0e04d243d99624d34c9a701
…
Merge tag 'mm-hotfixes-stable-2022-12-10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
…
…
…
…
Linux kernel
============
There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.
In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``. The formatted documentation can also be read online at:
https://www.kernel.org/doc/html/latest/
There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.
Description
Languages
C
97.7%
Assembly
1.6%
Makefile
0.3%
Perl
0.1%