mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>,
	"Derek J . Clark" <derekjohn.clark@gmail.com>,
	"Rong Zhang" <i@rong.moe>, "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	ibm-acpi-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/8] platform/x86: thinkpad_acpi: update polling state in hotkey_user_mask_set()
Date: Thu, 26 Nov 2026 21:57:14 -0500	[thread overview]
Message-ID: <96ca0f67-1f62-41a3-a83a-1d70abf2e058@app.fastmail.com> (raw)
In-Reply-To: <20261125-thinkpad-acpi-hotkey-poll-v1-4-6dee57519c2e@gmail.com>

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@gmail.com>
> ---
>  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@squebb.ca>
Mark

  reply	other threads:[~2026-11-27  2:57 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25 23:11 [PATCH 0/8] platform/x86: thinkpad_acpi: clean up hotkey polling and locking Dmitry Torokhov
2026-11-25 23:11 ` [PATCH 1/8] platform/x86: thinkpad_acpi: remove early exit in hotkey_kthread() Dmitry Torokhov
2026-11-27  2:43   ` Mark Pearson
2026-11-25 23:11 ` [PATCH 2/8] platform/x86: thinkpad_acpi: drop dead -ENXIO check in hotkey_init() Dmitry Torokhov
2026-11-27  2:46   ` Mark Pearson
2026-11-25 23:11 ` [PATCH 3/8] platform/x86: thinkpad_acpi: simplify hotkey open/close and poll setup Dmitry Torokhov
2026-11-27  3:28   ` Mark Pearson
2026-11-25 23:11 ` [PATCH 4/8] platform/x86: thinkpad_acpi: update polling state in hotkey_user_mask_set() Dmitry Torokhov
2026-11-27  2:57   ` Mark Pearson [this message]
2026-11-25 23:11 ` [PATCH 5/8] platform/x86: thinkpad_acpi: use scoped_guard() for hotkey config locking Dmitry Torokhov
2026-11-27  3:01   ` Mark Pearson
2026-11-25 23:11 ` [PATCH 6/8] platform/x86: thinkpad_acpi: convert hotkey_thread_data_mutex to a spinlock Dmitry Torokhov
2026-11-27  3:35   ` Mark Pearson
2026-11-25 23:11 ` [PATCH 7/8] platform/x86: thinkpad_acpi: remove unused hotkey_poll_active flag Dmitry Torokhov
2026-11-27  3:02   ` Mark Pearson
2026-11-25 23:11 ` [PATCH 8/8] platform/x86: thinkpad_acpi: drop redundant input device parent assignment Dmitry Torokhov
2026-11-27  3:05   ` Mark Pearson
2026-11-27 13:25 ` [PATCH 0/8] platform/x86: thinkpad_acpi: clean up hotkey polling and locking Rong Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=96ca0f67-1f62-41a3-a83a-1d70abf2e058@app.fastmail.com \
    --to=mpearson-lenovo@squebb.ca \
    --cc=derekjohn.clark@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=hansg@kernel.org \
    --cc=hmh@hmh.eng.br \
    --cc=i@rong.moe \
    --cc=ibm-acpi-devel@lists.sourceforge.net \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®