15 Aug, 2008

1 commit


28 Jul, 2008

1 commit

  • pm_idle_save resp. pm_idle_old can be NULL when the restore code in
    acpi_processor_cst_has_changed() resp. cpuidle_uninstall_idle_handler()
    is called. This can set pm_idle unconditinally to NULL, which causes the
    kernel to panic when calling pm_idle in the x86 idle code. This was
    covered by an extra check for !pm_idle in the x86 idle code, which was
    removed during the x86 idle code refactoring.

    Instead of restoring the pm_idle check in the x86 code prevent the
    acpi/cpuidle code to set pm_idle to NULL.

    Reported by: Dhaval Giani http://lkml.org/lkml/2008/7/2/309
    Based on a debug patch from Ingo Molnar

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Thomas Gleixner
     

26 Jul, 2008

1 commit

  • The acpi idle waits calls local_irq_save and then uses mwait to go into
    idle. The tracer gets reenabled at local_irq_save but does not detect that
    the idle allows for wake ups.

    This patch adds code to disable the tracing when acpi puts the CPU to idle.

    Signed-off-by: Steven Rostedt
    Cc: Peter Zijlstra
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     

17 Jul, 2008

3 commits

  • "idle=nomwait" disables the use of the MWAIT
    instruction from both C1 (C1_FFH) and deeper (C2C3_FFH)
    C-states.

    When MWAIT is unavailable, the BIOS and OS generally
    negotiate to use the HALT instruction for C1,
    and use IO accesses for deeper C-states.

    This option is useful for power and performance
    comparisons, and also to work around BIOS bugs
    where broken MWAIT support is advertised.

    http://bugzilla.kernel.org/show_bug.cgi?id=10807
    http://bugzilla.kernel.org/show_bug.cgi?id=10914

    Signed-off-by: Zhao Yakui
    Signed-off-by: Li Shaohua
    Signed-off-by: Len Brown
    Signed-off-by: Andi Kleen

    Zhao Yakui
     
  • "idle=halt" limits the idle loop to using
    the halt instruction. No MWAIT, no IO accesses,
    no C-states deeper than C1.

    If something is broken in the idle code,
    "idle=halt" is a less severe workaround
    than "idle=poll" which disables all power savings.

    Signed-off-by: Zhao Yakui
    Signed-off-by: Len Brown
    Signed-off-by: Andi Kleen

    Zhao Yakui
     
  • Change processors from an array sized by NR_CPUS to a per_cpu variable.

    Signed-off-by: Mike Travis
    Signed-off-by: Andrew Morton
    Signed-off-by: Len Brown
    Signed-off-by: Andi Kleen

    Mike Travis
     

26 Jun, 2008

1 commit


12 Jun, 2008

1 commit

  • cpuidle and acpi driver interaction bug with the way cpuidle_register_driver()
    is called. Due to this bug, there will be oops on
    ACDC on some systems, where they support C-states in one DC and not in AC.

    The current code does
    ON BOOT:
    Look at CST and other C-state info to see whether more than C1 is
    supported. If it is, then acpi processor_idle does a
    cpuidle_register_driver() call, which internally enables the device.

    ON CST change notification (ACDC) and on suspend-resume:
    acpi driver temporarily disables device, updates the device with
    any new C-states, and reenables the device.

    The problem is is on boot, there are no C2, C3 states supported and we skip
    the register. Later on ACDC, we may get a CST notification and we try
    to reevaluate CST and enabled the device, without actually registering it.
    This causes breakage as we try to create /sys fs sub directory, without the
    parent directory which is created at register time.

    Thanks to Sanjeev for reporting the problem here.
    http://bugzilla.kernel.org/show_bug.cgi?id=10394

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venkatesh Pallipadi
     

01 May, 2008

