Bug 56741 (ToddH) - Battery charging at zero rate - will never fully charge - Sony VAIO VPCEB13FX
Summary: Battery charging at zero rate - will never fully charge - Sony VAIO VPCEB13FX
Status: CLOSED DOCUMENTED
Alias: ToddH
Product: Power Management
Classification: Unclassified
Component: Run-Time-PM (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Lan Tianyu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-17 18:12 UTC by ToddH
Modified: 2013-06-17 08:44 UTC (History)
3 users (show)

See Also:
Kernel Version: 3.2.0-40-generic
Subsystem:
Regression: No
Bisected commit-id:


Attachments
acpidump for 3.9.0-999-generic (216.28 KB, text/message)
2013-04-18 02:35 UTC, ToddH
Details
dmesg for 3.9.0-999-generic (59.42 KB, text/plain)
2013-04-18 02:42 UTC, ToddH
Details
contents of BAT0 folder for 3.9.0-999-generic (1.49 KB, text/plain)
2013-04-18 02:47 UTC, ToddH
Details
contents of /lib/modules/3.9.0-999-generic/kernel/drivers/acpi/ (576 bytes, text/plain)
2013-04-18 15:54 UTC, ToddH
Details
acpidump for 3.2.0-40-generic (toddh) (216.28 KB, text/plain)
2013-04-19 22:05 UTC, ToddH
Details
dmesg for 3.2.0-40-generic (toddh) (61.67 KB, text/plain)
2013-04-19 22:06 UTC, ToddH
Details
contents of BAT0 folder for 3.2.0-40-generic (toddh) (1.51 KB, text/plain)
2013-04-19 22:07 UTC, ToddH
Details
proc-cpuinfo_20130419 (3.29 KB, text/plain)
2013-04-19 22:08 UTC, ToddH
Details
proc-modules (2.58 KB, text/plain)
2013-04-19 22:09 UTC, ToddH
Details
ver_linux (1.16 KB, text/plain)
2013-04-19 22:09 UTC, ToddH
Details
ver-linux_20130422 (1.16 KB, text/plain)
2013-04-22 23:41 UTC, ToddH
Details
dmesg for 3.2.0-40-generic (toddh) (63.52 KB, text/plain)
2013-04-22 23:45 UTC, ToddH
Details
grep BAT0 for 2.3.0-40-generic (toddh) (1.51 KB, text/plain)
2013-04-22 23:48 UTC, ToddH
Details
acpidump for 3.2.0-40-generic (toddh) 20130422 (219.16 KB, text/plain)
2013-04-22 23:52 UTC, ToddH
Details

Description ToddH 2013-04-17 18:12:12 UTC
:~$ acpi -abi
Battery 0: Charging, 9%, charging at zero rate - will never fully charge.
Battery 0: design capacity 42180 mWh, last full capacity 29050 mWh = 68%
Adapter 0: on-line

:~$ dmesg | grep Sony
DMI: Sony Corporation VPCEB13FX/VAIO, BIOS R0230Y8 01/26/2010

As listed above, my battery is not charging in Linux, and charged fine with a previous installation of Windows7.  I wiped the Windows partition for more HD space.  Would you help get the battery to charge under Linux?

Original bug posted:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1169727

:~$ upower --monitor-detail
/** battery removed, and put back to obtain the following result. */
  native-path:          /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0A:00/power_supply/BAT0
  vendor:               Sony Corp.
  power supply:         yes
  updated:              Wed Apr 17 12:07:23 2013 (0 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    energy:              2.61 Wh
    energy-empty:        0 Wh
    energy-full:         29.05 Wh
    energy-full-design:  42.18 Wh
    energy-rate:         0 W
    percentage:          8.98451%
    capacity:            68.8715%
    technology:          lithium-ion
  History (charge):
    1366222037	8.985	charging
    1366222037	0.000	unknown
  History (rate):
    1366222037	0.000	unknown
Comment 1 Lan Tianyu 2013-04-18 00:30:57 UTC
Please provide acpidump, dmesg and the output of "grep . /sys/class/power_supply/BAT0/*"
Comment 2 ToddH 2013-04-18 02:35:47 UTC
Created attachment 99111 [details]
acpidump for 3.9.0-999-generic
Comment 3 ToddH 2013-04-18 02:42:48 UTC
Created attachment 99121 [details]
dmesg for 3.9.0-999-generic
Comment 4 ToddH 2013-04-18 02:47:20 UTC
Created attachment 99131 [details]
contents of BAT0 folder for 3.9.0-999-generic

operation returned:
grep: /sys/class/power_supply/BAT0/voltage_now: No such device
Comment 5 ToddH 2013-04-18 02:49:49 UTC
Comment on attachment 99131 [details]
contents of BAT0 folder for 3.9.0-999-generic

/*command return = */ grep: /sys/class/power_supply/BAT0/voltage_now: No such device
Comment 6 Lan Tianyu 2013-04-18 06:08:24 UTC
Hi, the bios acpi table doesn't provide actual voltage_now int _BST method of DSDT and give the value of 0xffffffff back. So battery driver return nodev error. Please try the following patch. It assign design_voltage to voltage_now.

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index f223018..0a80522 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -521,6 +521,7 @@ static int acpi_battery_get_state(struct acpi_battery *battery)
                battery->capacity_now = battery->capacity_now *
                    10000 / battery->design_voltage;
        }
+       battery->voltage_now = battery->design_voltage;
        return result;
 }
Comment 7 ToddH 2013-04-18 15:51:24 UTC
Where is the file to update "static int acpi_battery_get_state"?  Where is battery.c?

I found 
line 67:  obj-$(CONFIG_ACPI_BATTERY)	+= battery.o
in
/usr/src/linux-headers-3.9.0-999/drivers/acpi/Makefile

