Bug 60110 - The check for reasonable values of time_to_empty/time_to_full is unreasonable
Summary: The check for reasonable values of time_to_empty/time_to_full is unreasonable
Status: RESOLVED FIXED
Alias: None
Product: upower
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-31 09:33 UTC by Alex Hornung
Modified: 2013-01-31 11:26 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Alex Hornung 2013-01-31 09:33:15 UTC
The following code is fairly unreasonable. Think for example of a tablet - if it's idle with the screen off, I'd very much hope that the battery would last more than 20 hours.

I can provide a patch, but I think it's just as straight forward for you guys to fix it with a value you consider reasonable - however it should be at least 240 hours (10 days) in my opinion. You might also want to consider removing it completely, it's simply not suitable for devices with a long battery life (in idle).


        /* check the remaining time is under a set limit, to deal with broken
           primary batteries rate */
        if (time_to_empty > (20 * 60 * 60))
                time_to_empty = 0;
        if (time_to_full > (20 * 60 * 60))
                time_to_full = 0;
Comment 1 Martin Pitt 2013-01-31 09:55:49 UTC
Presumably this is still from a time when we used to have lots of scale errors in kernel drivers, such as multiplying by 10.000 instead of 1.000 and so on (like https://bugs.launchpad.net/ubuntu/+source/upower/+bug/1093543/+attachment/3508103/+files/0001-power-bq27541_battery-fix-units-of-energy_now.patch :) ).

But indeed these days we live in times where we cannot assume plausible battery lifes to be within one magnitude. I think the "time to full" check is still valid, as it's implausible for charging to take more than 20 hours. But I agree that we should at least bump the "time to empty" to 200 hours. Even on my X201 I get regular battery lifes of 12 hours, and on ARM devices it's going to be a lot more.

Richard, WDYT about bumping this to 240 hours or dropping that part completely?


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.