]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
platform/x86: lenovo-yogabook: Fix work race on remove()
authorHans de Goede <hdegoede@redhat.com>
Sun, 30 Apr 2023 16:57:50 +0000 (18:57 +0200)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:48 +0000 (17:19 +0200)
commit4f1752a7d431468da61b76f2ca47bb350f62030a
tree30c8858dd00db2681f4929e13fc1603696ce8362
parent66bf76243161c43ac2aa747c89ff2fe07849c138
platform/x86: lenovo-yogabook: Fix work race on remove()

BugLink: https://bugs.launchpad.net/bugs/2034469
[ Upstream commit 9148cd2eb4450a8e9c49c8a14201fb82f651128f ]

When yogabook_wmi_remove() runs yogabook_wmi_work might still be running
and using the devices which yogabook_wmi_remove() puts.

To avoid this move to explicitly cancelling the work rather then using
devm_work_autocancel().

This requires also making the yogabook_backside_hall_irq handler non
devm managed, so that it cannot re-queue the work while
yogabook_wmi_remove() runs.

Fixes: c0549b72d99d ("platform/x86: lenovo-yogabook-wmi: Add driver for Lenovo Yoga Book")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230430165807.472798-3-hdegoede@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/platform/x86/lenovo-yogabook-wmi.c