or, maybe the contents of /lib/modules/3.9.0-999-generic/kernel/drivers/acpi/ would help?  If so, see attached.
Comment 8 ToddH 2013-04-18 15:54:12 UTC
Created attachment 99241 [details]
contents of /lib/modules/3.9.0-999-generic/kernel/drivers/acpi/
Comment 9 ToddH 2013-04-19 22:01:30 UTC
Lan, thanks for your help in looking at this and offering the first patch.  Fortunately, I found battery.c (with the following steps):
sudo apt-get source linux-image-<version>
sudo apt-get build-dep linux-image-<version>
git clone git://kernel.ubuntu.com/ubuntu/ubuntu-<release>.git
cd <working directory of linux_<version>.tar.gz>
tar -xzvf linux_<version>.tar.gz
<working directory of linux tarball>/ubuntu-<release>/drivers/acpi/battery.c

After updating and compiling the new kernel:
:~$ cat /proc/version
Linux version 3.2.0-40-generic (root@toddh) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #64 SMP Fri Apr 19 11:14:03 MDT 2013

Unfortunately:
:~$ acpi -abi
Battery 0: Charging, 7%, charging at zero rate - will never fully charge.
Battery 0: design capacity 356 mAh, last full capacity 245 mAh = 68%
Adapter 0: on-line

What will help the battery to charge again?  Attached are the new acpidump, and dmesg, along with other information that may prove helpful in solving this issue.  Would you let me know if anything else would be helpful in troubleshooting this issue?
Comment 10 ToddH 2013-04-19 22:05:29 UTC
Created attachment 99381 [details]
acpidump for 3.2.0-40-generic (toddh)
Comment 11 ToddH 2013-04-19 22:06:23 UTC
Created attachment 99391 [details]
dmesg for 3.2.0-40-generic (toddh)
Comment 12 ToddH 2013-04-19 22:07:23 UTC
Created attachment 99401 [details]
contents of BAT0 folder for 3.2.0-40-generic (toddh)
Comment 13 ToddH 2013-04-19 22:08:23 UTC
Created attachment 99411 [details]
proc-cpuinfo_20130419
Comment 14 ToddH 2013-04-19 22:09:10 UTC
Created attachment 99421 [details]
proc-modules
Comment 15 ToddH 2013-04-19 22:09:43 UTC
Created attachment 99431 [details]
ver_linux
Comment 16 ToddH 2013-04-20 00:02:10 UTC
For ease, a comparison of outputs from: "grep . /sys/class/power_supply/BAT0/*"
:~$ diff -it grep20130417.dat grepBAT0_20130419.dat
2d1
< /sys/class/power_supply/BAT0/capacity:8
6c5
< /sys/class/power_supply/BAT0/energy_now:2610000
---
> /sys/class/power_supply/BAT0/energy_now:2320000
18c17,18
< /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=118300000
---
> /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_MIN_DESIGN=118250000
> /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_VOLTAGE_NOW=118250000
22,23c22
< /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_ENERGY_NOW=2610000
< /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_CAPACITY=8
---
> /sys/class/power_supply/BAT0/uevent:POWER_SUPPLY_ENERGY_NOW=2320000
27c26,27
< /sys/class/power_supply/BAT0/voltage_min_design:118300000
---
> /sys/class/power_supply/BAT0/voltage_min_design:118250000
> /sys/class/power_supply/BAT0/voltage_now:118250000
Comment 17 ToddH 2013-04-22 23:39:55 UTC
A re-installation of Windows7 didn't solve the battery charging issue as hoped.  Fortunately, it allowed the BIOS update from Sony for improved fan control: 
DMI: Sony Corporation VPCEB13FX/VAIO, BIOS R0300Y8 07/20/2010.

The current kernel version I'm troubleshooting with:
Linux version 3.2.0-40-generic (root@toddh-VPCEB13FX) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #64 SMP Mon Apr 22 01:46:03 MDT 2013 (Ubuntu 3.2.0-40.64-generic 3.2.40).

Look for updates to the attachments about the currently compiled kernel.
Comment 18 ToddH 2013-04-22 23:41:42 UTC
Created attachment 99761 [details]
ver-linux_20130422
Comment 19 ToddH 2013-04-22 23:45:42 UTC
Created attachment 99771 [details]
dmesg for 3.2.0-40-generic (toddh)
Comment 20 ToddH 2013-04-22 23:48:01 UTC
Created attachment 99781 [details]
grep BAT0 for 2.3.0-40-generic (toddh)
Comment 21 ToddH 2013-04-22 23:52:20 UTC
Created attachment 99791 [details]
acpidump for 3.2.0-40-generic (toddh) 20130422
Comment 22 Lan Tianyu 2013-05-14 08:46:42 UTC
(In reply to comment #17)
> A re-installation of Windows7 didn't solve the battery charging issue as
> hoped.
>  Fortunately, it allowed the BIOS update from Sony for improved fan control: 
> DMI: Sony Corporation VPCEB13FX/VAIO, BIOS R0300Y8 07/20/2010.
I found /sys/class/power_supply/BAT0/power_now always returned 0 which is from Bios. This will affect the charging/discharging rate. Windows also can not make it work. So this should be a Bios or hardware issue. So close this bug.


> 
> The current kernel version I'm troubleshooting with:
> Linux version 3.2.0-40-generic (root@toddh-VPCEB13FX) (gcc version 4.6.3
> (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #64 SMP Mon Apr 22 01:46:03 MDT 2013 (Ubuntu
> 3.2.0-40.64-generic 3.2.40).
> 
> Look for updates to the attachments about the currently compiled kernel.

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