30 Dec, 2014

1 commit

  • * pm-cpufreq:
    cpufreq: fix a NULL pointer dereference in __cpufreq_governor()
    cpufreq-dt: defer probing if OPP table is not ready

    * pm-cpuidle:
    cpuidle / ACPI: remove unused CPUIDLE_FLAG_TIME_INVALID
    cpuidle: ladder: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID
    cpuidle: menu: Better idle duration measurement without using CPUIDLE_FLAG_TIME_INVALID

    Rafael J. Wysocki
     

17 Dec, 2014

1 commit

  • CPUIDLE_FLAG_TIME_INVALID is no longer checked
    by menu or ladder cpuidle governors, so don't
    bother setting or defining it.

    It was originally invented to account for the fact that
    acpi_safe_halt() enables interrupts to invoke HLT.
    That would allow interrupt service routines to be included
    in the last_idle duration measurements made in cpuidle_enter_state(),
    potentially returning a duration much larger than reality.

    But menu and ladder can gracefully handle erroneously large duration
    intervals without checking for CPUIDLE_FLAG_TIME_INVALID.
    Further, if they don't check CPUIDLE_FLAG_TIME_INVALID, they
    can also benefit from the instances when the duration interval
    is not erroneously large.

    Signed-off-by: Len Brown
    Acked-by: Daniel Lezcano
    Signed-off-by: Rafael J. Wysocki

    Len Brown
     

09 Dec, 2014

1 commit

  • * pm-cpuidle:
    cpuidle: add MAINTAINERS entry for ARM Exynos cpuidle driver
    drivers: cpuidle: Remove cpuidle-arm64 duplicate error messages
    drivers: cpuidle: Add idle-state-name description to ARM idle states
    drivers: cpuidle: Add status property to ARM idle states
    cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic

    Rafael J. Wysocki
     

26 Nov, 2014

1 commit


13 Nov, 2014

1 commit

  • The only place where the time is invalid is when the ACPI_CSTATE_FFH entry
    method is not set. Otherwise for all the drivers, the time can be correctly
    measured.

    Instead of duplicating the CPUIDLE_FLAG_TIME_VALID flag in all the drivers
    for all the states, just invert the logic by replacing it by the flag
    CPUIDLE_FLAG_TIME_INVALID, hence we can set this flag only for the acpi idle
    driver, remove the former flag from all the drivers and invert the logic with
    this flag in the different governor.

    Signed-off-by: Daniel Lezcano
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     

04 Sep, 2014

1 commit

  • There is a following AB-BA dependency between cpu_hotplug.lock and
    cpuidle_lock:

    1) cpu_hotplug.lock -> cpuidle_lock
    enable_nonboot_cpus()
    _cpu_up()
    cpu_hotplug_begin()
    LOCK(cpu_hotplug.lock)
    cpu_notify()
    ...
    acpi_processor_hotplug()
    cpuidle_pause_and_lock()
    LOCK(cpuidle_lock)

    2) cpuidle_lock -> cpu_hotplug.lock
    acpi_os_execute_deferred() workqueue
    ...
    acpi_processor_cst_has_changed()
    cpuidle_pause_and_lock()
    LOCK(cpuidle_lock)
    get_online_cpus()
    LOCK(cpu_hotplug.lock)

    Fix this by reversing the order acpi_processor_cst_has_changed() does
    thigs -- let it first execute the protection against CPU hotplug by
    calling get_online_cpus() and obtain the cpuidle lock only after that (and
    perform the symmentric change when allowing CPUs hotplug again and
    dropping cpuidle lock).

    Spotted by lockdep.

    Signed-off-by: Jiri Kosina
    Cc: All applicable
    Signed-off-by: Rafael J. Wysocki

    Jiri Kosina
     

25 Jan, 2014

