Bug 219638 - Battery Not Detected on Boot When Running on Battery Power
Summary: Battery Not Detected on Boot When Running on Battery Power
Status: NEW
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Battery (show other bugs)
Hardware: Intel Linux
: P3 normal
Assignee: acpi_power-battery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-28 17:24 UTC by Sylvain Mosnier
Modified: 2025-01-01 11:35 UTC (History)
0 users

See Also:
Kernel Version: 6.8.0-51-generic
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg boot logs on AC (1.16 KB, text/plain)
2024-12-30 13:19 UTC, Sylvain Mosnier
Details
dmesg boot logs no AC (1.29 KB, text/plain)
2024-12-30 13:22 UTC, Sylvain Mosnier
Details

Description Sylvain Mosnier 2024-12-28 17:24:07 UTC
On a Samsung Ultra Book 4 running Ubuntu 24.04 with kernel version 6.8.0-51-generic, the battery fails to be detected when the system boots on battery power. No directory is created under /sys/class/power_supply/BAT1. However, if the system boots while connected to a power source, the battery is detected correctly.

Steps to Reproduce:

    Power off the laptop.
    Disconnect the charger and boot the system on battery power.
    Observe that /sys/class/power_supply/BAT1 is missing.

Additional Details:

    Running acpidbg shows the battery is correctly handled by ACPI in both states (on battery or plugged in), suggesting an issue with the kernel's battery initialization during boot when on battery power.

Expected Behavior: The battery should be detected and /sys/class/power_supply/BAT1 should be created regardless of whether the system is booted on battery or connected to a power source.
Comment 1 Sylvain Mosnier 2024-12-28 17:27:27 UTC
Additionally, upgrading kernel to 6.12.3 (latest stable ubuntu) did not fix the issue.
Comment 2 Artem S. Tashkinov 2024-12-30 11:54:58 UTC
Has any kernel ever worked for you, or has it always been like this?
Comment 3 Sylvain Mosnier 2024-12-30 13:19:25 UTC
Created attachment 307420 [details]
dmesg boot logs on AC

Booting when AC connected

Shell prompt :
sudo dmesg | grep -i BAT  > dmesg_acpi_bus_log_no_ac.txt

I first enabled dynamic debug by adding dyndbg="file drivers/acpi/bus.c +pfsl" to my grub config file.
Comment 4 Sylvain Mosnier 2024-12-30 13:22:26 UTC
Created attachment 307421 [details]
dmesg boot logs no AC

Dmesg at boot time when no AC source plugged

Shell prompt :
sudo dmesg | grep -i BAT  > dmesg_acpi_bus_log_no_ac.txt 


I first enabled dynamic debug for drivers/acpi/bus.c file with dyndbg="file drivers/acpi/bus.c +pfsl" in my grub config.
Comment 5 Sylvain Mosnier 2024-12-30 13:25:06 UTC
It has always been like this.

From the above attachment, it looms like the BAT1._STA methods is taking a long time to go to 0x1F value when on battery. Maybe some firmware bug.
Comment 6 Artem S. Tashkinov 2024-12-30 20:26:18 UTC
Do you still have Windows installed? Can you confirm it's not affected?
Comment 7 Sylvain Mosnier 2024-12-31 10:15:47 UTC
(In reply to Artem S. Tashkinov from comment #6)
> Do you still have Windows installed? Can you confirm it's not affected?

Yes, I have a dual boot. Indeed, Windows is not affected. Also, all firmware and drivers are up to date on Windows side.
Comment 8 Artem S. Tashkinov 2025-01-01 11:35:58 UTC
Please give kernel 6.13-rc5 a try.

Note You need to log in before you can comment on or make changes to this bug.