mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mark Pearson" <mpearson-lenovo@squebb.ca>
To: "Rong Zhang" <i@rong.moe>,
	"Qiling Zhu" <kmatzkaczor244@gmail.com>,
	"Derek J . Clark" <derekjohn.clark@gmail.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Henrique de Moraes Holschuh" <hmh@hmh.eng.br>
Cc: "Andrea Rabbaglietti" <rabbagliettiandrea@gmail.com>,
	"Lee Jones" <lee@kernel.org>, "Pavel Machek" <pavel@kernel.org>,
	"Griffin Kroah-Hartman" <griffin@kroah.com>,
	"Vishnu Sankar" <vishnuocv@gmail.com>,
	"Vishnu Sankar" <vsankar@lenovo.com>,
	"platform-driver-x86@vger.kernel.org"
	<platform-driver-x86@vger.kernel.org>,
	ibm-acpi-devel@lists.sourceforge.net, linux-leds@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 7/7] platform/x86: thinkpad_acpi: Reconcile EC level on resume
Date: Sun, 15 Nov 2026 17:11:25 -0500	[thread overview]
Message-ID: <8184c823-eb90-4b71-9892-4e8eeec143fd@app.fastmail.com> (raw)
In-Reply-To: <0cd54ba6673168ed2f6542d31c03a02f467a416a.camel@rong.moe>



On Sun, Nov 15, 2026, at 3:20 AM, Rong Zhang wrote:
> Hi Qiling,
>
> On Sun, 2026-11-15 at 01:48 +0800, Qiling Zhu wrote:
>> The firmware does not always restore the keyboard backlight level across
>> sleep: after hibernation from auto mode the EC comes back with the
>> backlight off, without emitting a notification.  The cached level and a
>> possibly still-active auto trigger then desynchronize from the hardware
>> until the next user action.
>> 
>> Check the EC level on resume on auto-mode machines and route it through
>> the regular notification path, which also deactivates the auto trigger
>> if the firmware left auto mode.
>> 
>> Signed-off-by: Qiling Zhu <kmatzkaczor244@gmail.com>
>> ---
>>  drivers/platform/x86/lenovo/thinkpad_acpi.c | 11 ++++++++++-
>>  1 file changed, 10 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/platform/x86/lenovo/thinkpad_acpi.c b/drivers/platform/x86/lenovo/thinkpad_acpi.c
>> index f11e61417..802e0d53b 100644
>> --- a/drivers/platform/x86/lenovo/thinkpad_acpi.c
>> +++ b/drivers/platform/x86/lenovo/thinkpad_acpi.c
>> @@ -5395,13 +5395,22 @@ static void kbdlight_suspend(void)
>>  	led_classdev_suspend(led_cdev);
>>  }
>>  
>> +static void kbdlight_notify_change(void);
>
> Nooooo. Add it to the right position in PATCH 2.
>
>> +
>>  static void kbdlight_resume(void)
>>  {
>>  	if (!tp_features.kbdlight)
>>  		return;
>>  
>> -	if (tp_features.kbdlight_auto)
>> +	if (tp_features.kbdlight_auto) {
>> +		/*
>> +		 * The firmware may not restore auto mode: after hibernation
>> +		 * from level 3 it comes back with the backlight off.  Check
>> +		 * the EC level and reconcile.
>> +		 */
>> +		kbdlight_notify_change();
>
> If the LED core doesn't detach the trigger before hibernation, please
> restore the last hw brightness instead of notifying any change.
>
> If using led_classdev_{suspend,resume}() causes pain when it comes to hw
> control trigger, we can get rid of them completely (i.e., on all models)
> by tracking the suspend status and restoring hw brightness properly
> ourselves. With your previous changes to kbdlight_brightness, doing so
> should be easy.
>
I was wondering the same. I can bet we'll end up with FW 'bugs' where some platforms don't put it back as they should.
I'll get those fixed whenever possible....but I'm thinking maybe if we just check/set in SW anyway that's not a bad thing.

Mark

  reply	other threads:[~2026-11-15 22:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 10:01 [RFC PATCH 0/1] platform/x86: thinkpad_acpi: Add support for auto keyboard backlight Qiling Zhu
2026-11-01 10:01 ` [RFC PATCH 1/1] " Qiling Zhu
2026-11-01 18:24   ` Rong Zhang
2026-11-01 17:57 ` [RFC PATCH 0/1] " Rong Zhang
2026-11-04  4:57   ` Vishnu Sankar
2026-11-02 15:10 ` [RFC PATCH v2 0/2] " Qiling Zhu
2026-11-02 15:10   ` [RFC PATCH v2 1/2] platform/x86: thinkpad_acpi: Extract kbdlight_notify_change() helper Qiling Zhu
2026-11-02 15:10   ` [RFC PATCH v2 2/2] platform/x86: thinkpad_acpi: Add support for auto keyboard backlight Qiling Zhu
2026-11-02 18:32     ` Rong Zhang
2026-11-02 18:13   ` [RFC PATCH v2 0/2] " Rong Zhang
2026-11-05 13:18     ` Qiling Zhu
2026-11-14 17:48   ` [PATCH v3 0/7] platform/x86: thinkpad_acpi: " Qiling Zhu
2026-11-14 17:48     ` [PATCH v3 1/7] platform/x86: thinkpad_acpi: Report auto keyboard backlight mode as off Qiling Zhu
2026-11-15  7:53       ` Rong Zhang
2026-11-15 21:58         ` Mark Pearson
2026-11-14 17:48     ` [PATCH v3 2/7] platform/x86: thinkpad_acpi: Extract kbdlight_notify_change() helpers Qiling Zhu
2026-11-15  7:53       ` Rong Zhang
2026-11-14 17:48     ` [PATCH v3 3/7] platform/x86: thinkpad_acpi: Sync LED core state on level writes Qiling Zhu
2026-11-15  8:05       ` Rong Zhang
2026-11-14 17:48     ` [PATCH v3 4/7] platform/x86: thinkpad_acpi: Detect auto-mode capability via MLCG Qiling Zhu
2026-11-15  8:05       ` Rong Zhang
2026-11-15 22:06       ` Mark Pearson
2026-11-14 17:48     ` [PATCH v3 5/7] platform/x86: thinkpad_acpi: Skip LED suspend/resume on auto-mode machines Qiling Zhu
2026-11-15 22:08       ` Mark Pearson
2026-11-14 17:48     ` [PATCH v3 6/7] platform/x86: thinkpad_acpi: Add support for auto keyboard backlight Qiling Zhu
2026-11-15  8:17       ` Rong Zhang
2026-11-14 17:48     ` [PATCH v3 7/7] platform/x86: thinkpad_acpi: Reconcile EC level on resume Qiling Zhu
2026-11-15  8:20       ` Rong Zhang
2026-11-15 22:11         ` Mark Pearson [this message]
2026-11-15  7:52     ` [PATCH v3 0/7] platform/x86: thinkpad_acpi: Add support for auto keyboard backlight 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=8184c823-eb90-4b71-9892-4e8eeec143fd@app.fastmail.com \
    --to=mpearson-lenovo@squebb.ca \
    --cc=derekjohn.clark@gmail.com \
    --cc=griffin@kroah.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=kmatzkaczor244@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rabbagliettiandrea@gmail.com \
    --cc=vishnuocv@gmail.com \
    --cc=vsankar@lenovo.com \
    /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®