1 commit

  • Pull ACPI and power management updates from Rafael Wysocki:
    "As far as the number of commits goes, the top spot belongs to ACPI
    this time with cpufreq in the second position and a handful of PM
    core, PNP and cpuidle updates. They are fixes and cleanups mostly, as
    usual, with a couple of new features in the mix.

    The most visible change is probably that we will create struct
    acpi_device objects (visible in sysfs) for all devices represented in
    the ACPI tables regardless of their status and there will be a new
    sysfs attribute under those objects allowing user space to check that
    status via _STA.

    Consequently, ACPI device eject or generally hot-removal will not
    delete those objects, unless the table containing the corresponding
    namespace nodes is unloaded, which is extremely rare. Also ACPI
    container hotplug will be handled quite a bit differently and cpufreq
    will support CPU boost ("turbo") generically and not only in the
    acpi-cpufreq driver.

    Specifics:

    - ACPI core changes to make it create a struct acpi_device object for
    every device represented in the ACPI tables during all namespace
    scans regardless of the current status of that device. In
    accordance with this, ACPI hotplug operations will not delete those
    objects, unless the underlying ACPI tables go away.

    - On top of the above, new sysfs attribute for ACPI device objects
    allowing user space to check device status by triggering the
    execution of _STA for its ACPI object. From Srinivas Pandruvada.

    - ACPI core hotplug changes reducing code duplication, integrating
    the PCI root hotplug with the core and reworking container hotplug.

    - ACPI core simplifications making it use ACPI_COMPANION() in the
    code "glueing" ACPI device objects to "physical" devices.

    - ACPICA update to upstream version 20131218. This adds support for
    the DBG2 and PCCT tables to ACPICA, fixes some bugs and improves
    debug facilities. From Bob Moore, Lv Zheng and Betty Dall.

    - Init code change to carry out the early ACPI initialization
    earlier. That should allow us to use ACPI during the timekeeping
    initialization and possibly to simplify the EFI initialization too.
    From Chun-Yi Lee.

    - Clenups of the inclusions of ACPI headers in many places all over
    from Lv Zheng and Rashika Kheria (work in progress).

    - New helper for ACPI _DSM execution and rework of the code in
    drivers that uses _DSM to execute it via the new helper. From
    Jiang Liu.

    - New Win8 OSI blacklist entries from Takashi Iwai.

    - Assorted ACPI fixes and cleanups from Al Stone, Emil Goode, Hanjun
    Guo, Lan Tianyu, Masanari Iida, Oliver Neukum, Prarit Bhargava,
    Rashika Kheria, Tang Chen, Zhang Rui.

    - intel_pstate driver updates, including proper Baytrail support,
    from Dirk Brandewie and intel_pstate documentation from Ramkumar
    Ramachandra.

    - Generic CPU boost ("turbo") support for cpufreq from Lukasz
    Majewski.

    - powernow-k6 cpufreq driver fixes from Mikulas Patocka.

    - cpufreq core fixes and cleanups from Viresh Kumar, Jane Li, Mark
    Brown.

    - Assorted cpufreq drivers fixes and cleanups from Anson Huang, John
    Tobias, Paul Bolle, Paul Walmsley, Sachin Kamat, Shawn Guo, Viresh
    Kumar.

    - cpuidle cleanups from Bartlomiej Zolnierkiewicz.

    - Support for hibernation APM events from Bin Shi.

    - Hibernation fix to avoid bringing up nonboot CPUs with ACPI EC
    disabled during thaw transitions from Bjørn Mork.

    - PM core fixes and cleanups from Ben Dooks, Leonardo Potenza, Ulf
    Hansson.

    - PNP subsystem fixes and cleanups from Dmitry Torokhov, Levente
    Kurusa, Rashika Kheria.

    - New tool for profiling system suspend from Todd E Brandt and a
    cpupower tool cleanup from One Thousand Gnomes"

    * tag 'pm+acpi-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (153 commits)
    thermal: exynos: boost: Automatic enable/disable of BOOST feature (at Exynos4412)
    cpufreq: exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ
    Documentation: cpufreq / boost: Update BOOST documentation
    cpufreq: exynos: Extend Exynos cpufreq driver to support boost
    cpufreq / boost: Kconfig: Support for software-managed BOOST
    acpi-cpufreq: Adjust the code to use the common boost attribute
    cpufreq: Add boost frequency support in core
    intel_pstate: Add trace point to report internal state.
    cpufreq: introduce cpufreq_generic_get() routine
    ARM: SA1100: Create dummy clk_get_rate() to avoid build failures
    cpufreq: stats: create sysfs entries when cpufreq_stats is a module
    cpufreq: stats: free table and remove sysfs entry in a single routine
    cpufreq: stats: remove hotplug notifiers
    cpufreq: stats: handle cpufreq_unregister_driver() and suspend/resume properly
    cpufreq: speedstep: remove unused speedstep_get_state
    platform: introduce OF style 'modalias' support for platform bus
    PM / tools: new tool for suspend/resume performance optimization
    ACPI: fix module autoloading for ACPI enumerated devices
    ACPI: add module autoloading support for ACPI enumerated devices
    ACPI: fix create_modalias() return value handling
    ...

    Linus Torvalds
     

