10 Aug, 2012

1 commit


27 Jul, 2012

1 commit

  • Pull ACPI & power management update from Len Brown:
    "Re-write of the turbostat tool.
    lower overhead was necessary for measuring very large system when
    they are very idle.

    IVB support in intel_idle
    It's what I run on my IVB, others should be able to also:-)

    ACPICA core update
    We have found some bugs due to divergence between Linux and the
    upstream ACPICA base. Most of these patches are to reduce that
    divergence to reduce the risk of future bugs.

    Some cpuidle updates, mostly for non-Intel
    More will be coming, as they depend on this part.

    Some thermal management changes needed by non-ACPI systems.

    Some _OST (OS Status Indication) updates for hot ACPI hot-plug."

    * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (51 commits)
    Thermal: Documentation update
    Thermal: Add Hysteresis attributes
    Thermal: Make Thermal trip points writeable
    ACPI/AC: prevent OOPS on some boxes due to missing check power_supply_register() return value check
    tools/power: turbostat: fix large c1% issue
    tools/power: turbostat v2 - re-write for efficiency
    ACPICA: Update to version 20120711
    ACPICA: AcpiSrc: Fix some translation issues for Linux conversion
    ACPICA: Update header files copyrights to 2012
    ACPICA: Add new ACPI table load/unload external interfaces
    ACPICA: Split file: tbxface.c -> tbxfload.c
    ACPICA: Add PCC address space to space ID decode function
    ACPICA: Fix some comment fields
    ACPICA: Table manager: deploy new firmware error/warning interfaces
    ACPICA: Add new interfaces for BIOS(firmware) errors and warnings
    ACPICA: Split exception code utilities to a new file, utexcep.c
    ACPI: acpi_pad: tune round_robin_time
    ACPICA: Update to version 20120620
    ACPICA: Add support for implicit notify on multiple devices
    ACPICA: Update comments; no functional change
    ...

    Linus Torvalds
     

01 Jul, 2012

1 commit


02 Jun, 2012

1 commit

  • Added Capacity field, which is a pre-defined power_supply
    property. Calculating capacity using current charge/energy and
    full charge/energy.
    Some user mode implementations are relying on capacity field to
    show battery strength and power down decision.

    Signed-off-by: srinivas pandruvada
    Signed-off-by: Len Brown

    srinivas pandruvada
     

08 May, 2012

1 commit


04 Jan, 2012

1 commit


06 Aug, 2011

