]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
connector/cn_proc: Protect send_msg() with a local lock
authorMike Galbraith <umgwanakikbuti@gmail.com>
Wed, 27 May 2020 20:11:17 +0000 (22:11 +0200)
committerIngo Molnar <mingo@kernel.org>
Thu, 28 May 2020 08:31:10 +0000 (10:31 +0200)
commit3e92fd7bd2b8418b53cb7304855b8b69bedbe2b4
tree927d18b1edc42b24367726fbdeea650e5b182149
parentfd56200a16c72c7c3ec3e54e06160dfaa5b8dee8
connector/cn_proc: Protect send_msg() with a local lock

send_msg() disables preemption to avoid out-of-order messages. As the
code inside the preempt disabled section acquires regular spinlocks,
which are converted to 'sleeping' spinlocks on a PREEMPT_RT kernel and
eventually calls into a memory allocator, this conflicts with the RT
semantics.

Convert it to a local_lock which allows RT kernels to substitute them with
a real per CPU lock. On non RT kernels this maps to preempt_disable() as
before. No functional change.

[bigeasy: Patch description]

Signed-off-by: Mike Galbraith <umgwanakikbuti@gmail.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20200527201119.1692513-6-bigeasy@linutronix.de
drivers/connector/cn_proc.c