Re: [PATCH 1/2] HID: apple: preserve keyboard backlight across T2 resume
From: sashiko-bot@kernel.org
Date: 2026-07-18 12:35:58
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Removing the `LED_CORE_SUSPENDRESUME` flag reverts a previous power-management fix, causing the keyboard backlight to remain powered on during system suspend. --
--- Patch [1]: [PATCH 1/2] HID: apple: preserve keyboard backlight across T2 resume ---commit 2758811c67b214fbd3316fec3f21127f8166f490
Author: Andre Eikmeyer [off-list ref]
HID: apple: preserve keyboard backlight across T2 resume
This commit fixes an issue where the T2 virtual USB host controller
re-enumerates the internal keyboard on resume, resulting in the backlight
starting off. It caches the brightness during removal and restores it
during the subsequent probe.
Fixes: 1f95a6cd5ad7 ("HID: apple: ensure the keyboard backlight is off if suspending")
Cc: stable@vger.kernel.org
quoted hunk ↗ jump to hunk
diff --git a/drivers/hid/hid-apple.c b/drivers/hid/hid-apple.c --- a/drivers/hid/hid-apple.c +++ b/drivers/hid/hid-apple.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -860,13 +864,20 @@ static int apple_backlight_init(struct hid_device *hdev) asc->backlight->cdev.name = "apple::kbd_backlight"; asc->backlight->cdev.max_brightness = rep->backlight_on_max; asc->backlight->cdev.brightness_set_blocking = apple_backlight_led_set; - asc->backlight->cdev.flags = LED_CORE_SUSPENDRESUME; + /* VHCI re-enumeration restores the cached brightness in the next probe. */
[Severity: High] Does removing the LED_CORE_SUSPENDRESUME flag cause the backlight to remain on during system suspend? The T2 butterfly keyboard hardware does not automatically power off its backlight when suspending. When this flag is removed, the LED subsystem bypasses led_classdev_suspend(), leaving the hardware illuminated and draining the battery. The new caching mechanism in apple_remove() successfully tracks the user brightness preference, as led_classdev_suspend() only alters the physical hardware state without modifying the logical led_cdev->brightness. Could the device initialization issue have been caused by the hardcoded apple_backlight_set(hdev, 0, 0) during probe, rather than the presence of this suspend flag?
- ret = apple_backlight_set(hdev, 0, 0);
-- Sashiko AI review · https://sashiko.dev/#/patchset/20260718121527.15924-1-dev@deq.rocks?part=1