]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
platform/x86: ideapad-laptop: add a mutex to synchronize VPC commands
authorGergo Koteles <soyer@irl.hu>
Thu, 25 Jul 2024 09:21:10 +0000 (11:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Aug 2024 04:05:39 +0000 (06:05 +0200)
commitd38574ff500b94c5e0f6dacdbab01b975a0e88fd
tree4c6cbe90dc5fe065cc2792f4509c8fcd60963793
parentfc6c6bb34f5dad28c1edba0625f1249f272a89b2
platform/x86: ideapad-laptop: add a mutex to synchronize VPC commands

[ Upstream commit 7cc06e729460a209b84d3db4db56c9f85f048cc2 ]

Calling VPC commands consists of several VPCW and VPCR ACPI calls.
These calls and their results can get mixed up if they are called
simultaneously from different threads, like acpi notify handler,
sysfs, debugfs, notification chain.

The commit e2ffcda16290 ("ACPI: OSL: Allow Notify () handlers to run on
all CPUs") made the race issues much worse than before it but some
races were possible even before that commit.

Add a mutex to synchronize VPC commands.

Fixes: e2ffcda16290 ("ACPI: OSL: Allow Notify () handlers to run on all CPUs")
Fixes: e82882cdd241 ("platform/x86: Add driver for Yoga Tablet Mode switch")
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://lore.kernel.org/r/f26782fa1194ad11ed5d9ba121a804e59b58b026.1721898747.git.soyer@irl.hu
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/platform/x86/ideapad-laptop.c