* [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() @ 2026-08-05 4:03 Dmitry Torokhov 2026-08-05 14:51 ` Mark Pearson 2026-09-15 11:32 ` Ilpo Järvinen 0 siblings, 2 replies; 9+ messages in thread From: Dmitry Torokhov @ 2026-08-05 4:03 UTC (permalink / raw) To: Mark Pearson, Derek J. Clark Cc: Henrique de Moraes Holschuh, Hans de Goede, Ilpo Järvinen, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel From: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Use the new helper. Inspecting input device's 'users' member needs to be done under device's mutex, so add appropriate invocations. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Link: https://lore.kernel.org/r/20200608112211.12125-7-andrzej.p@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- Not sure how this got stuck in my patch queue but it is still valid... drivers/platform/x86/lenovo/thinkpad_acpi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c index 445e1403308e..f8e116e8a65d 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -2547,9 +2547,10 @@ static void hotkey_poll_setup(const bool may_warn) lockdep_assert_held(&hotkey_mutex); + mutex_lock(&tpacpi_inputdev->mutex); if (hotkey_poll_freq > 0 && (poll_driver_mask || - (poll_user_mask && tpacpi_inputdev->users > 0))) { + (poll_user_mask && input_device_enabled(tpacpi_inputdev)))) { if (!tpacpi_hotkey_task) { tpacpi_hotkey_task = kthread_run(hotkey_kthread, NULL, TPACPI_NVRAM_KTHREAD_NAME); @@ -2566,6 +2567,7 @@ static void hotkey_poll_setup(const bool may_warn) poll_user_mask, poll_driver_mask); } } + mutex_unlock(&tpacpi_inputdev->mutex); } static void hotkey_poll_setup_safe(const bool may_warn) -- 2.55.0.571.g244d577d93-goog -- Dmitry ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-08-05 4:03 [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() Dmitry Torokhov @ 2026-08-05 14:51 ` Mark Pearson 2026-08-05 15:52 ` Dmitry Torokhov 2026-09-15 11:32 ` Ilpo Järvinen 1 sibling, 1 reply; 9+ messages in thread From: Mark Pearson @ 2026-08-05 14:51 UTC (permalink / raw) To: Dmitry Torokhov, Derek J . Clark Cc: Henrique de Moraes Holschuh, Hans de Goede, Ilpo Järvinen, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel On Wed, Aug 5, 2026, at 12:03 AM, Dmitry Torokhov wrote: > From: Andrzej Pietrasiewicz <andrzej.p@collabora.com> > > Use the new helper. Inspecting input device's 'users' member needs to be > done under device's mutex, so add appropriate invocations. > > Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> > Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> > Link: https://lore.kernel.org/r/20200608112211.12125-7-andrzej.p@collabora.com > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > > Not sure how this got stuck in my patch queue but it is still valid... > > drivers/platform/x86/lenovo/thinkpad_acpi.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c > b/drivers/platform/x86/lenovo/thinkpad_acpi.c > index 445e1403308e..f8e116e8a65d 100644 > --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c > +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c > @@ -2547,9 +2547,10 @@ static void hotkey_poll_setup(const bool > may_warn) > > lockdep_assert_held(&hotkey_mutex); > > + mutex_lock(&tpacpi_inputdev->mutex); > if (hotkey_poll_freq > 0 && > (poll_driver_mask || > - (poll_user_mask && tpacpi_inputdev->users > 0))) { > + (poll_user_mask && input_device_enabled(tpacpi_inputdev)))) { > if (!tpacpi_hotkey_task) { > tpacpi_hotkey_task = kthread_run(hotkey_kthread, > NULL, TPACPI_NVRAM_KTHREAD_NAME); > @@ -2566,6 +2567,7 @@ static void hotkey_poll_setup(const bool may_warn) > poll_user_mask, poll_driver_mask); > } > } > + mutex_unlock(&tpacpi_inputdev->mutex); > } > > static void hotkey_poll_setup_safe(const bool may_warn) > -- Looks good to me. Only note is that can you use guard(mutex)(&tpacpi_inputdev->mutex) instead of the lock/unlock? I think that's preferred these days. Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca> ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-08-05 14:51 ` Mark Pearson @ 2026-08-05 15:52 ` Dmitry Torokhov 2026-08-05 16:15 ` Mark Pearson 0 siblings, 1 reply; 9+ messages in thread From: Dmitry Torokhov @ 2026-08-05 15:52 UTC (permalink / raw) To: Mark Pearson Cc: Derek J . Clark, Henrique de Moraes Holschuh, Hans de Goede, Ilpo Järvinen, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel Hi Mark, On Wed, Aug 05, 2026 at 10:51:53AM -0400, Mark Pearson wrote: > > > On Wed, Aug 5, 2026, at 12:03 AM, Dmitry Torokhov wrote: > > From: Andrzej Pietrasiewicz <andrzej.p@collabora.com> > > > > Use the new helper. Inspecting input device's 'users' member needs to be > > done under device's mutex, so add appropriate invocations. > > > > Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> > > Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> > > Link: https://lore.kernel.org/r/20200608112211.12125-7-andrzej.p@collabora.com > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > > --- > > > > Not sure how this got stuck in my patch queue but it is still valid... > > > > drivers/platform/x86/lenovo/thinkpad_acpi.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c > > b/drivers/platform/x86/lenovo/thinkpad_acpi.c > > index 445e1403308e..f8e116e8a65d 100644 > > --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c > > +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c > > @@ -2547,9 +2547,10 @@ static void hotkey_poll_setup(const bool > > may_warn) > > > > lockdep_assert_held(&hotkey_mutex); > > > > + mutex_lock(&tpacpi_inputdev->mutex); > > if (hotkey_poll_freq > 0 && > > (poll_driver_mask || > > - (poll_user_mask && tpacpi_inputdev->users > 0))) { > > + (poll_user_mask && input_device_enabled(tpacpi_inputdev)))) { > > if (!tpacpi_hotkey_task) { > > tpacpi_hotkey_task = kthread_run(hotkey_kthread, > > NULL, TPACPI_NVRAM_KTHREAD_NAME); > > @@ -2566,6 +2567,7 @@ static void hotkey_poll_setup(const bool may_warn) > > poll_user_mask, poll_driver_mask); > > } > > } > > + mutex_unlock(&tpacpi_inputdev->mutex); > > } > > > > static void hotkey_poll_setup_safe(const bool may_warn) > > -- > > Looks good to me. > > Only note is that can you use guard(mutex)(&tpacpi_inputdev->mutex) instead of the lock/unlock? I think that's preferred these days. If that is desired the whole driver needs converting. I can do it in a separate patch(es) if you want. > > Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca> Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-08-05 15:52 ` Dmitry Torokhov @ 2026-08-05 16:15 ` Mark Pearson 2026-08-06 6:20 ` Dmitry Torokhov 0 siblings, 1 reply; 9+ messages in thread From: Mark Pearson @ 2026-08-05 16:15 UTC (permalink / raw) To: Dmitry Torokhov Cc: Derek J . Clark, Henrique de Moraes Holschuh, Hans de Goede, Ilpo Järvinen, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel On Wed, Aug 5, 2026, at 11:52 AM, Dmitry Torokhov wrote: > Hi Mark, > > On Wed, Aug 05, 2026 at 10:51:53AM -0400, Mark Pearson wrote: >> >> >> On Wed, Aug 5, 2026, at 12:03 AM, Dmitry Torokhov wrote: >> > From: Andrzej Pietrasiewicz <andrzej.p@collabora.com> >> > >> > Use the new helper. Inspecting input device's 'users' member needs to be >> > done under device's mutex, so add appropriate invocations. >> > >> > Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> >> > Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> >> > Link: https://lore.kernel.org/r/20200608112211.12125-7-andrzej.p@collabora.com >> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> >> > --- >> > >> > Not sure how this got stuck in my patch queue but it is still valid... >> > >> > drivers/platform/x86/lenovo/thinkpad_acpi.c | 4 +++- >> > 1 file changed, 3 insertions(+), 1 deletion(-) >> > >> > diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c >> > b/drivers/platform/x86/lenovo/thinkpad_acpi.c >> > index 445e1403308e..f8e116e8a65d 100644 >> > --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c >> > +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c >> > @@ -2547,9 +2547,10 @@ static void hotkey_poll_setup(const bool >> > may_warn) >> > >> > lockdep_assert_held(&hotkey_mutex); >> > >> > + mutex_lock(&tpacpi_inputdev->mutex); >> > if (hotkey_poll_freq > 0 && >> > (poll_driver_mask || >> > - (poll_user_mask && tpacpi_inputdev->users > 0))) { >> > + (poll_user_mask && input_device_enabled(tpacpi_inputdev)))) { >> > if (!tpacpi_hotkey_task) { >> > tpacpi_hotkey_task = kthread_run(hotkey_kthread, >> > NULL, TPACPI_NVRAM_KTHREAD_NAME); >> > @@ -2566,6 +2567,7 @@ static void hotkey_poll_setup(const bool may_warn) >> > poll_user_mask, poll_driver_mask); >> > } >> > } >> > + mutex_unlock(&tpacpi_inputdev->mutex); >> > } >> > >> > static void hotkey_poll_setup_safe(const bool may_warn) >> > -- >> >> Looks good to me. >> >> Only note is that can you use guard(mutex)(&tpacpi_inputdev->mutex) instead of the lock/unlock? I think that's preferred these days. > > If that is desired the whole driver needs converting. I can do it in a > separate patch(es) if you want. > Ah - good point. Not worth it for this IMO, unless the more experienced maintainers have a strong opinion :) Mark ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-08-05 16:15 ` Mark Pearson @ 2026-08-06 6:20 ` Dmitry Torokhov 0 siblings, 0 replies; 9+ messages in thread From: Dmitry Torokhov @ 2026-08-06 6:20 UTC (permalink / raw) To: Mark Pearson Cc: Derek J . Clark, Henrique de Moraes Holschuh, Hans de Goede, Ilpo Järvinen, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel On Wed, Aug 05, 2026 at 12:15:27PM -0400, Mark Pearson wrote: > > > On Wed, Aug 5, 2026, at 11:52 AM, Dmitry Torokhov wrote: > > Hi Mark, > > > > On Wed, Aug 05, 2026 at 10:51:53AM -0400, Mark Pearson wrote: > >> > >> > >> On Wed, Aug 5, 2026, at 12:03 AM, Dmitry Torokhov wrote: > >> > From: Andrzej Pietrasiewicz <andrzej.p@collabora.com> > >> > > >> > Use the new helper. Inspecting input device's 'users' member needs to be > >> > done under device's mutex, so add appropriate invocations. > >> > > >> > Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> > >> > Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> > >> > Link: https://lore.kernel.org/r/20200608112211.12125-7-andrzej.p@collabora.com > >> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > >> > --- > >> > > >> > Not sure how this got stuck in my patch queue but it is still valid... > >> > > >> > drivers/platform/x86/lenovo/thinkpad_acpi.c | 4 +++- > >> > 1 file changed, 3 insertions(+), 1 deletion(-) > >> > > >> > diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c > >> > b/drivers/platform/x86/lenovo/thinkpad_acpi.c > >> > index 445e1403308e..f8e116e8a65d 100644 > >> > --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c > >> > +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c > >> > @@ -2547,9 +2547,10 @@ static void hotkey_poll_setup(const bool > >> > may_warn) > >> > > >> > lockdep_assert_held(&hotkey_mutex); > >> > > >> > + mutex_lock(&tpacpi_inputdev->mutex); > >> > if (hotkey_poll_freq > 0 && > >> > (poll_driver_mask || > >> > - (poll_user_mask && tpacpi_inputdev->users > 0))) { > >> > + (poll_user_mask && input_device_enabled(tpacpi_inputdev)))) { > >> > if (!tpacpi_hotkey_task) { > >> > tpacpi_hotkey_task = kthread_run(hotkey_kthread, > >> > NULL, TPACPI_NVRAM_KTHREAD_NAME); > >> > @@ -2566,6 +2567,7 @@ static void hotkey_poll_setup(const bool may_warn) > >> > poll_user_mask, poll_driver_mask); > >> > } > >> > } > >> > + mutex_unlock(&tpacpi_inputdev->mutex); > >> > } > >> > > >> > static void hotkey_poll_setup_safe(const bool may_warn) > >> > -- > >> > >> Looks good to me. > >> > >> Only note is that can you use guard(mutex)(&tpacpi_inputdev->mutex) instead of the lock/unlock? I think that's preferred these days. > > > > If that is desired the whole driver needs converting. I can do it in a > > separate patch(es) if you want. > > > Ah - good point. Not worth it for this IMO, unless the more experienced maintainers have a strong opinion :) Well, I went and did it anyways in case you want to apply it. Thanks. -- Dmitry ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-08-05 4:03 [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() Dmitry Torokhov 2026-08-05 14:51 ` Mark Pearson @ 2026-09-15 11:32 ` Ilpo Järvinen 2026-09-30 7:58 ` Ali Ahmet Memiş 1 sibling, 1 reply; 9+ messages in thread From: Ilpo Järvinen @ 2026-09-15 11:32 UTC (permalink / raw) To: Mark Pearson, Derek J. Clark, Dmitry Torokhov Cc: Henrique de Moraes Holschuh, Hans de Goede, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel On Tue, 04 Aug 2026 21:03:36 -0700, Dmitry Torokhov wrote: > Use the new helper. Inspecting input device's 'users' member needs to be > done under device's mutex, so add appropriate invocations. Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while. FYI [if applicable to your patch], as per Linus' policy change, also fixes are mostly routed through for-next unless the fix is for a commit introduced in the most recent cycle or is clearly a regression fix. The list of commits applied: [1/1] platform/x86: thinkpad_acpi: Use input_device_enabled() commit: be0048786d53375fa4eace15cfdf65593956a1a2 -- i. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-09-15 11:32 ` Ilpo Järvinen @ 2026-09-30 7:58 ` Ali Ahmet Memiş 2026-09-30 19:37 ` Dmitry Torokhov 0 siblings, 1 reply; 9+ messages in thread From: Ali Ahmet Memiş @ 2026-09-30 7:58 UTC (permalink / raw) To: Ilpo Järvinen, Dmitry Torokhov Cc: Mark Pearson, Derek J. Clark, Henrique de Moraes Holschuh, Hans de Goede, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel On Tue, Sep 15, 2026 at 02:32:34PM +0300, Ilpo Järvinen wrote: > [1/1] platform/x86: thinkpad_acpi: Use input_device_enabled() > commit: be0048786d53375fa4eace15cfdf65593956a1a2 This hangs on module load for me. hotkey_inputdev_open() gets called from input_open_device() with dev->mutex already held, so the new lock in hotkey_poll_setup() deadlocks: INFO: task insmod:28182 is blocked on a mutex likely owned by task insmod:28182. hotkey_poll_setup+0x50/0x140 [thinkpad_acpi] hotkey_inputdev_open+0x36/0x50 [thinkpad_acpi] input_open_device+0x9d/0x130 kbd_connect+0x8f/0xb0 I guess hotkey_inputdev_close() has the same issue. This was next-20260929's thinkpad_acpi.c built against 7.1.11. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-09-30 7:58 ` Ali Ahmet Memiş @ 2026-09-30 19:37 ` Dmitry Torokhov 2026-09-30 20:00 ` Ali Ahmet Memiş 0 siblings, 1 reply; 9+ messages in thread From: Dmitry Torokhov @ 2026-09-30 19:37 UTC (permalink / raw) To: Ali Ahmet Memiş Cc: Ilpo Järvinen, Mark Pearson, Derek J. Clark, Henrique de Moraes Holschuh, Hans de Goede, Nitin Joshi, Andrzej Pietrasiewicz, platform-driver-x86, ibm-acpi-devel, linux-kernel On Wed, Sep 30, 2026 at 10:58:29AM +0300, Ali Ahmet Memiş wrote: > On Tue, Sep 15, 2026 at 02:32:34PM +0300, Ilpo Järvinen wrote: > > [1/1] platform/x86: thinkpad_acpi: Use input_device_enabled() > > commit: be0048786d53375fa4eace15cfdf65593956a1a2 > > This hangs on module load for me. hotkey_inputdev_open() gets > called from input_open_device() with dev->mutex already held, so the > new lock in hotkey_poll_setup() deadlocks: > > INFO: task insmod:28182 is blocked on a mutex likely owned by task insmod:28182. > hotkey_poll_setup+0x50/0x140 [thinkpad_acpi] > hotkey_inputdev_open+0x36/0x50 [thinkpad_acpi] > input_open_device+0x9d/0x130 > kbd_connect+0x8f/0xb0 > > I guess hotkey_inputdev_close() has the same issue. This was > next-20260929's thinkpad_acpi.c built against 7.1.11. Hmm, indeed. I wonder if below will fox this for you. -- Dmitry platform/x86: thinkpad_acpi: fix deadlock in hotkey input open/close Commit d6479c25ecef ("platform/x86: thinkpad_acpi: Use input_device_enabled()") changed hotkey_poll_setup() to acquire tpacpi_inputdev->mutex and call input_device_enabled(tpacpi_inputdev). However, the input core already holds dev->mutex when invoking a device's open() and close() callbacks. Because hotkey_inputdev_open() and hotkey_inputdev_close() call into hotkey_poll_setup(), attempting to acquire tpacpi_inputdev->mutex again results in an immediate self-deadlock. Additionally, locking tpacpi_inputdev->mutex inside hotkey_poll_setup() while holding hotkey_mutex introduces an ABBA lock ordering inversion with hotkey_inputdev_open() and hotkey_inputdev_close(), which acquire hotkey_mutex while holding tpacpi_inputdev->mutex. Finally, input_inhibit_device() calls dev->close() before setting dev->inhibited, so input_device_enabled() still returns true inside hotkey_inputdev_close(). Track whether the input device is active in a driver-local boolean protected by hotkey_mutex instead of locking tpacpi_inputdev->mutex and querying input_device_enabled(). Fixes: d6479c25ecef ("platform/x86: thinkpad_acpi: Use input_device_enabled()") Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/platform/x86/lenovo/thinkpad_acpi.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c index 1225b01ed14d..40e9763a12f8 100644 --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c @@ -1887,6 +1887,7 @@ static u32 hotkey_reserved_mask; /* events better left disabled */ static u32 hotkey_driver_mask; /* events needed by the driver */ static u32 hotkey_user_mask; /* events visible to userspace */ static u32 hotkey_acpi_mask; /* events enabled in firmware */ +static bool hotkey_input_enabled; static bool tpacpi_driver_event(const unsigned int hkey_event); static void hotkey_poll_setup(const bool may_warn); @@ -2544,10 +2545,8 @@ static void hotkey_poll_setup(const bool may_warn) 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_driver_mask || (poll_user_mask && hotkey_input_enabled))) { if (!tpacpi_hotkey_task) { tpacpi_hotkey_task = kthread_run(hotkey_kthread, NULL, TPACPI_NVRAM_KTHREAD_NAME); @@ -2602,7 +2601,10 @@ static int hotkey_inputdev_open(struct input_dev *dev) switch (tpacpi_lifecycle) { case TPACPI_LIFE_INIT: case TPACPI_LIFE_RUNNING: - hotkey_poll_setup_safe(false); + scoped_guard(mutex, &hotkey_mutex) { + hotkey_input_enabled = true; + hotkey_poll_setup(false); + } return 0; case TPACPI_LIFE_EXITING: return -EBUSY; @@ -2615,10 +2617,14 @@ static int hotkey_inputdev_open(struct input_dev *dev) static void hotkey_inputdev_close(struct input_dev *dev) { + guard(mutex)(&hotkey_mutex); + + hotkey_input_enabled = false; + /* disable hotkey polling when possible */ if (tpacpi_lifecycle != TPACPI_LIFE_EXITING && !(hotkey_source_mask & hotkey_driver_mask)) - hotkey_poll_setup_safe(false); + hotkey_poll_setup(false); } /* sysfs hotkey enable ------------------------------------------------- */ -- 2.56.0.rc1.315.gc6ed9934b7-goog ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() 2026-09-30 19:37 ` Dmitry Torokhov @ 2026-09-30 20:00 ` Ali Ahmet Memiş 0 siblings, 0 replies; 9+ messages in thread From: Ali Ahmet Memiş @ 2026-09-30 20:00 UTC (permalink / raw) To: Dmitry Torokhov Cc: Ilpo Järvinen, Mark Pearson, Derek J. Clark, Henrique de Moraes Holschuh, Hans de Goede, Nitin Joshi, platform-driver-x86, ibm-acpi-devel, linux-kernel On Wed, Sep 30, 2026 at 12:37:54PM -0700, Dmitry Torokhov wrote: > Hmm, indeed. I wonder if below will fox this for you. Yes, it loads fine now. I also toggled inhibited on the input device with polling enabled, and the nvram thread stops and starts again as expected. Tested-by: Ali Ahmet Memiş <aliamemis@disroot.org> ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-09-30 20:01 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-08-05 4:03 [PATCH] platform/x86: thinkpad_acpi: Use input_device_enabled() Dmitry Torokhov 2026-08-05 14:51 ` Mark Pearson 2026-08-05 15:52 ` Dmitry Torokhov 2026-08-05 16:15 ` Mark Pearson 2026-08-06 6:20 ` Dmitry Torokhov 2026-09-15 11:32 ` Ilpo Järvinen 2026-09-30 7:58 ` Ali Ahmet Memiş 2026-09-30 19:37 ` Dmitry Torokhov 2026-09-30 20:00 ` Ali Ahmet Memiş
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®