After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748592 - issue with a dual-battery laptop
issue with a dual-battery laptop
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Power
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Richard Hughes
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-28 15:59 UTC by Matthias Clasen
Modified: 2015-06-04 16:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
power: Describe batteries properly when not called BAT0 (2.67 KB, patch)
2015-05-07 10:29 UTC, Bastien Nocera
committed Details | Review

Description Matthias Clasen 2015-04-28 15:59:25 UTC
we are testing a hybrid laptop/tabled machine here, which has two batteries, one in the keyboard part and one in the screen part. They show up as BAT1 and BAT2 in the firmware and upower, and just get both labeled as "Extra" in the power panel.

It would be great if we could arrange things so that they are labeled "Screen" and "Keyboard", then you could see if you will be out of power when you disconnect the screen before doing so.

Suggestion from irc:

bentiss>	can't we just have a hwdb entry that relabels the batteries?
mclasen>	you still need to know which is which...
bentiss>	mclasen: if "toshiba X20t & BAT1" -> screen, if BAT2 -> keyboard
there will not be any heuristic behind
hadess>	mclasen, 13987             Name (_EJD, "\\_SB.PCI0.DOCK")  // _EJD: Ejection Dependent Device•
hadess>	BAT2 has a dock eject method
Comment 1 Bastien Nocera 2015-04-29 14:05:14 UTC
What's the output of "upower -d" on this machine? You should be getting the composited battery as the primary, and both the small ones showing up as "Extra". Apparently that's not what happens.

About the keyboard battery being dock dependent, could do a "find /sys/class/power_supply/BAT2/" and get the content of any file that look like they are dock related? (the ACPI sub-system should tag them as docks)
Comment 2 Matthias Clasen 2015-04-29 14:36:05 UTC
(In reply to Bastien Nocera from comment #1)
> What's the output of "upower -d" on this machine? You should be getting the
> composited battery as the primary, and both the small ones showing up as
> "Extra". Apparently that's not what happens.

Thats exactly what happens. I get a composited and two 'Extra'.

> About the keyboard battery being dock dependent, could do a "find
> /sys/class/power_supply/BAT2/" and get the content of any file that look
> like they are dock related? (the ACPI sub-system should tag them as docks)

/sys/class/power_supply/BAT1/
/sys/class/power_supply/BAT1/type
/sys/class/power_supply/BAT1/power_now
/sys/class/power_supply/BAT1/alarm
/sys/class/power_supply/BAT1/power
/sys/class/power_supply/BAT1/power/control
/sys/class/power_supply/BAT1/power/async
/sys/class/power_supply/BAT1/power/runtime_enabled
/sys/class/power_supply/BAT1/power/runtime_active_kids
/sys/class/power_supply/BAT1/power/runtime_active_time
/sys/class/power_supply/BAT1/power/autosuspend_delay_ms
/sys/class/power_supply/BAT1/power/runtime_status
/sys/class/power_supply/BAT1/power/runtime_usage
/sys/class/power_supply/BAT1/power/runtime_suspended_time
/sys/class/power_supply/BAT1/device
/sys/class/power_supply/BAT1/capacity
/sys/class/power_supply/BAT1/subsystem
/sys/class/power_supply/BAT1/capacity_level
/sys/class/power_supply/BAT1/status
/sys/class/power_supply/BAT1/voltage_now
/sys/class/power_supply/BAT1/uevent
/sys/class/power_supply/BAT1/energy_now
/sys/class/power_supply/BAT1/model_name
/sys/class/power_supply/BAT1/manufacturer
/sys/class/power_supply/BAT1/technology
/sys/class/power_supply/BAT1/cycle_count
/sys/class/power_supply/BAT1/energy_full_design
/sys/class/power_supply/BAT1/voltage_min_design
/sys/class/power_supply/BAT1/serial_number
/sys/class/power_supply/BAT1/energy_full
/sys/class/power_supply/BAT1/present
/sys/class/power_supply/BAT2/
/sys/class/power_supply/BAT2/type
/sys/class/power_supply/BAT2/power_now
/sys/class/power_supply/BAT2/alarm
/sys/class/power_supply/BAT2/power
/sys/class/power_supply/BAT2/power/control
/sys/class/power_supply/BAT2/power/async
/sys/class/power_supply/BAT2/power/runtime_enabled
/sys/class/power_supply/BAT2/power/runtime_active_kids
/sys/class/power_supply/BAT2/power/runtime_active_time
/sys/class/power_supply/BAT2/power/autosuspend_delay_ms
/sys/class/power_supply/BAT2/power/runtime_status
/sys/class/power_supply/BAT2/power/runtime_usage
/sys/class/power_supply/BAT2/power/runtime_suspended_time
/sys/class/power_supply/BAT2/device
/sys/class/power_supply/BAT2/capacity
/sys/class/power_supply/BAT2/subsystem
/sys/class/power_supply/BAT2/capacity_level
/sys/class/power_supply/BAT2/status
/sys/class/power_supply/BAT2/voltage_now
/sys/class/power_supply/BAT2/uevent
/sys/class/power_supply/BAT2/energy_now
/sys/class/power_supply/BAT2/model_name
/sys/class/power_supply/BAT2/manufacturer
/sys/class/power_supply/BAT2/technology
/sys/class/power_supply/BAT2/cycle_count
/sys/class/power_supply/BAT2/energy_full_design
/sys/class/power_supply/BAT2/voltage_min_design
/sys/class/power_supply/BAT2/serial_number
/sys/class/power_supply/BAT2/energy_full
/sys/class/power_supply/BAT2/present

Couldn't spot anything dock-related here.
Comment 3 Bastien Nocera 2015-05-07 10:29:20 UTC
Created attachment 303028 [details] [review]
power: Describe batteries properly when not called BAT0

When the main battery isn't called BAT0, as happens on a dual-battery,
convertible Toshiba laptop, we would tag both batteries as "Extra". Mark
the first one as being the main battery.

In the longer-term, we'll have UPower exporting the exact information
about which is in the "dock" and which is in the same package as the
processing unit, when the kernel exports it.
See https://bugzilla.kernel.org/show_bug.cgi?id=97841
Comment 4 Rui Matos 2015-05-08 14:46:34 UTC
Review of attachment 303028 [details] [review]:

sure
Comment 5 Bastien Nocera 2015-06-04 16:32:57 UTC
Attachment 303028 [details] pushed as f31c3b1 - power: Describe batteries properly when not called BAT0