17 Jan, 2014

1 commit

  • * pm-cpuidle:
    intel_idle: remove superfluous dev->state_count initialization
    intel_idle: do C1E promotion disable quirk for hotplugged CPUs
    ACPI / cpuidle: remove dev->state_count setting
    ACPI / cpuidle: fix max idle state handling with hotplug CPU support
    POWERPC: pseries: cpuidle: use the common cpuidle_[un]register() routines
    POWERPC: pseries: cpuidle: remove superfluous dev->state_count initialization
    ARM: EXYNOS: cpuidle: fix AFTR mode check

    Rafael J. Wysocki
     

11 Jan, 2014

2 commits

  • dev->state_count is now always equal to drv->state_count and
    drv->state_count no longer can change during driver's lifetime so
    the default dev->state_count initialization in cpuidle_enable_device()
    (called from cpuidle_register_device()) can be used instead.

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Kyungmin Park
    Cc: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Bartlomiej Zolnierkiewicz
     
  • acpi_processor_hotplug() calls acpi_processor_setup_cpuidle_cx()
    without calling acpi_processor_setup_cpuidle_states() first so it
    is possible that dev->state_count becomes different from
    drv->state_count (in case of SMP system with unsupported C2/C3
    states + enabled CPU hotplug and num_online_cpus() becoming > 1).

    The driver code assumes that cpuidle core will handle such cases
    but currently this is untrue (dev->state_count is used only for
    handling cpuidle state sysfs entries and drv->state_count is used
    for all other cases) and will not be fixed in the future as
    dev->state_count is planned to be removed.

    Fix the issue by checking for the max supported idle state in
    C2/C3 state's ->enter handler (acpi_idle_enter_simple() for C2/C3
    and acpi_idle_enter_bm() for C3 + bm_check flag set) and setting
    the C1 state (instead of higher states) when needed.

    Also remove no longer needed max idle state checks from
    acpi_processor_setup_cpuidle_[states,cx]().

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Kyungmin Park
    Cc: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Bartlomiej Zolnierkiewicz
     

20 Dec, 2013

1 commit

  • People seem to delight in writing wrong and broken mwait idle routines;
    collapse the lot.

    This leaves mwait_play_dead() the sole remaining user of __mwait() and
    new __mwait() users are probably doing it wrong.

    Also remove __sti_mwait() as its unused.

    Cc: Arjan van de Ven
    Cc: Jacob Jun Pan
    Cc: Mike Galbraith
    Cc: Len Brown
    Cc: Rui Zhang
    Acked-by: Rafael Wysocki
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20131212141654.616820819@infradead.org
    Signed-off-by: H. Peter Anvin

    Peter Zijlstra
     

19 Dec, 2013

1 commit


07 Dec, 2013

