* [PATCH] platform/loongarch: laptop: explicitly reset the bl_powered state when resuming
@ 2026-07-22 4:44 liushuyu
2026-07-22 12:51 ` Huacai Chen
2026-07-22 16:39 ` Yao Zi
0 siblings, 2 replies; 3+ messages in thread
From: liushuyu @ 2026-07-22 4:44 UTC (permalink / raw)
To: linux-kernel, Huacai Chen, Jianmin Lv, WANG Xuerui, Yao Zi
Cc: loongarch, Mingcong Bai, Kexy Biscuit, Zixing Liu, stable
From: Zixing Liu <liushuyu@aosc.io>
On EAECIS NL60R with EC firmware version 1.11, resuming from S3 has a very
high chance (>= 90%) of causing the EC to lose the previous backlight
power state. When this happens, the laptop resumes normally from S3, but
the backlight remains off (when shining on the screen with a flash light,
we can see the screen contents are updating normally).
Since there is no generic way to query the EC's backlight state on
Loongson laptop platforms, assume the worst-case scenario and restart the
backlight power inside the kernel each time the system resumes.
Cc: stable@vger.kernel.org
Fixes: 53c762b47f72 ("platform/loongarch: laptop: Add backlight power control support")
Signed-off-by: Zixing Liu <liushuyu@aosc.io>
---
drivers/platform/loongarch/loongson-laptop.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/loongarch/loongson-laptop.c b/drivers/platform/loongarch/loongson-laptop.c
index 61b18ac206c9e..742a585b0647c 100644
--- a/drivers/platform/loongarch/loongson-laptop.c
+++ b/drivers/platform/loongarch/loongson-laptop.c
@@ -200,6 +200,7 @@ static int loongson_hotkey_resume(struct device *dev)
bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
if (bd) {
+ bl_powered = false;
loongson_laptop_backlight_update(bd) ?
pr_warn("Loongson_backlight: resume brightness failed") :
pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
--
2.52.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/loongarch: laptop: explicitly reset the bl_powered state when resuming
2026-07-22 4:44 [PATCH] platform/loongarch: laptop: explicitly reset the bl_powered state when resuming liushuyu
@ 2026-07-22 12:51 ` Huacai Chen
2026-07-22 16:39 ` Yao Zi
1 sibling, 0 replies; 3+ messages in thread
From: Huacai Chen @ 2026-07-22 12:51 UTC (permalink / raw)
To: liushuyu
Cc: linux-kernel, Jianmin Lv, WANG Xuerui, Yao Zi, loongarch,
Mingcong Bai, Kexy Biscuit, stable
Hi, Zixing,
On Wed, Jul 22, 2026 at 12:45 PM <liushuyu@aosc.io> wrote:
>
> From: Zixing Liu <liushuyu@aosc.io>
>
> On EAECIS NL60R with EC firmware version 1.11, resuming from S3 has a very
> high chance (>= 90%) of causing the EC to lose the previous backlight
> power state. When this happens, the laptop resumes normally from S3, but
> the backlight remains off (when shining on the screen with a flash light,
> we can see the screen contents are updating normally).
>
> Since there is no generic way to query the EC's backlight state on
> Loongson laptop platforms, assume the worst-case scenario and restart the
> backlight power inside the kernel each time the system resumes.
>
> Cc: stable@vger.kernel.org
> Fixes: 53c762b47f72 ("platform/loongarch: laptop: Add backlight power control support")
> Signed-off-by: Zixing Liu <liushuyu@aosc.io>
> ---
> drivers/platform/loongarch/loongson-laptop.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/platform/loongarch/loongson-laptop.c b/drivers/platform/loongarch/loongson-laptop.c
> index 61b18ac206c9e..742a585b0647c 100644
> --- a/drivers/platform/loongarch/loongson-laptop.c
> +++ b/drivers/platform/loongarch/loongson-laptop.c
> @@ -200,6 +200,7 @@ static int loongson_hotkey_resume(struct device *dev)
>
> bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
> if (bd) {
> + bl_powered = false;
I think it is a little better to move this line into loongson_hotkey_suspend().
Huacai
> loongson_laptop_backlight_update(bd) ?
> pr_warn("Loongson_backlight: resume brightness failed") :
> pr_info("Loongson_backlight: resume brightness %d\n", bd->props.brightness);
> --
> 2.52.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform/loongarch: laptop: explicitly reset the bl_powered state when resuming
2026-07-22 4:44 [PATCH] platform/loongarch: laptop: explicitly reset the bl_powered state when resuming liushuyu
2026-07-22 12:51 ` Huacai Chen
@ 2026-07-22 16:39 ` Yao Zi
1 sibling, 0 replies; 3+ messages in thread
From: Yao Zi @ 2026-07-22 16:39 UTC (permalink / raw)
To: liushuyu, linux-kernel, Huacai Chen, Jianmin Lv, WANG Xuerui,
Yao Zi
Cc: loongarch, Mingcong Bai, Kexy Biscuit, stable, Yao Zi
On Wed, Jul 22, 2026 at 12:44:50PM +0800, liushuyu@aosc.io wrote:
> From: Zixing Liu <liushuyu@aosc.io>
>
> On EAECIS NL60R with EC firmware version 1.11, resuming from S3 has a very
> high chance (>= 90%) of causing the EC to lose the previous backlight
> power state. When this happens, the laptop resumes normally from S3, but
> the backlight remains off (when shining on the screen with a flash light,
> we can see the screen contents are updating normally).
>
> Since there is no generic way to query the EC's backlight state on
> Loongson laptop platforms, assume the worst-case scenario and restart the
> backlight power inside the kernel each time the system resumes.
>
> Cc: stable@vger.kernel.org
> Fixes: 53c762b47f72 ("platform/loongarch: laptop: Add backlight power control support")
> Signed-off-by: Zixing Liu <liushuyu@aosc.io>
Tested on my TongFang L860-T2 3A5000 laptop, which isn't affected by
the EC issue, after resuming from S3 the brightness kept unchanged,
no regression is observed.
Tested-by: Yao Zi <me@ziyao.cc>
Regards,
Yao Zi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-22 16:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-22 4:44 [PATCH] platform/loongarch: laptop: explicitly reset the bl_powered state when resuming liushuyu
2026-07-22 12:51 ` Huacai Chen
2026-07-22 16:39 ` Yao Zi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox