All of lore.kernel.org
 help / color / mirror / Atom feed
* [REGRESSION] thinkpad_acpi: probe deadlocks in hotkey_poll_setup() (next-20261008)
@ 2026-10-10  0:20 Oleksii Kryvenko
  2026-10-10  1:29 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksii Kryvenko @ 2026-10-10  0:20 UTC (permalink / raw)
  To: Ilpo Järvinen, Hans de Goede, Mark Pearson
  Cc: Oleksii Kryvenko, Dmitry Torokhov, Andrzej Pietrasiewicz,
	platform-driver-x86, regressions

From: Oleksii Kryvenko <diver.ua@gmail.com>

Hi,

On next-20261008, thinkpad_acpi hangs in probe on my ThinkPad
X9-15 Gen 1 (CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y):

  INFO: task (udev-worker):537 blocked for more than 120 seconds.
   __mutex_lock.constprop.0+0x569/0xa30
   hotkey_poll_setup+0x50/0x110 [thinkpad_acpi]
   hotkey_inputdev_open+0x36/0x50 [thinkpad_acpi]
   input_open_device+0xa7/0x170
   kbd_connect+0x73/0x90
   input_attach_handler.isra.0+0x6f/0x90
   input_register_device.cold+0xd5/0x16f
   tpacpi_pdriver_probe+0x442/0x4a0 [thinkpad_acpi]
  INFO: task (udev-worker):537 is blocked on a mutex likely owned by task (udev-worker):537.

The input core calls ->open() with dev->mutex held, and since
d6479c25ecef ("platform/x86: thinkpad_acpi: Use
input_device_enabled()") hotkey_poll_setup() takes that same mutex
again.

input_mutex stays held too, so later input devices block. The
machine hangs on shutdown, and the sound card fails to register:

  sof_sdw sof_sdw: ASoC: failed to register soundcard -4

Going back to the lockless check fixes it for me:

--- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
+++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
@@ -2542,10 +2542,9 @@

 	lockdep_assert_held(&hotkey_mutex);

-	guard(mutex)(&tpacpi_inputdev->mutex);
 	if (hotkey_poll_freq > 0 &&
 	    (poll_driver_mask ||
-	     (poll_user_mask && input_device_enabled(tpacpi_inputdev)))) {
+	     (poll_user_mask && READ_ONCE(tpacpi_inputdev->users) > 0))) {
 		if (!tpacpi_hotkey_task) {
 			tpacpi_hotkey_task = kthread_run(hotkey_kthread,
 					NULL, TPACPI_NVRAM_KTHREAD_NAME);

Happy to test a proper fix.

#regzbot introduced: d6479c25ecef

Thanks,
Oleksii

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-10  1:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-10  0:20 [REGRESSION] thinkpad_acpi: probe deadlocks in hotkey_poll_setup() (next-20261008) Oleksii Kryvenko
2026-10-10  1:29 ` Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.