Re: [PATCH 4/8] platform/x86: thinkpad_acpi: update polling state in hotkey_user_mask_set()

From: Mark Pearson

Date: Thu Nov 26 2026 - 21:57:44 EST


On Wed, Nov 25, 2026, at 6:11 PM, Dmitry Torokhov wrote:
> hotkey_user_mask_set() is called from both hotkey_mask_store() (sysfs)
> and hotkey_write() (/proc/acpi/ibm/hotkey), but only hotkey_mask_store()
> called hotkey_poll_setup(true) afterwards. As a result, updating the
> hotkey mask through /proc/acpi/ibm/hotkey did not start or stop the
> NVRAM polling thread to match the new mask.
>
> Move the hotkey_poll_setup(true) call into hotkey_user_mask_set(),
> matching tpacpi_hotkey_driver_mask_set(), and drop the redundant #ifdef
> guard from hotkey_mask_store().
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> ---
> drivers/platform/x86/lenovo/thinkpad_acpi.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> index e5f78107bd1a..7a82a9014a3e 100644
> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
> @@ -2137,6 +2137,8 @@ static int hotkey_user_mask_set(const u32 mask)
> /* Enable the available bits in hotkey_user_mask */
> hotkey_user_mask = mask & (hotkey_acpi_mask | hotkey_source_mask);
>
> + hotkey_poll_setup(true);
> +
> return rc;
> }
>
> @@ -2647,10 +2649,6 @@ static ssize_t hotkey_mask_store(struct device *dev,
>
> res = hotkey_user_mask_set(t);
>
> -#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
> - hotkey_poll_setup(true);
> -#endif
> -
> tpacpi_disclose_usertask("hotkey_mask", "set to 0x%08lx\n", t);
>
> return (res) ? res : count;
>
> --
> 2.56.1.839.g22a8290db9-goog

Looks good to me.
Reviewed-by: Mark Pearson <mpearson-lenovo@xxxxxxxxx>
Mark