mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification
@ 2025-05-17  2:33 Mark Pearson
  2025-05-17 11:53 ` Hans de Goede
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Pearson @ 2025-05-17  2:33 UTC (permalink / raw)
  To: mpearson-lenovo
  Cc: hdegoede, ilpo.jarvinen, ibm-acpi-devel, platform-driver-x86,
	linux-kernel, Derek Barbosa

If user modifies the battery charge threshold an ACPI event is generated.
Confirmed with Lenovo FW team this is only generated on user event. As no
action is needed, ignore the event and prevent spurious kernel logs.

Reported-by: Derek Barbosa <debarbos@redhat.com>
Closes: https://lore.kernel.org/platform-driver-x86/7e9a1c47-5d9c-4978-af20-3949d53fb5dc@app.fastmail.com/T/#m5f5b9ae31d3fbf30d7d9a9d76c15fb3502dfd903
Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
---
 drivers/platform/x86/thinkpad_acpi.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 92b21e49faf6..657625dd60a0 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -231,6 +231,7 @@ enum tpacpi_hkey_event_t {
 	/* Thermal events */
 	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */
 	TP_HKEY_EV_ALARM_BAT_XHOT	= 0x6012, /* battery critically hot */
+	TP_HKEY_EV_ALARM_BAT_LIM_CHANGE	= 0x6013, /* battery charge limit changed*/
 	TP_HKEY_EV_ALARM_SENSOR_HOT	= 0x6021, /* sensor too hot */
 	TP_HKEY_EV_ALARM_SENSOR_XHOT	= 0x6022, /* sensor critically hot */
 	TP_HKEY_EV_THM_TABLE_CHANGED	= 0x6030, /* windows; thermal table changed */
@@ -3777,6 +3778,10 @@ static bool hotkey_notify_6xxx(const u32 hkey, bool *send_acpi_ev)
 		pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n");
 		/* recommended action: immediate sleep/hibernate */
 		break;
+	case TP_HKEY_EV_ALARM_BAT_LIM_CHANGE:
+		pr_debug("Battery Info: battery charge threshold changed\n");
+		/* User changed charging threshold. No action needed */
+		return true;
 	case TP_HKEY_EV_ALARM_SENSOR_HOT:
 		pr_crit("THERMAL ALARM: a sensor reports something is too hot!\n");
 		/* recommended action: warn user through gui, that */
-- 
2.43.0


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

* Re: [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification
  2025-05-17  2:33 [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification Mark Pearson
@ 2025-05-17 11:53 ` Hans de Goede
  2025-05-17 16:00 ` Armin Wolf
  2025-05-20 10:15 ` Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Hans de Goede @ 2025-05-17 11:53 UTC (permalink / raw)
  To: Mark Pearson
  Cc: ilpo.jarvinen, ibm-acpi-devel, platform-driver-x86, linux-kernel,
	Derek Barbosa

Hi,