3 commits

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (179 commits)
    ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
    acpi: fix section mismatch warning in pnpacpi
    intel_menlo: fix build warning
    ACPI: Cleanup: Remove unneeded, multiple local dummy variables
    ACPI: video - fix permissions on some proc entries
    ACPI: video - properly handle errors when registering proc elements
    ACPI: video - do not store invalid entries in attached_array list
    ACPI: re-name acpi_pm_ops to acpi_suspend_ops
    ACER_WMI/ASUS_LAPTOP: fix build bug
    thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
    ACPI: check a return value correctly in acpi_power_get_context()
    #if 0 acpi/bay.c:eject_removable_drive()
    eeepc-laptop: add hwmon fan control
    eeepc-laptop: add backlight
    eeepc-laptop: add base driver
    ACPI: thinkpad-acpi: bump up version to 0.20
    ACPI: thinkpad-acpi: fix selects in Kconfig
    ACPI: thinkpad-acpi: use a private workqueue
    ACPI: thinkpad-acpi: fluff really minor fix
    ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation
    ...

    Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c
    manually.

    Linus Torvalds
     
  • …-9916', 'ec', 'eeepc', 'idle', 'misc', 'pm-legacy', 'sysfs-links-2.6.26', 'thermal', 'thinkpad' and 'video' into release

    Len Brown
     
  • acpi_processor_idle and "idle=" boot parameter interaction is broken.
    The problem is that, at boot time acpi driver is checking for "idle=" boot
    option and not registering the acpi idle handler. But, when there is a CST
    changed callback (typically when switching AC battery or suspend-resume)
    there are no checks for boot_option_idle_override and acpi idle handler tries
    to get installed with nasty side effects.

    With CPU_IDLE configured this issue causes results in a nasty oops on CST
    change callback and without CPU_IDLE there is no oops, but boot option
    of "idle=" gets ignored and acpi idle handler gets installed.

    Change the behavior to not do anything in acpi idle handler when there is a
    "idle=" boot option.

    Note that the problem is only there when "idle=" boot option is used.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venkatesh Pallipadi
     

29 Apr, 2008

1 commit

  • Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
    be setup before gluing PDE to main tree.

    Add correct ->owner to proc_fops to fix reading/module unloading race.

    Signed-off-by: Denis V. Lunev
    Cc: Len Brown
    Cc: Alexey Dobriyan
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Denis V. Lunev
     

27 Apr, 2008

1 commit

  • OK, so 25-mm1 gave a lockdep error which made me look into this.

    The first thing that I noticed was the horrible mess; the second thing I
    saw was hacks like: 71e93d15612c61c2e26a169567becf088e71b8ff

    The problem is that arch idle routines are somewhat inconsitent with
    their IRQ state handling and instead of fixing _that_, we go paper over
    the problem.

    So the thing I've tried to do is set a standard for idle routines and
    fix them all up to adhere to that. So the rules are:

    idle routines are entered with IRQs disabled
    idle routines will exit with IRQs enabled

    Nearly all already did this in one form or another.

    Merge the 32 and 64 bit bits so they no longer have different bugs.

    As for the actual lockdep warning; __sti_mwait() did a plainly un-annotated
    irq-enable.

    Signed-off-by: Peter Zijlstra
    Tested-by: Bob Copeland
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

25 Apr, 2008

1 commit

  • Patch to fix huge number of wakeups reported due to recent changes in
    processor_idle.c. The problem was that the entry_method determination was
    broken due to one of the recent commits (bc71bec91f987) causing
    C1 entry to not to go to halt.

    http://lkml.org/lkml/2008/3/22/124

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venkatesh Pallipadi
     

26 Mar, 2008

2 commits

  • commit 9b12e18cdc1553de62d931e73443c806347cd974
    'ACPI: cpuidle: Support C1 idle time accounting'
    was implicated in a 100% C0 idle regression.
    http://bugzilla.kernel.org/show_bug.cgi?id=10076

    It pointed out a potential problem where the menu governor
    may get confused by the C-state residency time from poll
    idle or C1 idle, where this timing info is not accurate.
    This inaccuracy is due to interrupts being handled
    before we account for C-state exit.

    Do not mark TIME_VALID for CO poll state.
    Mark C1 time as valid only with the MWAIT (CSTATE_FFH) entry method.

    This makes governors use the timing information only when it is correct and
    eliminates any wrong policy decisions that may result from invalid timing
    information.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venki Pallipadi
     
  • This original patch
    http://ussg.iu.edu/hypermail/linux/kernel/0712.2/1451.html
    was intending to add acpi_unlazy_tlb() to acpi_idle_enter_bm(),
    which is used for C3 entry.

    But it was merged incorrectly as commmit

    bde6f5f59c2b2b48a7a849c129d5b48838fe77ee
    'x86: voluntary leave_mm before entering ACPI C3'

    so the call was instead added to acpi_idle_enter_simple()
    (which is C2 entry routine), probably due to identical
    context in that function.

    Move the call back to acpi_idle_enter_bm().

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venki Pallipadi
     

14 Mar, 2008

