Bug 796068 - Powertop not showing watts on laptop
Summary: Powertop not showing watts on laptop
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: powertop
Version: 16
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-22 08:16 UTC by Jan Sedlák
Modified: 2013-05-09 08:14 UTC (History)
3 users (show)

Fixed In Version: powertop-1.98-4.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1049585 (view as bug list)
Environment:
Last Closed: 2012-03-02 01:31:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed fix (1.73 KB, patch)
2012-02-24 14:07 UTC, Jaroslav Škarvada
no flags Details | Diff

Description Jan Sedlák 2012-02-22 08:16:14 UTC
Description of problem:
Since one update of system (I think that it was when /proc/acpi/BAT0 moved to /sys/class/power_supply) powertop stopped showing watt power consumption.

Version-Release number of selected component (if applicable):
Powertop 1.98 beta 1

Steps to Reproduce:
1. update system
2. run powertop with root privilegies (and without power adapter plugged in)
  
Actual results:
Powertop doesn't show watts.

Expected results:
Powertop should show watt consumption.

Comment 1 Jaroslav Škarvada 2012-02-22 14:45:27 UTC
I cannot reproduce. It doesn't seem to be related to /proc/acpi/battery removal, because powertop uses the /sys interface at first and then fallbacks to the /proc interface.

Please recheck that the stats aren't there (because it could be kernel bug related to firmware/kernel confusion about AC/battery switch) and then provide output of:
# ls -1 /sys/class/power_supply/*
# for d in /sys/class/power_supply/*; do echo $d; cat $d/uevent; done

Comment 2 Jan Sedlák 2012-02-22 15:09:45 UTC
No, stats aren't there. And output is:

