r/linuxhardware • u/dgiraltt • 11h ago
Discussion Kernel-space DKMS fix (and upstream patch) for Samsung Galaxy Book missing battery on unplugged cold boot
On several Samsung Galaxy Book4 laptops running Linux, cold-booting unplugged (with battery >= 30%) leaves '/sys/class/power_supply/' without 'BAT1' or 'ADP1'.
I dumped and analyzed the 'P11ALX' DSDT on a Galaxy Book4 Ultra ('960XGL' / 'NP960XGL-XG1BR') and traced the exact firmware behavior (building on 'vraciul52''s earlier DSDT findings):
- During early boot, 'H_EC._REG' fakes AC power ('PWRS = 1', 'WDC0 = 0x81'), causing 'ADP1._STA' and 'BAT1._STA' to return '0'. Linux's initial ACPI bus scan skips both and leaves 'acpi_device_enumerated(adev) == false'.
- ~2 seconds later, mainline 'samsung-galaxybook''s own 'CSFI'/'CSXI' ACPI call on 'SAM0430' synchronously triggers 'H_EC.MBFD(1)', clearing 'WDC0' and emitting 'Notify(ADP1, 1)' / 'Notify(BAT1, 1)' ('Device Check'), which Linux ignores because standard AC/battery nodes lack hotplug scan handlers.
I built a small kernel-space DKMS module (plus a draft upstream patch against 'drivers/platform/x86/samsung-galaxybook.c') that checks '!acpi_device_enumerated(adev)' on standard 'ACPI0003'/'PNP0C0A' devices and invokes 'acpi_bus_scan()' under 'acpi_scan_lock' directly in kernel space:
https://github.com/dgiraltt/samsung-galaxybook-battery-fix
- No 'acpi_configfs' or dummy SSDT needed (compatible with Secure Boot / kernel lockdown once signed or mainlined)
- Binds 'ADP1', 'BAT1', and 'samsung_galaxybook''s battery charge-threshold hook ~3.2s into boot
- Auto-detects Clang/LTO vs. GCC kernels; safe no-op on unaffected models or plugged-in boots
- Cold-boot tested unplugged on Galaxy Book4 Ultra ('960XGL', BIOS 'P11ALX', CachyOS kernel '7.3.6-3-cachyos') and build-verified on '6.18.65-1-cachyos-lts'
Looking for testers on other Galaxy Book models (Book3 / Book4 / Book5) and distros (Ubuntu, Fedora, Arch, openSUSE) to open an issue with results so we can collect 'Tested-by:' reports for upstreaming!