1 commit

  • This avoids the harmless WARNING by lockdep in acpi_processor_idle().

    The reason for WARNING is because at the depth of idle handling code,
    some of the idle handlers disable interrupts, some times, while returning from
    the idle handler. After return, acpi_processor_idle and few other routines
    in the file did an unconditional local_irq_enable(). With LOCKDEP, enabling
    irq when it is already enabled generates the below WARNING.

    > > [ 0.593038] ------------[ cut here ]------------
    > > [ 0.593267] WARNING: at kernel/lockdep.c:2035 trace_hardirqs_on+0xa0/0x115()
    > > [ 0.593596] Modules linked in:
    > > [ 0.593756] Pid: 0, comm: swapper Not tainted 2.6.25-rc5 #8
    > > [ 0.594017]
    > > [ 0.594017] Call Trace:
    > > [ 0.594216] [] warn_on_slowpath+0x58/0x6b
    > > [ 0.594495] [] ? _spin_unlock_irqrestore+0x38/0x47
    > > [ 0.594809] [] ? acpi_os_release_lock+0x9/0xb
    > > [ 0.595103] [] ? acpi_set_register+0x161/0x173
    > > [ 0.595401] [] ? acpi_processor_idle+0x1de/0x546
    > > [ 0.595706] [] ? default_idle+0x0/0x73
    > > [ 0.595970] [] trace_hardirqs_on+0xa0/0x115
    > > [ 0.596049] [] ? acpi_processor_idle+0x0/0x546
    > > [ 0.596346] [] acpi_processor_idle+0x1de/0x546
    > > [ 0.596642] [] ? default_idle+0x0/0x73
    > > [ 0.596912] [] ? acpi_processor_idle+0x0/0x546
    > > [ 0.597209] [] ? default_idle+0x0/0x73
    > > [ 0.597472] [] cpu_idle+0xa7/0xd1
    > > [ 0.597717] [] rest_init+0x55/0x57
    > > [ 0.597957] [] start_kernel+0x29d/0x2a8
    > > [ 0.598215] [] _sinittext+0x1da/0x1e1
    > > [ 0.598464]
    > > [ 0.598546] ---[ end trace 778e504de7e3b1e3 ]---

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venki Pallipadi
     

20 Feb, 2008

1 commit

  • TSC is used even on machines when CONFIG_X86_TSC is not set (X86_TSC
    means _require_ TSC), but it is not properly disabled when it is
    unusable, because ACPI code understood the config switch as "may use
    TSC".

    This actually fixes suspend problems on my x60.

    Signed-off-by: Pavel Machek
    Signed-off-by: Len Brown

    Pavel Machek
     

14 Feb, 2008

3 commits

  • Len Brown
     
  • Add a new sysfs entry under cpuidle states. desc - can be used by driver to
    communicate to userspace any specific information about the state.
    This helps in identifying the exact hardware C-states behind the ACPI C-state
    definition.

    Idea is to export this through powertop, which will help to map the C-state
    reported by powertop to actual hardware C-state.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venkatesh Pallipadi
     
  • Earlier patch (bc71bec91f9875ef825d12104acf3bf4ca215fa4) broke
    suspend resume on many laptops. The problem was reported by
    Carlos R. Mafra and Calvin Walton, who bisected the issue to above patch.

    The problem was because, C2 and C3 code were calling acpi_idle_enter_c1
    directly, with C2 or C3 as state parameter, while suspend/resume was in
    progress. The patch bc71bec started making use of that state information,
    assuming that it would always be referring to C1 state. This caused the
    problem with suspend-resume as we ended up using C2/C3 state indirectly.

    Fix this by adding acpi_idle_suspend check in enter_c1.

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Len Brown

    Venkatesh Pallipadi
     

07 Feb, 2008

5 commits


06 Feb, 2008

1 commit

  • Replace latency.c use with pm_qos_params use.

    Signed-off-by: mark gross
    Cc: "John W. Linville"
    Cc: Len Brown
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mark Gross
     

30 Jan, 2008

2 commits

  • The ACPI code currently disables TSC use in any C2 and C3
    states. But the AMD Fam10h BKDG documents that the TSC
    will never stop in any C states when the CONSTANT_TSC bit is
    set. Make this disabling conditional on CONSTANT_TSC
    not set on AMD.

    I actually think this is true on Intel too for C2 states
    on CPUs with p-state invariant TSC, but this needs
    further discussions with Len to really confirm :-)

    So far it is only enabled on AMD.

    Cc: lenb@kernel.org

    Signed-off-by: Andi Kleen
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Andi Kleen
     
  • Aviod TLB flush IPIs during C3 states by voluntary leave_mm()
    before entering C3.

    The performance impact of TLB flush on C3 should not be significant with
    respect to C3 wakeup latency. Also, CPUs tend to flush TLB in hardware while in
    C3 anyways.

    On a 8 logical CPU system, running make -j2, the number of tlbflush IPIs goes
    down from 40 per second to ~ 0. Total number of interrupts during the run
    of this workload was ~1200 per second, which makes it ~3% savings in wakeups.

    There was no measurable performance or power impact however.

    [ akpm@linux-foundation.org: symbol export fixes. ]

    Signed-off-by: Venkatesh Pallipadi
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Venki Pallipadi
     