[garret@blanka ~]$ ls -l /sys/class/power_supply/*
lrwxrwxrwx. 1 root root 0 21. bře  2012 /sys/class/power_supply/ADP1 -> ../../devices/LNXSYSTM:00/device:00/ACPI0003:00/power_supply/ADP1
lrwxrwxrwx. 1 root root 0 21. bře  2012 /sys/class/power_supply/BAT0 -> ../../devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C09:00/PNP0C0A:00/power_supply/BAT0

[garret@blanka ~]$ for d in /sys/class/power_supply/*; do echo $d; cat $d/uevent; done
/sys/class/power_supply/ADP1
POWER_SUPPLY_NAME=ADP1
POWER_SUPPLY_ONLINE=0
/sys/class/power_supply/BAT0
POWER_SUPPLY_NAME=BAT0
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=10800000
POWER_SUPPLY_VOLTAGE_NOW=12175000
POWER_SUPPLY_POWER_NOW=15997000
POWER_SUPPLY_ENERGY_FULL_DESIGN=47520000
POWER_SUPPLY_ENERGY_FULL=41500000
POWER_SUPPLY_ENERGY_NOW=40620000
POWER_SUPPLY_MODEL_NAME=LNV-42T4751
POWER_SUPPLY_MANUFACTURER=SANYO
POWER_SUPPLY_SERIAL_NUMBER=17849

[garret@blanka acpi]$ ls /proc/acpi/
button  ibm  wakeup

My laptop is Lenovo Edge E520 (Sandy Bridge architecture), I'm using up to date kernel 3.2.5-3.

Output of powertop is here http://www.stud.fit.vutbr.cz/~xsedla85/powertop.png

Comment 3 Jaroslav Škarvada 2012-02-22 15:38:19 UTC
Thanks for the report & additional info, I probably got it. I will prepare the test build tmrw.

Comment 4 Jaroslav Škarvada 2012-02-24 14:07:51 UTC
Created attachment 565604 [details]
Proposed fix

Proposed fix sent upstream.

Comment 5 Fedora Update System 2012-02-24 14:41:47 UTC
powertop-1.98-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/powertop-1.98-4.fc17

Comment 6 Fedora Update System 2012-02-24 14:51:39 UTC
powertop-1.98-4.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/powertop-1.98-4.fc16

Comment 7 Fedora Update System 2012-02-24 22:31:18 UTC
Package powertop-1.98-4.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing powertop-1.98-4.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-2310/powertop-1.98-4.fc17
then log in and leave karma (feedback).

Comment 8 Jan Sedlák 2012-02-25 10:06:07 UTC
I'm trying to install powertop from testing as shown before, but yum says that "No package powertop-1.98-4.fc17 available.".I've had some problems with yum before (outdated cache) but I thought I have solved it. Is it problem on my side or aren't repositories actual yet?

Comment 9 Jan Sedlák 2012-02-26 14:30:13 UTC
I have installed powertop from fedora 16 testing repository and it works now, I left feedback. I don't have F17, but I think that you can close the bug.

Comment 10 Jaroslav Škarvada 2012-02-27 07:31:39 UTC
(In reply to comment #8)
> I'm trying to install powertop from testing as shown before, but yum says that
> "No package powertop-1.98-4.fc17 available.".I've had some problems with yum
> before (outdated cache) but I thought I have solved it. Is it problem on my
> side or aren't repositories actual yet?

Mirrors sync takes a while (typically a day), but it is possible to get the package by the hand from Koji build system.

Comment 11 Jaroslav Škarvada 2012-02-27 07:33:32 UTC
(In reply to comment #9)
> I have installed powertop from fedora 16 testing repository and it works now, I
> left feedback. I don't have F17, but I think that you can close the bug.

Thanks for info, please give it karma in Bodhi (the link in comment 7). This bug will be autoclosed by Bodhi once the package gets into stable.

Comment 12 Fedora Update System 2012-03-02 01:31:41 UTC
powertop-1.98-4.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2012-03-06 19:24:14 UTC
powertop-1.98-4.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 14 Drezil1985 2013-05-08 09:33:15 UTC
seems the same problem persists on my laptop.. for me its not "rate" or "power_now" but "charge_now".

$ ls -l /sys/class/power_supply/*
lrwxrwxrwx 1 root root 0 Mai  8 10:40 /sys/class/power_supply/AC -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0003:00/power_supply/AC
lrwxrwxrwx 1 root root 0 Mai  8 10:40 /sys/class/power_supply/BAT -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:00/PNP0C09:00/PNP0C0A:00/power_supply/BAT

$ for d in /sys/class/power_supply/*; do echo $d; cat $d/uevent; done
/sys/class/power_supply/AC
POWER_SUPPLY_NAME=AC
POWER_SUPPLY_ONLINE=0
/sys/class/power_supply/BAT
POWER_SUPPLY_NAME=BAT
POWER_SUPPLY_STATUS=Discharging
POWER_SUPPLY_PRESENT=1
POWER_SUPPLY_TECHNOLOGY=Li-ion
POWER_SUPPLY_CYCLE_COUNT=0
POWER_SUPPLY_VOLTAGE_MIN_DESIGN=14800000
POWER_SUPPLY_VOLTAGE_NOW=15588000
POWER_SUPPLY_CHARGE_FULL_DESIGN=5200000
POWER_SUPPLY_CHARGE_FULL=5078000
POWER_SUPPLY_CHARGE_NOW=4114000
POWER_SUPPLY_CAPACITY=81
POWER_SUPPLY_MODEL_NAME=BAT
POWER_SUPPLY_MANUFACTURER=NOTEBOOK
POWER_SUPPLY_SERIAL_NUMBER=0001

--

Using "PowerTOP versionv2.1, compiled on Aug 23 2012" (from the ububtu-repo.. thought it might not harm to post it here as well)

Comment 15 Jaroslav Škarvada 2013-05-09 08:14:00 UTC
(In reply to comment #14)
The charge_now is present charge of your battery - a different thing than rate or power_now. Maybe the current (mA) measurement is a) not supported by your battery / laptop / firmware or b) kernel doesn't read it right on your machine. You can try updating your BIOS. Or you can forward the issue to kernel (it may help in b) case).

We could workaround this in PowerTOP by calculating the rate from the delta of charge_now taken in several time frames. But this doesn't seem to be trivial RFE as the data are updated asynchronously and synchronization is critical for such indirect method to work correctly (to give usable results). As this seem to be very rare / uncommon HW / firmware implementation I think it is not worth to workaround it. But anyway you could try to forward it to the PowerTOP upstream.


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