Nitrokey / heads

A minimal Linux that runs as a coreboot or LinuxBoot ROM payload to provide a secure, flexible boot environment for laptops and servers.
http://osresearch.net/
GNU General Public License v2.0
15 stars 1 forks source link

Power management regression with 2.4 (compared to 2.1): battery charge thresholds can't be set anymore #35

Open UndeadDevel opened 10 months ago

UndeadDevel commented 10 months ago

Please identify some basic details to help process the report

After upgrading to NK Heads 2.4 from 2.1 the system files /sys/class/power_supply/BAT0/charge_control_end_threshold and /sys/class/power_supply/BAT0/charge_control_start_threshold are gone (no OS updates were conducted simultaneously, so is definitely cause by the new firmware). This means limiting the charging process of the battery doesn't work anymore and the battery will always charge to 100%, which is a problem for those who mostly use the laptop in a stationary fashion for longer periods of time, in which case A/C would be connected.

To improve battery life it's important not to keep the battery charged at 100% for extended periods, but for that to work one either needs to cycle (by disconnecting and reconnecting the A/C, which is easily forgotten and is also worse for battery life than keeping it at e.g. 60% constantly) or set charging limits (by far the most convenient method). The latter method is now impossible.

A. Provide Hardware Details

1. What board are you using (see list of boards here)? Nitropad NV41

2. Does your computer have a dGPU or is it iGPU-only?

3. Who installed Heads on this computer?

4. What PGP key is being used?

5. Are you using the PGP key to provide HOTP verification?

B. Identify how the board was flashed

1. Is this problem related to updating heads or flashing it for the first time?

2. If the problem is related to an update, how did you attempt to apply the update?

3. How was Heads initially flashed

4. Was the board flashed with a maximized or non-maximized/legacy rom?

5. If Heads was externally flashed, was IFD unlocked?

C. Identify the rom related to this bug report

NK Heads 2.4 1. Did you download or build the rom at issue in this bug report?

2. If you downloaded your rom, where did you get it from?

Please provide the release number or otherwise identify the rom downloaded

3. If you built your rom, which repository:branch did you use?

4. What version of coreboot did you use in building?

5. In building the rom where did you get the blobs?

Please describe the problem

Describe the bug Under 2.1 with QubesOS 4.2 one could easily set charging thresholds by echoing values into the relevant system files; after upgrading to 2.4 this is not possible anymore, because the relevant files (see below) are gone.

To Reproduce Steps to reproduce the behavior:

  1. Upgrade NV41 to NK Heads 2.4
  2. Observe that unlike under 2.1 the files /sys/class/power_supply/BAT0/charge_control_end_threshold and /sys/class/power_supply/BAT0/charge_control_start_threshold are gone and no "replacements" under different names are to be found.

Expected behavior Ability to limit charging by setting thresholds is retained.

daringer commented 10 months ago

no idea from the top of my head, needs investigations - we try to reproduce

UndeadDevel commented 9 months ago

Another NV41 user on the QubesOS forum reports that for her, using coreboot 1.7.1 with QubesOS 4.2 the charging limitation is possible; so either this was broken in coreboot 1.7.2 or it's the NK Heads build that messes things up.

daringer commented 9 months ago

ah ok, that's a good hint - if it's configurable within the "bios" (edk2) then this it's likely something we lose due to HEADS and its current inability to init/configure some of the coreboot-level parameters (idle level, fan curve, ...).

tlaurion commented 6 months ago

https://github.com/linuxboot/heads/issues/1647#issuecomment-2068293817

@daringer EC firmware regression?

daringer commented 6 months ago

hard to tell, afaik there was no EC update in between - I would still guess something within dasharo coreboot that changed...

tlaurion commented 6 months ago

That's https://github.com/Dasharo/dasharo-issues/issues/820