2 commits

  • Minor cleanup: remove some extra trailing white space.

    Signed-off-by: Al Stone
    Signed-off-by: Rafael J. Wysocki

    Al Stone
     
  • Replace direct inclusions of , and
    , which are incorrect, with
    inclusions and remove some inclusions of those files that aren't
    necessary.

    First of all, , and
    should not be included directly from any files that are built for
    CONFIG_ACPI unset, because that generally leads to build warnings about
    undefined symbols in !CONFIG_ACPI builds. For CONFIG_ACPI set,
    includes those files and for CONFIG_ACPI unset it
    provides stub ACPI symbols to be used in that case.

    Second, there are ordering dependencies between those files that always
    have to be met. Namely, it is required that be included
    prior to so that the acpi_pci_root declarations the
    latter depends on are always there. And which provides
    basic ACPICA type declarations should always be included prior to any other
    ACPI headers in CONFIG_ACPI builds. That also is taken care of including
    as appropriate.

    Signed-off-by: Lv Zheng
    Cc: Greg Kroah-Hartman
    Cc: Matthew Garrett
    Cc: Tony Luck
    Cc: "H. Peter Anvin"
    Acked-by: Bjorn Helgaas (drivers/pci stuff)
    Acked-by: Konrad Rzeszutek Wilk (Xen stuff)
    Signed-off-by: Rafael J. Wysocki

    Lv Zheng
     

14 Nov, 2013