08 Jan, 2008

1 commit

  • This was writeable in 2.6.23 but the cpuidle merge made it read-only. But
    some people's scripts (ie: Mark's) were writing to it.

    As an unhappy compromise, make max_cstate writeable again if the kernel was
    configured without CONFIG_CPU_IDLE.

    http://bugzilla.kernel.org/show_bug.cgi?id=9683

    Signed-off-by: Venkatesh Pallipadi
    Cc: Mark Lord
    Cc: Arjan van de Ven
    Cc: Ingo Molnar
    Cc: "Rafael J. Wysocki"
    Signed-off-by: Andrew Morton
    Signed-off-by: Len Brown

    Venki Pallipadi
     

14 Dec, 2007

2 commits

  • More aggressively request deep C-states.

    Note that the job of the OS is to minimize latency
    impact to expected break events such as interrupts.

    It is not the job of the OS to try to calculate if
    the C-state will reach energy break-even.
    The platform doesn't give the OS enough information
    for it to make that calculation. Thus, it is up
    to the platform to decide if it is worth it to
    go as deep as the OS requested it to, or if it
    should internally demote to a more shallow C-state.

    But the converse is not true. The platform can not
    promote into a deeper C-state than the OS requested
    else it may violate latency constraints. So it is
    important that the OS be aggressive in giving the
    platform permission to enter deep C-states.

    Signed-off-by: Len Brown

    Len Brown
     
  • Start with default value of 6, so by default,
    there is no functional change in this patch.

    Signed-off-by: Len Brown

    Len Brown
     

08 Dec, 2007

1 commit

  • The timer broadcast code might access HPET, which should not be
    accessed after the busmaster disable.

    In acpi_idle_enter_simple() this change also prevents, that we modify
    the busmaster state without going actually idle. This might leave the
    ACPI bm state in a stale state, when we leave the function early in
    the need_resched() check.

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar
    Acked-by: Venkatesh Pallipadi

    Thomas Gleixner
     

27 Nov, 2007

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86:
    x86: fix APIC related bootup crash on Athlon XP CPUs
    time: add ADJ_OFFSET_SS_READ
    x86: export the symbol empty_zero_page on the 32-bit x86 architecture
    x86: fix kprobes_64.c inlining borkage
    pci: use pci=bfsort for HP DL385 G2, DL585 G2
    x86: correctly set UTS_MACHINE for "make ARCH=x86"
    lockdep: annotate do_debug() trap handler
    x86: turn off iommu merge by default
    x86: fix ACPI compile for LOCAL_APIC=n
    x86: printk kernel version in WARN_ON and other dump_stack users
    ACPI: Set max_cstate to 1 for early Opterons.
    x86: fix NMI watchdog & 'stopped time' problem

    Linus Torvalds
     
  • AMD Opteron processors before CG revision don't like C-states > 1.

    This solves the long standing bugzilla #5303 and probably some more
    on affected machines:

    http://bugzilla.kernel.org/show_bug.cgi?id=5303

    [ tglx@linutronix.de: reworked the patch so it does not wreck ia64 ]

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Ingo Molnar

    Alexey Starikovskiy
     

20 Nov, 2007

4 commits


20 Oct, 2007

1 commit

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (41 commits)
    ACPICA: hw: Don't carry spinlock over suspend
    ACPICA: hw: remove use_lock flag from acpi_hw_register_{read, write}
    ACPI: cpuidle: port idle timer suspend/resume workaround to cpuidle
    ACPI: clean up acpi_enter_sleep_state_prep
    Hibernation: Make sure that ACPI is enabled in acpi_hibernation_finish
    ACPI: suppress uninitialized var warning
    cpuidle: consolidate 2.6.22 cpuidle branch into one patch
    ACPI: thinkpad-acpi: skip blanks before the data when parsing sysfs
    ACPI: AC: Add sysfs interface
    ACPI: SBS: Add sysfs alarm
    ACPI: SBS: Add ACPI_PROCFS around procfs handling code.
    ACPI: SBS: Add support for power_supply class (and sysfs)
    ACPI: SBS: Make SBS reads table-driven.
    ACPI: SBS: Simplify data structures in SBS
    ACPI: SBS: Split host controller (ACPI0001) from SBS driver (ACPI0002)
    ACPI: EC: Add new query handler to list head.
    ACPI: Add acpi_bus_generate_event4() function
    ACPI: Battery: add sysfs alarm
    ACPI: Battery: Add sysfs support
    ACPI: Battery: Misc clean-ups, no functional changes
    ...

    Fix up conflicts in drivers/misc/thinkpad_acpi.[ch] manually

    Linus Torvalds