2 commits

  • Len Brown
     
  • Commit 9c921c22a7f33397a6774d7fa076db9b6a0fd669
    Author: Lan Tianyu

    ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()

    fixed BUG https://bugzilla.kernel.org/show_bug.cgi?id=35642 , but as a side
    effect made lockdep unhappy with sysfs_remove_battery():

    [14818.477168]
    [14818.477170] =======================================================
    [14818.477200] [ INFO: possible circular locking dependency detected ]
    [14818.477221] 3.1.0-dbg-07865-g1280ea8-dirty #668
    [14818.477236] -------------------------------------------------------
    [14818.477257] s2ram/1599 is trying to acquire lock:
    [14818.477276] (s_active#8){++++.+}, at: [] sysfs_addrm_finish+0x31/0x5a
    [14818.477323]
    [14818.477325] but task is already holding lock:
    [14818.477350] (&battery->lock){+.+.+.}, at: [] sysfs_remove_battery+0x10/0x4b [battery]
    [14818.477395]
    [14818.477397] which lock already depends on the new lock.
    [14818.477399]
    [..]
    [14818.479121] stack backtrace:
    [14818.479148] Pid: 1599, comm: s2ram Not tainted 3.1.0-dbg-07865-g1280ea8-dirty #668
    [14818.479175] Call Trace:
    [14818.479198] [] print_circular_bug+0x293/0x2a4
    [14818.479228] [] __lock_acquire+0xfe4/0x164b
    [14818.479260] [] ? sysfs_addrm_finish+0x31/0x5a
    [14818.479288] [] lock_acquire+0x138/0x1ac
    [14818.479316] [] ? sysfs_addrm_finish+0x31/0x5a
    [14818.479345] [] sysfs_deactivate+0x9b/0xec
    [14818.479373] [] ? sysfs_addrm_finish+0x31/0x5a
    [14818.479405] [] sysfs_addrm_finish+0x31/0x5a
    [14818.479433] [] sysfs_hash_and_remove+0x54/0x77
    [14818.479461] [] sysfs_remove_file+0x12/0x14
    [14818.479488] [] device_remove_file+0x12/0x14
    [14818.479516] [] device_del+0x119/0x17c
    [14818.479542] [] device_unregister+0xe/0x1a
    [14818.479570] [] power_supply_unregister+0x23/0x27
    [14818.479601] [] sysfs_remove_battery+0x34/0x4b [battery]
    [14818.479632] [] battery_notify+0x2c/0x3a [battery]
    [14818.479662] [] notifier_call_chain+0x74/0xa1
    [14818.479692] [] __blocking_notifier_call_chain+0x6c/0x89
    [14818.479722] [] blocking_notifier_call_chain+0xf/0x11
    [14818.479751] [] pm_notifier_call_chain+0x15/0x27
    [14818.479770] [] enter_state+0xa7/0xd5
    [14818.479782] [] state_store+0xaa/0xc0
    [14818.479795] [] ? pm_async_store+0x45/0x45
    [14818.479807] [] kobj_attr_store+0x17/0x19
    [14818.479820] [] sysfs_write_file+0x103/0x13f
    [14818.479834] [] vfs_write+0xad/0x13d
    [14818.479847] [] sys_write+0x45/0x6c
    [14818.479860] [] system_call_fastpath+0x16/0x1b

    This patch introduces separate lock to struct acpi_battery to
    grab in sysfs_remove_battery() instead of battery->lock.
    So fix by Lan Tianyu is still there, we just grab independent lock.

    Signed-off-by: Sergey Senozhatsky
    Tested-by: Lan Tianyu
    Signed-off-by: Len Brown

    Sergey Senozhatsky
     

03 Aug, 2011

2 commits

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (28 commits)
    ACPI: delete stale reference in kernel-parameters.txt
    ACPI: add missing _OSI strings
    ACPI: remove NID_INVAL
    thermal: make THERMAL_HWMON implementation fully internal
    thermal: split hwmon lookup to a separate function
    thermal: hide CONFIG_THERMAL_HWMON
    ACPI print OSI(Linux) warning only once
    ACPI: DMI workaround for Asus A8N-SLI Premium and Asus A8N-SLI DELUX
    ACPI / Battery: propagate sysfs error in acpi_battery_add()
    ACPI / Battery: avoid acpi_battery_add() use-after-free
    ACPI: introduce "acpi_rsdp=" parameter for kdump
    ACPI: constify ops structs
    ACPI: fix CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS
    ACPI: fix 80 char overflow
    ACPI / Battery: Resolve the race condition in the sysfs_remove_battery()
    ACPI / Battery: Add the check before refresh sysfs in the battery_notify()
    ACPI / Battery: Add the hibernation process in the battery_notify()
    ACPI / Battery: Rename acpi_battery_quirks2 with acpi_battery_quirks
    ACPI / Battery: Change 16-bit signed negative battery current into correct value
    ACPI / Battery: Add the power unit macro
    ...

    Linus Torvalds
     
  • …pm', 'kexec-param' and 'misc' into release

    Conflicts:
    Documentation/kernel-parameters.txt

    Signed-off-by: Len Brown <len.brown@intel.com>

    Len Brown
     

21 Jul, 2011

1 commit

  • All these are instances of
    #define NAME value;
    or
    #define NAME(params_opt) value;

    These of course fail to build when used in contexts like
    if(foo $OP NAME)
    while(bar $OP NAME)
    and may silently generate the wrong code in contexts such as
    foo = NAME + 1; /* foo = value; + 1; */
    bar = NAME - 1; /* bar = value; - 1; */
    baz = NAME & quux; /* baz = value; & quux; */

    Reported on comp.lang.c,
    Message-ID:
    Initial analysis of the dangers provided by Keith Thompson in that thread.

    There are many more instances of more complicated macros having unnecessary
    trailing semicolons, but this pile seems to be all of the cases of simple
    values suffering from the problem. (Thus things that are likely to be found
    in one of the contexts above, more complicated ones aren't.)

    Signed-off-by: Phil Carmody
    Signed-off-by: Jiri Kosina

    Phil Carmody
     

17 Jul, 2011

3 commits


14 Jul, 2011

6 commits


23 Mar, 2011

1 commit

  • Commit da8aeb92 re-poked the battery on resume, but Linus reports that
    it broke his eee and partially reverted it in b23fffd7. Unfortunately
    this also results in my x201s giving crack values until the sysfs files
    are poked again. In the revert message, it was suggested that we poke it
    from a PM notifier, so let's do that.

    With this in place, I haven't noticed the units going nutty on my
    gnome-power-manager across a dozen suspends or so...

    Signed-off-by: Kyle McMartin
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Kyle McMartin
     

21 Jan, 2011

1 commit

  • This partially reverts commit da8aeb92d4853f37e281f11fddf61f9c7d84c3cd
    ("ACPI / Battery: Update information on info notification and resume"),
    which causes a hang on resume on at least some machines.

    This bug was bisected on an ASUS EeePC 901, which hangs at resume time
    if we do that "acpi_battery_refresh(battery)" in the battery resume
    function.

    Rafael suspects we'll still need to refresh the sysfs files upon resume,
    but that that can be done from a PM notifier (that will run after
    thawing user space).

    Bisected-and-tested-by: Linus Torvalds
    Cc: Matthew Garrett
    Cc: Len Brown
    Acked-by: Rafael J. Wysocki
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

12 Jan, 2011

2 commits

  • A notification event 0x81 from an ACPI battery device requires us to
    re-read the battery information structure. Follow this requirement
    and remove and re-create the battery's attibutes in sysfs so that
    they reflect the reporting units used by the battery at the moment
    (those units may actually change sometimes at run time, which happens
    on some Thinkpads).

    The approach used in this patch was suggested by Matthew Garrett.

    Signed-off-by: Rafael J. Wysocki
    Reported-by: Matthew Garrett
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     
  • sysfs I/F for ACPI power devices, including AC and Battery,
    has been working in upstream kenrel since 2.6.24, Sep 2007.
    In 2.6.37, we made the sysfs I/F always built in and this option
    disabled by default.
    Now, we plan to remove this option and the ACPI power procfs
    interface in 2.6.39.

    First, update the feature-removal-schedule to announce this change.
    Second, add runtime warnings in ACPI AC/Battery/SBS driver, so that
    users will notice this change even if "make oldconfig" is used.

    Signed-off-by: Zhang Rui
    Signed-off-by: Len Brown

    Zhang Rui
     

25 Oct, 2010

1 commit


24 Oct, 2010

1 commit

  • The function acpi_battery_get_property() is called by the
    power supply framework's function power_supply_show_property()
    implementing the sysfs interface for power supply devices as the
    ACPI battery driver's ->get_property() callback. Thus it is supposed
    to return error code if the value of the given property is unknown.
    Unfortunately, however, it returns 0 in those cases and puts a
    wrong (negative) value into the intval field of the
    union power_supply_propval object provided by
    power_supply_show_property(). In consequence, wrong negative
    values are read by user space from the battery's sysfs files.

    Fix this by making acpi_battery_get_property() return -ENODEV
    for properties with unknown values (-ENODEV is returned, because
    power_supply_uevent() returns with error for any other error code
    returned by power_supply_show_property()).

    Reported-and-tested-by: Sitsofe Wheeler
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Len Brown

    Rafael J. Wysocki
     

22 Oct, 2010

1 commit

  • According to the ACPI spec, some kinds of primary battery can
    report percentage battery remaining capacity directly to OS.

    In this case, it reports the LastFullChargedCapacity == 100,
    BatteryPresentRate = 0xFFFFFFFF, and BatteryRemaingCapacity a
    percentage value, which actually means RemainingBatteryPercentage.

    Now we found some battery follows this rule even if it's a rechargeable.
    https://bugzilla.kernel.org/show_bug.cgi?id=15979

    Handle these batteries correctly in ACPI battery driver
    so that they won't break userspace.

    Signed-off-by: Zhang Rui
    Tested-by: Sitsofe Wheeler
    Signed-off-by: Len Brown

    Zhang Rui
     

16 Oct, 2010

1 commit


31 Aug, 2010

1 commit

  • ACPI batteries can report in units of either current or energy. Right
    now we expose the current_now file even if the battery is reporting
    energy units, resulting in a file that should contain mA instead
    containing mW. Don't expose this value unless the battery is reporting
    current.

    Signed-off-by: Matthew Garrett
    Cc: Arjan van de Ven
    Acked-by: Rafael J. Wysocki
    Acked-by: Zhang Rui
    Signed-off-by: Len Brown

    Matthew Garrett
     

07 Jul, 2010

1 commit


07 Apr, 2010

1 commit


05 Apr, 2010

2 commits


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

15 Mar, 2010

1 commit


28 Jan, 2010

1 commit


16 Jan, 2010

2 commits


16 Dec, 2009

1 commit


19 Sep, 2009

1 commit