1 commit

  • Pull ACPI and power management updates from Rafael J Wysocki:

    - New power capping framework and the the Intel Running Average Power
    Limit (RAPL) driver using it from Srinivas Pandruvada and Jacob Pan.

    - Addition of the in-kernel switching feature to the arm_big_little
    cpufreq driver from Viresh Kumar and Nicolas Pitre.

    - cpufreq support for iMac G5 from Aaro Koskinen.

    - Baytrail processors support for intel_pstate from Dirk Brandewie.

    - cpufreq support for Midway/ECX-2000 from Mark Langsdorf.

    - ARM vexpress/TC2 cpufreq support from Sudeep KarkadaNagesha.

    - ACPI power management support for the I2C and SPI bus types from Mika
    Westerberg and Lv Zheng.

    - cpufreq core fixes and cleanups from Viresh Kumar, Srivatsa S Bhat,
    Stratos Karafotis, Xiaoguang Chen, Lan Tianyu.

    - cpufreq drivers updates (mostly fixes and cleanups) from Viresh
    Kumar, Aaro Koskinen, Jungseok Lee, Sudeep KarkadaNagesha, Lukasz
    Majewski, Manish Badarkhe, Hans-Christian Egtvedt, Evgeny Kapaev.

    - intel_pstate updates from Dirk Brandewie and Adrian Huang.

    - ACPICA update to version 20130927 includig fixes and cleanups and
    some reduction of divergences between the ACPICA code in the kernel
    and ACPICA upstream in order to improve the automatic ACPICA patch
    generation process. From Bob Moore, Lv Zheng, Tomasz Nowicki, Naresh
    Bhat, Bjorn Helgaas, David E Box.

    - ACPI IPMI driver fixes and cleanups from Lv Zheng.

    - ACPI hotplug fixes and cleanups from Bjorn Helgaas, Toshi Kani, Zhang
    Yanfei, Rafael J Wysocki.

    - Conversion of the ACPI AC driver to the platform bus type and
    multiple driver fixes and cleanups related to ACPI from Zhang Rui.

    - ACPI processor driver fixes and cleanups from Hanjun Guo, Jiang Liu,
    Bartlomiej Zolnierkiewicz, Mathieu Rhéaume, Rafael J Wysocki.

    - Fixes and cleanups and new blacklist entries related to the ACPI
    video support from Aaron Lu, Felipe Contreras, Lennart Poettering,
    Kirill Tkhai.

    - cpuidle core cleanups from Viresh Kumar and Lorenzo Pieralisi.

    - cpuidle drivers fixes and cleanups from Daniel Lezcano, Jingoo Han,
    Bartlomiej Zolnierkiewicz, Prarit Bhargava.

    - devfreq updates from Sachin Kamat, Dan Carpenter, Manish Badarkhe.

    - Operation Performance Points (OPP) core updates from Nishanth Menon.

    - Runtime power management core fix from Rafael J Wysocki and update
    from Ulf Hansson.

    - Hibernation fixes from Aaron Lu and Rafael J Wysocki.

    - Device suspend/resume lockup detection mechanism from Benoit Goby.

    - Removal of unused proc directories created for various ACPI drivers
    from Lan Tianyu.

    - ACPI LPSS driver fix and new device IDs for the ACPI platform scan
    handler from Heikki Krogerus and Jarkko Nikula.

    - New ACPI _OSI blacklist entry for Toshiba NB100 from Levente Kurusa.

    - Assorted fixes and cleanups related to ACPI from Andy Shevchenko, Al
    Stone, Bartlomiej Zolnierkiewicz, Colin Ian King, Dan Carpenter,
    Felipe Contreras, Jianguo Wu, Lan Tianyu, Yinghai Lu, Mathias Krause,
    Liu Chuansheng.

    - Assorted PM fixes and cleanups from Andy Shevchenko, Thierry Reding,
    Jean-Christophe Plagniol-Villard.

    * tag 'pm+acpi-3.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (386 commits)
    cpufreq: conservative: fix requested_freq reduction issue
    ACPI / hotplug: Consolidate deferred execution of ACPI hotplug routines
    PM / runtime: Use pm_runtime_put_sync() in __device_release_driver()
    ACPI / event: remove unneeded NULL pointer check
    Revert "ACPI / video: Ignore BIOS initial backlight value for HP 250 G1"
    ACPI / video: Quirk initial backlight level 0
    ACPI / video: Fix initial level validity test
    intel_pstate: skip the driver if ACPI has power mgmt option
    PM / hibernate: Avoid overflow in hibernate_preallocate_memory()
    ACPI / hotplug: Do not execute "insert in progress" _OST
    ACPI / hotplug: Carry out PCI root eject directly
    ACPI / hotplug: Merge device hot-removal routines
    ACPI / hotplug: Make acpi_bus_hot_remove_device() internal
    ACPI / hotplug: Simplify device ejection routines
    ACPI / hotplug: Fix handle_root_bridge_removal()
    ACPI / hotplug: Refuse to hot-remove all objects with disabled hotplug
    ACPI / scan: Start matching drivers after trying scan handlers
    ACPI: Remove acpi_pci_slot_init() headers from internal.h
    ACPI / blacklist: fix name of ThinkPad Edge E530
    PowerCap: Fix build error with option -Werror=format-security
    ...

    Conflicts:
    arch/arm/mach-omap2/opp.c
    drivers/Kconfig
    drivers/spi/spi.c

    Linus Torvalds
     

25 Sep, 2013

1 commit

  • Mike reported that commit 7d1a9417 ("x86: Use generic idle loop")
    regressed several workloads and caused excessive reschedule
    interrupts.

    The patch in question failed to notice that the x86 code had an
    inverted sense of the polling state versus the new generic code (x86:
    default polling, generic: default !polling).

    Fix the two prominent x86 mwait based idle drivers and introduce a few
    new generic polling helpers (fixing the wrong smp_mb__after_clear_bit
    usage).

    Also switch the idle routines to using tif_need_resched() which is an
    immediate TIF_NEED_RESCHED test as opposed to need_resched which will
    end up being slightly different.

    Reported-by: Mike Galbraith
    Signed-off-by: Peter Zijlstra
    Cc: lenb@kernel.org
    Cc: tglx@linutronix.de
    Link: http://lkml.kernel.org/n/tip-nc03imb0etuefmzybzj7sprf@git.kernel.org
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

24 Sep, 2013

