Re: [PATCH v6 3/3] HID: lamparray: blank lamps across suspend and restore on resume
From: sashiko-bot@kernel.org
Date: 2026-09-16 15:00:13
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] hid: lamparray: blink timer overwrites blanked state during suspend -- commit 0480546fa780aefd04da86e31cbb23c2cb7e6a3d Author: Cristian Mazzotta [off-list ref] HID: lamparray: blank lamps across suspend and restore on resume This commit adds power management callbacks to blank lamparray devices during system suspend by writing zeroes to the color channels. It also introduces a resume function to explicitly transition the device out of autonomous mode and restore its cached color state.
quoted hunk ↗ jump to hunk
diff --git a/drivers/hid/hid-lamparray.c b/drivers/hid/hid-lamparray.c index acc00950495bf..c7d4d3d1b02d3 100644 --- a/drivers/hid/hid-lamparray.c +++ b/drivers/hid/hid-lamparray.c
[ ... ]
+void lamparray_suspend(struct lamparray *la)
+{
+ struct lamparray_device *ldev;
+
+ if (!la)
+ return;
+
+ ldev = &la->ldev;
+
+ if (!ldev->use_leds_uapi)
+ return;
+
+ mutex_lock(&ldev->dev_lock);
+ lamparray_hw_set_state(ldev, 0, 0, 0, 0);
+ mutex_unlock(&ldev->dev_lock);[Severity: Medium] Will active LED software blink timers continue to fire during system suspend and overwrite this blanked state? If a userspace application or trigger enables software blinking on the lamparray LED classdev before system suspend (e.g. s2idle), the timer can continue to queue work to leds_wq. This will call lamparray_hw_set_state() and overwrite the blanked (0,0,0,0) state set here, causing high power draw and undermining the intent of this function. Does the lamparray LED classdev initialization need to set the LED_CORE_SUSPENDRESUME flag so the LED subsystem correctly applies LED_SUSPENDED and prevents timers from queuing new brightness updates during suspend?
+ + hid_hw_wait(ldev->hdev); +} +EXPORT_SYMBOL_GPL(lamparray_suspend);
-- Sashiko AI review · https://sashiko.dev/#/patchset/20260916144838.456239-1-aer@tuxedocomputers.com?part=3