Re: [PATCH] platform/x86: tpacpi: Mark charging LEDs as safe

From: Henrique de Moraes Holschuh

Date: Sat Nov 07 2026 - 07:34:41 EST


Eh, I better voice something about this...

1. The EC does use the battery led for alarms, and it also has specific high urgency events when it thinks the thing will catch fire or going to forcefully cut power very soon, although this was a relatively later enhancement.

Thinkpad ACPI is supposed to log a critical warning and it should attempt to initiate a system shutdown (power off) if it ever receives battery emergency alerts. I was explicitly advised to do it this way by Lenovo bios engineering, in private, a long time ago.

2. Module parameters are the way I dealt with this kind of thing in the past, especially if they are not mutable at runtime. It is vastly better than debugfs for this kind of thing IMHO and the fan control was implemented that way.

But the default must be the safer behavior.

> OTOH, CONFIG_THINKPAD_ACPI_UNSAFE_LEDS should taint the kernel on the
> very beginning.

I don't think tainting makes sense as long as it is something you either have to compile for and a distro would never do so as a default, or something you need to load the module with an explicit parameter set. It will not cause system instability, unlike, say, poking around the EC registers directly.

A module parameter is a decent compromise IMO:
Debugfs is too reachable for userspace to mess with without actually doing an informed opt-in. People respect module parameters a lot more.

--
Henrique Holschuh