1. 10 1月, 2013 1 次提交
    • L
      ACPICA: Cleanup updated comments. · 75c8044f
      Lv Zheng 提交于
      This is a cosmetic patch only. Comparison of the resulting binary showed
      only line number differences.
      
      This patch does not affect the generation of the Linux binary.
      This patch decreases 558 lines of 20121018 divergence.diff.
      
      This patch reduces the source code diff between Linux and ACPICA by
      cleaning the comments that already have been updated in ACPICA.
      
      There is no extra indentation done in this patch. Even the empty line
      deletions and insertions are also splitted into another cleanup patch so
      that this patch can be easily reviewed, and the binary differences can be
      held to a lowest level.
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      75c8044f
  2. 05 1月, 2013 1 次提交
  3. 03 1月, 2013 6 次提交
  4. 08 12月, 2012 2 次提交
  5. 05 12月, 2012 2 次提交
  6. 30 11月, 2012 2 次提交
  7. 29 11月, 2012 1 次提交
  8. 28 11月, 2012 1 次提交
  9. 27 11月, 2012 5 次提交
    • J
      cpuidle: Measure idle state durations with monotonic clock · a474a515
      Julius Werner 提交于
      Many cpuidle drivers measure their time spent in an idle state by
      reading the wallclock time before and after idling and calculating the
      difference. This leads to erroneous results when the wallclock time gets
      updated by another processor in the meantime, adding that clock
      adjustment to the idle state's time counter.
      
      If the clock adjustment was negative, the result is even worse due to an
      erroneous cast from int to unsigned long long of the last_residency
      variable. The negative 32 bit integer will zero-extend and result in a
      forward time jump of roughly four billion milliseconds or 1.3 hours on
      the idle state residency counter.
      
      This patch changes all affected cpuidle drivers to either use the
      monotonic clock for their measurements or make use of the generic time
      measurement wrapper in cpuidle.c, which was already working correctly.
      Some superfluous CLIs/STIs in the ACPI code are removed (interrupts
      should always already be disabled before entering the idle function, and
      not get reenabled until the generic wrapper has performed its second
      measurement). It also removes the erroneous cast, making sure that
      negative residency values are applied correctly even though they should
      not appear anymore.
      Signed-off-by: NJulius Werner <jwerner@chromium.org>
      Reviewed-by: NPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Tested-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: NLen Brown <len.brown@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a474a515
    • A
      ACPI: remove unnecessary INIT_LIST_HEAD · 752cad76
      Andy Shevchenko 提交于
      There is no need to initialize the node before appending it to the list.
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      752cad76
    • A
      ACPI / platform: include missed header into acpi_platform.c · 5923f986
      Andy Shevchenko 提交于
      The internal.h declares the acpi_create_platform_device(). Without
      that include we get a following warning:
      
      drivers/acpi/acpi_platform.c:133:24: warning: symbol 'acpi_create_platform_device' was not declared. Should it be static?
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Acked-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5923f986
    • S
      efi_pstore: Add a sequence counter to a variable name · 755d4fe4
      Seiji Aguchi 提交于
      [Issue]
      
      Currently, a variable name, which identifies each entry, consists of type, id and ctime.
      But if multiple events happens in a short time, a second/third event may fail to log because
      efi_pstore can't distinguish each event with current variable name.
      
      [Solution]
      
      A reasonable way to identify all events precisely is introducing a sequence counter to
      the variable name.
      
      The sequence counter has already supported in a pstore layer with "oopscount".
      So, this patch adds it to a variable name.
      Also, it is passed to read/erase callbacks of platform drivers in accordance with
      the modification of the variable name.
      
        <before applying this patch>
       a variable name of first event: dump-type0-1-12345678
       a variable name of second event: dump-type0-1-12345678
      
        type:0
        id:1
        ctime:12345678
      
       If multiple events happen in a short time, efi_pstore can't distinguish them because
       variable names are same among them.
      
        <after applying this patch>
      
       it can be distinguishable by adding a sequence counter as follows.
      
       a variable name of first event: dump-type0-1-1-12345678
       a variable name of Second event: dump-type0-1-2-12345678
      
        type:0
        id:1
        sequence counter: 1(first event), 2(second event)
        ctime:12345678
      
      In case of a write callback executed in pstore_console_write(), "0" is added to
      an argument of the write callback because it just logs all kernel messages and
      doesn't need to care about multiple events.
      Signed-off-by: NSeiji Aguchi <seiji.aguchi@hds.com>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NMike Waychison <mikew@google.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      755d4fe4
    • S
      efi_pstore: Add ctime to argument of erase callback · a9efd39c
      Seiji Aguchi 提交于
      [Issue]
      
      Currently, a variable name, which is used to identify each log entry, consists of type,
      id and ctime. But an erase callback does not use ctime.
      
      If efi_pstore supported just one log, type and id were enough.
      However, in case of supporting multiple logs, it doesn't work because
      it can't distinguish each entry without ctime at erasing time.
      
       <Example>
      
       As you can see below, efi_pstore can't differentiate first event from second one without ctime.
      
       a variable name of first event: dump-type0-1-12345678
       a variable name of second event: dump-type0-1-23456789
      
        type:0
        id:1
        ctime:12345678, 23456789
      
      [Solution]
      
      This patch adds ctime to an argument of an erase callback.
      
      It works across reboots because ctime of pstore means the date that the record was originally stored.
      To do this, efi_pstore saves the ctime to variable name at writing time and passes it to pstore
      at reading time.
      Signed-off-by: NSeiji Aguchi <seiji.aguchi@hds.com>
      Acked-by: NMike Waychison <mikew@google.com>
      Signed-off-by: NTony Luck <tony.luck@intel.com>
      a9efd39c
  10. 26 11月, 2012 1 次提交
  11. 24 11月, 2012 1 次提交
  12. 23 11月, 2012 2 次提交
  13. 22 11月, 2012 9 次提交
  14. 21 11月, 2012 3 次提交
    • R
      ACPI / platform: Initialize ACPI handles of platform devices in advance · 863f9f30
      Rafael J. Wysocki 提交于
      The current platform device creation and registration code in
      acpi_create_platform_device() is quite convoluted.  This function
      takes an ACPI device node as an argument and eventually calls
      platform_device_register_resndata() to create and register a
      platform device object on the basis of the information contained
      in that code.  However, it doesn't associate the new platform
      device with the ACPI node directly, but instead it relies on
      acpi_platform_notify(), called from within device_add(), to find
      that ACPI node again with the help of acpi_platform_find_device()
      and acpi_platform_match() and then attach the new platform device
      to it.  This causes an additional ACPI namespace walk to happen and
      is clearly suboptimal.
      
      Use the observation that it is now possible to initialize the ACPI
      handle of a device before calling device_add() for it to make this
      code more straightforward.  Namely, add a new field to struct
      platform_device_info allowing us to pass the ACPI handle of interest
      to platform_device_register_full(), which will then use it to
      initialize the new device's ACPI handle before registering it.
      This will cause acpi_platform_notify() to use the ACPI handle from
      the device structure directly instead of using the .find_device()
      routine provided by the device's bus type.  In consequence,
      acpi_platform_bus, acpi_platform_find_device(), and
      acpi_platform_match() are not necessary any more, so remove them.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      863f9f30
    • R
      ACPI / driver core: Introduce struct acpi_dev_node and related macros · 95f8a082
      Rafael J. Wysocki 提交于
      To avoid adding an ACPI handle pointer to struct device on
      architectures that don't use ACPI, or generally when CONFIG_ACPI is
      not set, in which cases that pointer is useless, define struct
      acpi_dev_node that will contain the handle pointer if CONFIG_ACPI is
      set and will be empty otherwise and use it to represent the ACPI
      device node field in struct device.
      
      In addition to that define macros for reading and setting the ACPI
      handle of a device that don't generate code when CONFIG_ACPI is
      unset.  Modify the ACPI subsystem to use those macros instead of
      referring to the given device's ACPI handle directly.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      95f8a082
    • R
      ACPI: Allow ACPI handles of devices to be initialized in advance · f3fd0c8a
      Rafael J. Wysocki 提交于
      Currently, the ACPI handles of devices are initialized from within
      device_add(), by acpi_bind_one() called from acpi_platform_notify()
      which first uses the .find_device() routine provided by the device's
      bus type to find the matching device node in the ACPI namespace.
      This is a source of some computational overhead and, moreover, the
      correctness of the result depends on the implementation of
      .find_device() which is known to fail occasionally for some bus types
      (e.g. PCI).  In some cases, however, the corresponding ACPI device
      node is known already before calling device_add() for the given
      struct device object and the whole .find_device() dance in
      acpi_platform_notify() is then simply unnecessary.
      
      For this reason, make it possible to initialize the ACPI handles of
      devices before calling device_add() for them.  Modify
      acpi_platform_notify() to call acpi_bind_one() in advance to check
      the device's existing ACPI handle and skip the .find_device()
      search if that is successful.  Change acpi_bind_one() accordingly.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      f3fd0c8a
  15. 19 11月, 2012 1 次提交
  16. 17 11月, 2012 2 次提交
    • K
      ACPI / battery: Correct battery capacity values on Thinkpads · 4000e626
      Kamil Iskra 提交于
      Add a quirk to correctly report battery capacity on 2010 and 2011
      Lenovo Thinkpad models.
      
      The affected models that I tested (x201, t410, t410s, and x220)
      exhibit a problem where, when battery capacity reporting unit is mAh,
      the values being reported are wrong.  Pre-2010 and 2012 models appear
      to always report in mWh and are thus unaffected.  Also, in mid-2012
      Lenovo issued a BIOS update for the 2011 models that fixes the issue
      (tested on x220 with a post-1.29 BIOS).  No such update is available
      for the 2010 models, so those still need this patch.
      
      Problem description: for some reason, the affected Thinkpads switch
      the reporting unit between mAh and mWh; generally, mAh is used when a
      laptop is plugged in and mWh when it's unplugged, although a
      suspend/resume or rmmod/modprobe is needed for the switch to take
      effect.  The values reported in mAh are *always* wrong.  This does
      not appear to be a kernel regression; I believe that the values were
      never reported correctly.  I tested back to kernel 2.6.34, with
      multiple machines and BIOS versions.
      
      Simply plugging a laptop into mains before turning it on is enough to
      reproduce the problem.  Here's a sample /proc/acpi/battery/BAT0/info
      from Thinkpad x220 (before a BIOS update) with a 4-cell battery:
      
      present:                 yes
      design capacity:         2886 mAh
      last full capacity:      2909 mAh
      battery technology:      rechargeable
      design voltage:          14800 mV
      design capacity warning: 145 mAh
      design capacity low:     13 mAh
      cycle count:              0
      capacity granularity 1:  1 mAh
      capacity granularity 2:  1 mAh
      model number:            42T4899
      serial number:           21064
      battery type:            LION
      OEM info:                SANYO
      
      Once the laptop switches the unit to mWh (unplug from mains, suspend,
      resume), the output changes to:
      
      present:                 yes
      design capacity:         28860 mWh
      last full capacity:      29090 mWh
      battery technology:      rechargeable
      design voltage:          14800 mV
      design capacity warning: 1454 mWh
      design capacity low:     200 mWh
      cycle count:              0
      capacity granularity 1:  1 mWh
      capacity granularity 2:  1 mWh
      model number:            42T4899
      serial number:           21064
      battery type:            LION
      OEM info:                SANYO
      
      Can you see how the values for "design capacity", etc., differ by a
      factor of 10 instead of 14.8 (the design voltage of this battery)?
      On the battery itself it says: 14.8V, 1.95Ah, 29Wh, so clearly the
      values reported in mWh are correct and the ones in mAh are not.
      
      My guess is that this problem has been around ever since those
      machines were released, but because the most common Thinkpad
      batteries are rated at 10.8V, the error (8%) is small enough that it
      simply hasn't been noticed or at least nobody could be bothered to
      look into it.
      
      My patch works around the problem by adjusting the incorrectly
      reported mAh values by "10000 / design_voltage".  The patch also has
      code to figure out if it should be activated or not.  It only
      activates on Lenovo Thinkpads, only when the unit is mAh, and, as an
      extra precaution, only when the battery capacity reported through
      ACPI does not match what is reported through DMI (I've never
      encountered a machine where the first two conditions would be true
      but the last would not, but better safe than sorry).
      
      I've been using this patch for close to a year on several systems
      without any problems.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=41062Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4000e626
    • R
      ACPI / resources: Use AE_CTRL_TERMINATE to terminate resources walks · 8a66790b
      Rafael J. Wysocki 提交于
      Currently acpi_dev_process_resource() returns AE_ABORT_METHOD
      to terminate the acpi_walk_resources() it is called from if
      the .preproc() routine provided by the caller of
      acpi_dev_get_resources() initiating the resources walk returns
      an error code.  It is better to use AE_CTRL_TERMINATE for this
      purpose, however, so do that.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      8a66790b