On 17-May-25 04:33, Mark Pearson wrote:
> If user modifies the battery charge threshold an ACPI event is generated.
> Confirmed with Lenovo FW team this is only generated on user event. As no
> action is needed, ignore the event and prevent spurious kernel logs.
> 
> Reported-by: Derek Barbosa <debarbos@redhat.com>
> Closes: https://lore.kernel.org/platform-driver-x86/7e9a1c47-5d9c-4978-af20-3949d53fb5dc@app.fastmail.com/T/#m5f5b9ae31d3fbf30d7d9a9d76c15fb3502dfd903
> Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>  drivers/platform/x86/thinkpad_acpi.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 92b21e49faf6..657625dd60a0 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -231,6 +231,7 @@ enum tpacpi_hkey_event_t {
>  	/* Thermal events */
>  	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */
>  	TP_HKEY_EV_ALARM_BAT_XHOT	= 0x6012, /* battery critically hot */
> +	TP_HKEY_EV_ALARM_BAT_LIM_CHANGE	= 0x6013, /* battery charge limit changed*/
>  	TP_HKEY_EV_ALARM_SENSOR_HOT	= 0x6021, /* sensor too hot */
>  	TP_HKEY_EV_ALARM_SENSOR_XHOT	= 0x6022, /* sensor critically hot */
>  	TP_HKEY_EV_THM_TABLE_CHANGED	= 0x6030, /* windows; thermal table changed */
> @@ -3777,6 +3778,10 @@ static bool hotkey_notify_6xxx(const u32 hkey, bool *send_acpi_ev)
>  		pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n");
>  		/* recommended action: immediate sleep/hibernate */
>  		break;
> +	case TP_HKEY_EV_ALARM_BAT_LIM_CHANGE:
> +		pr_debug("Battery Info: battery charge threshold changed\n");
> +		/* User changed charging threshold. No action needed */
> +		return true;
>  	case TP_HKEY_EV_ALARM_SENSOR_HOT:
>  		pr_crit("THERMAL ALARM: a sensor reports something is too hot!\n");
>  		/* recommended action: warn user through gui, that */


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

* Re: [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification
  2025-05-17  2:33 [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification Mark Pearson
  2025-05-17 11:53 ` Hans de Goede
@ 2025-05-17 16:00 ` Armin Wolf
  2025-05-20 10:15 ` Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Armin Wolf @ 2025-05-17 16:00 UTC (permalink / raw)
  To: Mark Pearson
  Cc: hdegoede, ilpo.jarvinen, ibm-acpi-devel, platform-driver-x86,
	linux-kernel, Derek Barbosa

Am 17.05.25 um 04:33 schrieb Mark Pearson:

> If user modifies the battery charge threshold an ACPI event is generated.
> Confirmed with Lenovo FW team this is only generated on user event. As no
> action is needed, ignore the event and prevent spurious kernel logs.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>

Thanks,
Armin Wolf

> Reported-by: Derek Barbosa <debarbos@redhat.com>
> Closes: https://lore.kernel.org/platform-driver-x86/7e9a1c47-5d9c-4978-af20-3949d53fb5dc@app.fastmail.com/T/#m5f5b9ae31d3fbf30d7d9a9d76c15fb3502dfd903
> Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> ---
>   drivers/platform/x86/thinkpad_acpi.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index 92b21e49faf6..657625dd60a0 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -231,6 +231,7 @@ enum tpacpi_hkey_event_t {
>   	/* Thermal events */
>   	TP_HKEY_EV_ALARM_BAT_HOT	= 0x6011, /* battery too hot */
>   	TP_HKEY_EV_ALARM_BAT_XHOT	= 0x6012, /* battery critically hot */
> +	TP_HKEY_EV_ALARM_BAT_LIM_CHANGE	= 0x6013, /* battery charge limit changed*/
>   	TP_HKEY_EV_ALARM_SENSOR_HOT	= 0x6021, /* sensor too hot */
>   	TP_HKEY_EV_ALARM_SENSOR_XHOT	= 0x6022, /* sensor critically hot */
>   	TP_HKEY_EV_THM_TABLE_CHANGED	= 0x6030, /* windows; thermal table changed */
> @@ -3777,6 +3778,10 @@ static bool hotkey_notify_6xxx(const u32 hkey, bool *send_acpi_ev)
>   		pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n");
>   		/* recommended action: immediate sleep/hibernate */
>   		break;
> +	case TP_HKEY_EV_ALARM_BAT_LIM_CHANGE:
> +		pr_debug("Battery Info: battery charge threshold changed\n");
> +		/* User changed charging threshold. No action needed */
> +		return true;
>   	case TP_HKEY_EV_ALARM_SENSOR_HOT:
>   		pr_crit("THERMAL ALARM: a sensor reports something is too hot!\n");
>   		/* recommended action: warn user through gui, that */

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

* Re: [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification
  2025-05-17  2:33 [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification Mark Pearson
  2025-05-17 11:53 ` Hans de Goede
  2025-05-17 16:00 ` Armin Wolf
@ 2025-05-20 10:15 ` Ilpo Järvinen
  2 siblings, 0 replies; 4+ messages in thread
From: Ilpo Järvinen @ 2025-05-20 10:15 UTC (permalink / raw)
  To: Mark Pearson
  Cc: hdegoede, ibm-acpi-devel, platform-driver-x86, linux-kernel,
	Derek Barbosa

On Fri, 16 May 2025 22:33:37 -0400, Mark Pearson wrote:

> If user modifies the battery charge threshold an ACPI event is generated.
> Confirmed with Lenovo FW team this is only generated on user event. As no
> action is needed, ignore the event and prevent spurious kernel logs.
> 
> 


Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification
      commit: 29e4e6b4235fefa5930affb531fe449cac330a72

--
 i.


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

end of thread, other threads:[~2025-05-20 10:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-17  2:33 [PATCH] platform/x86: thinkpad_acpi: Ignore battery threshold change event notification Mark Pearson
2025-05-17 11:53 ` Hans de Goede
2025-05-17 16:00 ` Armin Wolf
2025-05-20 10:15 ` Ilpo Järvinen

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®