Since 4.14.0, my upowerd reports 0% battery for my Logitech M535 bluetooth mouse. There is a valid power_supply entry in /sys, but it reports invalid capacity as of 4.14.4: /sys/class/power_supply/hid-00:1f:20:fd:cb:be-battery# grep "" * capacity:0 grep: device: Is a directory model_name:Bluetooth Mouse M336/M337/M535 online:1 grep: power: Is a directory grep: powers: Is a directory present:1 scope:Device status:Unknown grep: subsystem: Is a directory type:Battery uevent:POWER_SUPPLY_NAME=hid-00:1f:20:fd:cb:be-battery uevent:POWER_SUPPLY_PRESENT=1 uevent:POWER_SUPPLY_ONLINE=1 uevent:POWER_SUPPLY_CAPACITY=0 uevent:POWER_SUPPLY_MODEL_NAME=Bluetooth Mouse M336/M337/M535 uevent:POWER_SUPPLY_STATUS=Unknown uevent:POWER_SUPPLY_SCOPE=Device This used to work in 4.13. Is this a regression, or a checkbox that's new in 4.14?
You can try reverting these: 0152b29c8965 HID: input: throttle battery uevents 0922386538f9 HID: input: optionally use device id in battery name 581c4484769e HID: input: map digitizer battery usage The last one is likely the culprit. Can you attach contents of /sys/kernel/debug/hid/<your mouse id>/rdesc here, plase?
And can you please post what 4.13 shows for the same device in /sys/class/power_supply/hid-00:1f:20:fd:cb:be-battery
Created attachment 261043 [details] rdesc file retrieved on 4.14.4 This is the requested rdesc file, as seen on 4.14.4
Output of /sys/class/power_supply/hid-00:1f:20:fd:cb:be-battery on 4.13.12: capacity:53 grep: device: Is a directory model_name:Bluetooth Mouse M336/M337/M535 online:1 grep: power: Is a directory grep: powers: Is a directory present:1 scope:Device status:Discharging grep: subsystem: Is a directory type:Battery uevent:POWER_SUPPLY_NAME=hid-00:1f:20:fd:cb:be-battery uevent:POWER_SUPPLY_PRESENT=1 uevent:POWER_SUPPLY_ONLINE=1 uevent:POWER_SUPPLY_CAPACITY=53 uevent:POWER_SUPPLY_MODEL_NAME=Bluetooth Mouse M336/M337/M535 uevent:POWER_SUPPLY_STATUS=Discharging uevent:POWER_SUPPLY_SCOPE=Device
Reverting the mentioned commits fixes the regression. Reverting only the last one is problematic since it depends on the first two and created failed hunks on a dry-run. So I applied them all.
I'm on vanilla 4.15 and experience the regression again. Should I revert the same commits?
Reverting those 3 commits in 4.15 does indeed restore correct behaviour.
Had to revert the three mentioned commits to get BT mouse power meter working in 4.16 again. Will this trickle back up one day?
Should be fixed with 2e210bbb7429cdcf1a1a3ad00c1bf98bd9bf2452.