1 commit

  • The only acpi_processor_get_power_info_fadt() user
    (acpi_processor_get_power_info()) dereferences pr before calling
    the function.

    The only acpi_processor_hotplug() user (acpi_cpu_soft_notify())
    checks for pr == NULL before calling the function.

    The only acpi_processor_cst_has_changed() user (acpi_processor_notify())
    checks for pr == NULL before calling the function.

    The only acpi_processor_power_init() user (__acpi_processor_start())
    dereferences pr before calling the function.

    Thus remove superfluous pr == NULL checks from affected functions.

    Also:

    While at it remove redundant brackets from acpi_processor_hotplug().

    Signed-off-by: Bartlomiej Zolnierkiewicz
    Signed-off-by: Kyungmin Park
    Signed-off-by: Rafael J. Wysocki

    Bartlomiej Zolnierkiewicz
     

15 Jul, 2013

1 commit

  • The __cpuinit type of throwaway sections might have made sense
    some time ago when RAM was more constrained, but now the savings
    do not offset the cost and complications. For example, the fix in
    commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
    is a good example of the nasty type of bugs that can be created
    with improper use of the various __init prefixes.

    After a discussion on LKML[1] it was decided that cpuinit should go
    the way of devinit and be phased out. Once all the users are gone,
    we can then finally remove the macros themselves from linux/init.h.

    This removes all the drivers/acpi uses of the __cpuinit macros
    from all C files.

    [1] https://lkml.org/lkml/2013/5/20/589

    Cc: Len Brown
    Cc: "Rafael J. Wysocki"
    Cc: linux-acpi@vger.kernel.org
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

20 Jun, 2013

1 commit


12 May, 2013

1 commit

  • The system suspend routine of the ACPI processor driver saves
    the BUS_MASTER_RLD register and its resume routine restores it.
    However, there can be only one such register in the system and it
    really should be saved after non-boot CPUs have been offlined and
    restored before they are put back online during resume.

    For this reason, move the saving and restoration of BUS_MASTER_RLD
    to syscore suspend and syscore resume, respectively, and drop the no
    longer necessary suspend/resume callbacks from the ACPI processor
    driver.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

23 Apr, 2013

1 commit

  • The en_core_tk_irqen flag is set in all the cpuidle driver which
    means it is not necessary to specify this flag.

    Remove the flag and the code related to it.

    Signed-off-by: Daniel Lezcano
    Acked-by: Kevin Hilman # for mach-omap2/*
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     

02 Apr, 2013

1 commit

  • Commit ac3ebafa81af76d6 "ACPI / idle: remove usage of the statedata"
    changed the percpu processor cstate to a unified cstate in ACPI idle.
    That caused all our NHM boxes to boot hang or panic.

    2178751 Task dump for CPU 1:
    2178752 swapper/1 R running task 6736 0 1 0x00000000
    2178753 ffff8801e8029dc8 ffffffff8101cf96 ffff8801e8029e28 ffffffff813d294b
    2178754 0000000000000f99 0000000000000003 00000000003cf654 0000000025c17d03
    2178755 ffff8801e8029e38 ffff8801e74fc000 00000002590dc5c4 ffffffff8163cdb0
    2178756 Call Trace:
    2178757 [] ? acpi_processor_ffh_cstate_enter+0x2d/0x2f
    2178758 [] acpi_idle_enter_bm+0x1b1/0x236
    2178759 [] ? disable_cpuidle+0x10/0x10
    2178760 [] cpuidle_enter+0x12/0x14
    2178761 [] cpuidle_wrap_enter+0x2f/0x6d
    2178762 [] cpuidle_enter_tk+0x10/0x12
    2178763 [] cpuidle_enter_state+0x12/0x3a
    2178764 [] cpuidle_idle_call+0xe8/0x161
    2178765 [] cpu_idle+0x5e/0xa4
    2178766 [] start_secondary+0x1a9/0x1ad
    2178767 Task dump for CPU 2:

    In fact, the ACPI idle is based on the assumption of difference percpu
    cstate structures that are necessary for the implementation to work
    cprrectly. A unique acpi_processor_cx is not sifficient by far.

    This patch is just a quick fix re-introducing the percpu cstates.

    If someone really wants to unify the ACPI cstates, please make sure
    that the whole software infrastructure is changed and take hardware
    as well as many different kinds of BIOS settings into account.

    [rjw: Changelog]
    Reported-by: LKP project
    Reported-by: Xie ChanglongX
    Tested-by: Yinghai Lu
    Signed-off-by: Alex Shi
    Signed-off-by: Rafael J. Wysocki

    Alex Shi
     

18 Feb, 2013

1 commit


10 Feb, 2013

1 commit

  • mwait_idle() is a C1-only idle loop intended to be more efficient
    than HLT, starting on Pentium-4 HT-enabled processors.

    But mwait_idle() has been replaced by the more general
    mwait_idle_with_hints(), which handles both C1 and deeper C-states.
    ACPI processor_idle and intel_idle use only mwait_idle_with_hints(),
    and no longer use mwait_idle().

    Here we simplify the x86 native idle code by removing mwait_idle(),
    and the "idle=mwait" bootparam used to invoke it.

    Since Linux 3.0 there has been a boot-time warning when "idle=mwait"
    was invoked saying it would be removed in 2012. This removal
    was also noted in the (now removed:-) feature-removal-schedule.txt.

    After this change, kernels configured with
    (CONFIG_ACPI=n && CONFIG_INTEL_IDLE=n) when run on hardware
    that supports MWAIT will simply use HLT. If MWAIT is desired
    on those systems, cpuidle and the cpuidle drivers above
    can be enabled.

    Signed-off-by: Len Brown
    Cc: x86@kernel.org

    Len Brown
     

09 Feb, 2013

4 commits


19 Jan, 2013

1 commit


18 Jan, 2013

1 commit

  • If cpuidle is disabled, that means that:

    per_cpu(acpi_cpuidle_device, pr->id)

    is set to NULL as the acpi_processor_power_init ends up failing at

    retval = cpuidle_register_driver(&acpi_idle_driver)

    (in acpi_processor_power_init) and never sets the per_cpu idle
    device. So when acpi_processor_hotplug on CPU online notification
    tries to reference said device it crashes:

    cpu 3 spinlock event irq 62
    BUG: unable to handle kernel NULL pointer dereference at 0000000000000004
    IP: [] acpi_processor_setup_cpuidle_cx+0x3f/0x105
    PGD a259b067 PUD ab38b067 PMD 0
    Oops: 0002 [#1] SMP
    odules linked in: dm_multipath dm_mod xen_evtchn iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi libcrc32c crc32c nouveau mxm_wmi wmi radeon ttm sg sr_mod sd_mod cdrom ata_generic ata_piix libata crc32c_intel scsi_mod atl1c i915 fbcon tileblit font bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf
    CPU 1
    Pid: 3047, comm: bash Not tainted 3.8.0-rc3upstream-00250-g165c029 #1 MSI MS-7680/H61M-P23 (MS-7680)
    RIP: e030:[] [] acpi_processor_setup_cpuidle_cx+0x3f/0x105
    RSP: e02b:ffff88001742dca8 EFLAGS: 00010202
    RAX: 0000000000010be9 RBX: ffff8800a0a61800 RCX: ffff880105380000
    RDX: 0000000000000003 RSI: 0000000000000200 RDI: ffff8800a0a61800
    RBP: ffff88001742dce8 R08: ffffffff81812360 R09: 0000000000000200
    R10: aaaaaaaaaaaaaaaa R11: 0000000000000001 R12: ffff8800a0a61800
    R13: 00000000ffffff01 R14: 0000000000000000 R15: ffffffff81a907a0
    FS: 00007fd6942f7700(0000) GS:ffff880105280000(0000) knlGS:0000000000000000
    CS: e033 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 0000000000000004 CR3: 00000000a6773000 CR4: 0000000000042660
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Process bash (pid: 3047, threadinfo ffff88001742c000, task ffff880017944000)
    Stack:
    0000000000000150 ffff880100f59e00 ffff88001742dcd8 ffff8800a0a61800
    0000000000000000 00000000ffffff01 0000000000000000 ffffffff81a907a0
    ffff88001742dd18 ffffffff813815b1 ffff88001742dd08 ffffffff810ae336
    Call Trace:
    [] acpi_processor_hotplug+0x7c/0x9f
    [] ? schedule_delayed_work_on+0x16/0x20
    [] acpi_cpu_soft_notify+0x90/0xca
    [] notifier_call_chain+0x4d/0x70
    [] __raw_notifier_call_chain+0x9/0x10
    [] __cpu_notify+0x1b/0x30
    [] _cpu_up+0x103/0x14b
    [] cpu_up+0xd9/0xec
    [] store_online+0x94/0xd0
    [] dev_attr_store+0x1b/0x20
    [] sysfs_write_file+0xf4/0x170

    This patch fixes it.

    Signed-off-by: Konrad Rzeszutek Wilk
    Cc:
    Signed-off-by: Rafael J. Wysocki

    Konrad Rzeszutek Wilk
     

27 Nov, 2012

1 commit

  • 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: Julius Werner
    Reviewed-by: Preeti U Murthy
    Tested-by: Daniel Lezcano
    Acked-by: Daniel Lezcano
    Acked-by: Len Brown
    Signed-off-by: Rafael J. Wysocki

    Julius Werner
     

09 Oct, 2012

1 commit


18 Sep, 2012

1 commit

  • Currently we have the cpuidle_device field in the acpi_processor_power structure.
    This adds a dependency between processor.h and cpuidle.h

    Although it is not a real problem, removing this dependency has the benefit of
    separating a bit more the cpuidle code from the rest of the acpi code.
    Also, the compilation should be a bit improved because we do no longer
    include cpuidle.h in processor.h. The preprocessor was generating 30418 loc
    and with this patch it generates 30256 loc for processor_thermal.c, a file
    which is not concerned at all by cpuidle, like processor_perflib.c and
    processor_throttling.c.

    That may sound ridiculous, but "small streams make big rivers" :P

    This patch moves this field into a static global per cpu variable like what is
    done in the intel_idle driver.

    Signed-off-by: Daniel Lezcano
    Signed-off-by: Rafael J. Wysocki

    Daniel Lezcano
     

16 Sep, 2012

1 commit


05 Sep, 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
     

26 Jul, 2012

1 commit


19 Jul, 2012

1 commit

  • * pm-acpi: (24 commits)
    olpc-xo15-sci: Use struct dev_pm_ops for power management
    ACPI / PM: Drop PM callbacks from the ACPI bus type
    ACPI / PM: Drop legacy driver PM callbacks that are not used any more
    ACPI / PM: Do not execute legacy driver PM callbacks
    acpi_power_meter: Use struct dev_pm_ops for power management
    fujitsu-tablet: Use struct dev_pm_ops for power management
    classmate-laptop: Use struct dev_pm_ops for power management
    xo15-ebook: Use struct dev_pm_ops for power management
    toshiba_bluetooth: Use struct dev_pm_ops for power management
    panasonic-laptop: Use struct dev_pm_ops for power management
    sony-laptop: Use struct dev_pm_ops for power management
    hp_accel: Use struct dev_pm_ops for power management
    toshiba_acpi: Use struct dev_pm_ops for power management
    ACPI: Use struct dev_pm_ops for power management in the SBS driver
    ACPI: Use struct dev_pm_ops for power management in the power driver
    ACPI: Use struct dev_pm_ops for power management in the button driver
    ACPI: Use struct dev_pm_ops for power management in the battery driver
    ACPI: Use struct dev_pm_ops for power management in the AC driver
    ACPI: Use struct dev_pm_ops for power management in processor driver
    ACPI: Use struct dev_pm_ops for power management in the thermal driver
    ...

    Rafael J. Wysocki
     

18 Jul, 2012

2 commits