1. 09 Jan, 2014 1 commit
  2. 29 Nov, 2013 1 commit
  3. 23 Apr, 2013 1 commit
  4. 21 Apr, 2013 1 commit
  5. 17 Apr, 2013 1 commit
  6. 15 Mar, 2013 1 commit
  7. 19 Feb, 2013 1 commit
    • Mike Galbraith's avatar
      intel_idle: Convert i7300_idle_lock to raw_spinlock · 066361a7
      Mike Galbraith authored
      24 core Intel box's first exposure to 3.0.12-rt30-rc3 didn't go well.
      [   27.104159] i7300_idle: loaded v1.55
      [   27.104192] BUG: scheduling while atomic: swapper/2/0/0x00000002
      [   27.104309] Pid: 0, comm: swapper/2 Tainted: G           N  3.0.12-rt30-rc3-rt #1
      [   27.104317] Call Trace:
      [   27.104338]  [<ffffffff810046a5>] dump_trace+0x85/0x2e0
      [   27.104372]  [<ffffffff8144eb00>] thread_return+0x12b/0x30b
      [   27.104381]  [<ffffffff8144f1b9>] schedule+0x29/0xb0
      [   27.104389]  [<ffffffff814506e5>] rt_spin_lock_slowlock+0xc5/0x240
      [   27.104401]  [<ffffffffa01f818f>] i7300_idle_notifier+0x3f/0x360 [i7300_idle]
      [   27.104415]  [<ffffffff814546c7>] notifier_call_chain+0x37/0x70
      [   27.104426]  [<ffffffff81454748>] __atomic_notifier_call_chain+0x48/0x70
      [   27.104439]  [<ffffffff81001a39>] cpu_idle+0x89/0xb0
      [   27.104449] bad: scheduling from the idle thread!
      This lock is taken from interrupt disabled context in the guts of
      idle. Convert it to a raw_spinlock.
      Signed-off-by: default avatarMike Galbraith <efault@gmx.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Andy Henroid <andrew.d.henroid@intel.com>
      Link: http://lkml.kernel.org/r/1323258522.5057.73.camel@marge.simson.netSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
  8. 13 Feb, 2013 1 commit
    • Len Brown's avatar
      intel_idle: export both C1 and C1E · 32e95180
      Len Brown authored
      Here we disable HW promotion of C1 to C1E
      and export both C1 and C1E and distinct C-states.
      This allows a cpuidle governor to choose a lower latency
      C-state than C1E when necessary to satisfy performance
      and QOS constraints -- and still save power versus polling.
      This also corrects the erroneous latency previously reported
      for C1E -- it is 10usec, not 1usec.
      Note that if you use "intel_idle.max_cstate=N",
      then you must increment N by 1 to get the same behavior
      after this change.
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
  9. 09 Feb, 2013 3 commits
    • Len Brown's avatar
      intel_idle: remove assumption of one C-state per MWAIT flag · e022e7eb
      Len Brown authored
      Remove the assumption that cstate_tables are
      indexed by MWAIT flag values.  Each entry
      identifies itself via its own flags value.
      This change is needed to support multiple states
      that share the same MWAIT flags.
      Note that this can have an effect on what state is described
      by 'N' on cmdline intel_idle.max_cstate=N on some systems.
      intel_idle.max_cstate=0 still disables the driver
      intel_idle.max_cstate=1 still results in just C1(E)
      However, "place holders" in the sparse C-state name-space
      (eg. Atom) have been removed.
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
    • Len Brown's avatar
      intel_idle: remove use and definition of MWAIT_MAX_NUM_CSTATES · 137ecc77
      Len Brown authored
      Cosmetic only.
      They are both 8, so this patch has no functional change.
      The reason to change is that intel_idle will soon be able
      to export more than the 8 "major" states supported by MWAIT.
      When we hit that limit, it is important to know
      where the limit comes from.
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
    • Len Brown's avatar
      intel_idle: support Haswell · 85a4d2d4
      Len Brown authored
      This patch enables intel_idle to run on the
      next-generation Intel(R) Microarchitecture code named "Haswell".
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
  10. 01 Feb, 2013 1 commit
    • Len Brown's avatar
      intel_idle: stop using driver_data for static flags · b1beab48
      Len Brown authored
      The commit, 4202735e
      (cpuidle: Split cpuidle_state structure and move per-cpu statistics fields)
      observed that the MWAIT flags for Cn on every processor to date were the
      same, and created get_driver_data() to supply them.
      Unfortunately, that assumption is false, going forward.
      So here we restore the MWAIT flags to the cpuidle_state table.
      However, instead restoring the old "driver_data" field,
      we put the flags into the existing "flags" field,
      where they probalby should have lived all along.
      This patch does not change any operation.
      This patch removes 1 of the 3 users of cpuidle_state_usage.driver_data.
      Perhaps some day we'll get rid of the other 2.
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>
  11. 21 Jan, 2013 1 commit
  12. 18 Jan, 2013 1 commit
    • Konrad Rzeszutek Wilk's avatar
      intel_idle: Don't register CPU notifier if we are not running. · 6f8c2e79
      Konrad Rzeszutek Wilk authored
      The 'intel_idle_probe' probes the CPU and sets the CPU notifier.
      But if later on during the module initialization we fail (say
      in cpuidle_register_driver), we stop loading, but we neglect
      to unregister the CPU notifier.  This means that during CPU
      hotplug events the system will fail:
      calling  intel_idle_init+0x0/0x326 @ 1
      intel_idle: MWAIT substates: 0x1120
      intel_idle: v0.4 model 0x2A
      intel_idle: lapic_timer_reliable_states 0xffffffff
      intel_idle: intel_idle yielding to none
      initcall intel_idle_init+0x0/0x326 returned -19 after 14 usecs
      ... some time later, offlining and onlining a CPU:
      cpu 3 spinlock event irq 62
      BUG: unable to ] __cpuidle_register_device+0x1c/0x120
      PGD 99b8b067 PUD 99b95067 PMD 0
      Oops: 0000 [#1] SMP
      Modules linked in: xen_evtchn nouveau mxm_wmi wmi radeon ttm i915 fbcon tileblit font atl1c bitblit softcursor drm_kms_helper video xen_blkfront xen_netfront fb_sys_fops sysimgblt sysfillrect syscopyarea xenfs xen_privcmd mperf
      CPU 0
      Pid: 2302, comm: udevd Not tainted 3.8.0-rc3upstream-00249-g09ad159 #1 MSI MS-7680/H61M-P23 (MS-7680)
      RIP: e030:[<ffffffff814d956c>]  [<ffffffff814d956c>] __cpuidle_register_device+0x1c/0x120
      RSP: e02b:ffff88009dacfcb8  EFLAGS: 00010286
      RAX: 0000000000000000 RBX: ffff880105380000 RCX: 000000000000001c
      RDX: 0000000000000000 RSI: 0000000000000055 RDI: ffff880105380000
      RBP: ffff88009dacfce8 R08: ffffffff81a4f048 R09: 0000000000000008
      R10: 0000000000000008 R11: 0000000000000000 R12: ffff880105380000
      R13: 00000000ffffffdd R14: 0000000000000000 R15: ffffffff81a523d0
      FS:  00007f37bd83b7a0(0000) GS:ffff880105200000(0000) knlGS:0000000000000000
      CS:  e033 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000000000000008 CR3: 00000000a09ea000 CR4: 0000000000042660
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
      Process udevd (pid: 2302, threadinfo ffff88009dace000, task ffff88009afb47f0)
       ffffffff8107f2d0 ffffffff810c2fb7 ffff88009dacfce8 00000000ffffffea
       ffff880105380000 00000000ffffffdd ffff88009dacfd08 ffffffff814d9882
       0000000000000003 ffff880105380000 ffff88009dacfd28 ffffffff81340afd
      Call Trace:
       [<ffffffff8107f2d0>] ? collect_cpu_info_local+0x30/0x30
       [<ffffffff810c2fb7>] ? __might_sleep+0xe7/0x100
       [<ffffffff814d9882>] cpuidle_register_device+0x32/0x70
       [<ffffffff81340afd>] intel_idle_cpu_init+0xad/0x110
       [<ffffffff81340bc8>] cpu_hotplug_notify+0x68/0x80
       [<ffffffff8166023d>] notifier_call_chain+0x4d/0x70
       [<ffffffff810bc369>] __raw_notifier_call_chain+0x9/0x10
       [<ffffffff81094a4b>] __cpu_notify+0x1b/0x30
       [<ffffffff81652cf7>] _cpu_up+0x103/0x14b
       [<ffffffff81652e18>] cpu_up+0xd9/0xec
       [<ffffffff8164a254>] store_online+0x94/0xd0
       [<ffffffff814122fb>] dev_attr_store+0x1b/0x20
       [<ffffffff81216404>] sysfs_write_file+0xf4/0x170
       [<ffffffff811a1024>] vfs_write+0xb4/0x130
       [<ffffffff811a17ea>] sys_write+0x5a/0xa0
       [<ffffffff816643a9>] system_call_fastpath+0x16/0x1b
      Code: 03 18 00 c9 c3 66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 48 83 ec 30 48 89 5d e8 4c 89 65 f0 48 89 fb 4c 89 6d f8 e8 84 08 00 00 <48> 8b 78 08 49 89 c4 e8 f8 7f c1 ff 89 c2 b8 ea ff ff ff 84 d2
      RIP  [<ffffffff814d956c>] __cpuidle_register_device+0x1c/0x120
       RSP <ffff88009dacfcb8>
      This patch fixes that by moving the CPU notifier registration
      as the last item to be done by the module.
      Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Reviewed-by: default avatarSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Cc: 3.6+ <stable@vger.kernel.org>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  13. 03 Jan, 2013 1 commit
  14. 27 Nov, 2012 1 commit
    • Julius Werner's avatar
      cpuidle: Measure idle state durations with monotonic clock · a474a515
      Julius Werner authored
      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: default avatarJulius Werner <jwerner@chromium.org>
      Reviewed-by: default avatarPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Tested-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
      Acked-by: default avatarLen Brown <len.brown@intel.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
  15. 27 Sep, 2012 1 commit
  16. 17 Aug, 2012 1 commit
  17. 05 Jul, 2012 1 commit
  18. 05 Jun, 2012 1 commit
  19. 05 Apr, 2012 1 commit
    • Stephen Boyd's avatar
      simple_open: automatically convert to simple_open() · 234e3405
      Stephen Boyd authored
      Many users of debugfs copy the implementation of default_open() when
      they want to support a custom read/write function op.  This leads to a
      proliferation of the default_open() implementation across the entire
      Now that the common implementation has been consolidated into libfs we
      can replace all the users of this function with simple_open().
      This replacement was done with the following semantic patch:
      @ open @
      identifier open_f != simple_open;
      identifier i, f;
      -int open_f(struct inode *i, struct file *f)
      -if (i->i_private)
      -f->private_data = i->i_private;
      -f->private_data = i->i_private;
      -return 0;
      @ has_open depends on open @
      identifier fops;
      identifier open.open_f;
      struct file_operations fops = {
      -.open = open_f,
      +.open = simple_open,
      [akpm@linux-foundation.org: checkpatch fixes]
      Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Acked-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
  20. 22 Mar, 2012 1 commit
  21. 16 Feb, 2012 1 commit
  22. 13 Feb, 2012 1 commit
  23. 27 Jan, 2012 1 commit
  24. 20 Jan, 2012 1 commit
  25. 18 Jan, 2012 1 commit
  26. 17 Jan, 2012 4 commits
  27. 07 Nov, 2011 3 commits
  28. 31 Oct, 2011 1 commit
  29. 28 Feb, 2011 1 commit
  30. 17 Feb, 2011 2 commits
  31. 24 Jan, 2011 1 commit
  32. 12 Jan, 2011 1 commit
    • Thomas Renninger's avatar
      cpuidle/x86/perf: fix power:cpu_idle double end events and throw cpu_idle... · f77cfe4e
      Thomas Renninger authored
      cpuidle/x86/perf: fix power:cpu_idle double end events and throw cpu_idle events from the cpuidle layer
      Currently intel_idle and acpi_idle driver show double cpu_idle "exit idle"
      events -> this patch fixes it and makes cpu_idle events throwing less complex.
      It also introduces cpu_idle events for all architectures which use
      the cpuidle subsystem, namely:
        - arch/arm/mach-at91/cpuidle.c
        - arch/arm/mach-davinci/cpuidle.c
        - arch/arm/mach-kirkwood/cpuidle.c
        - arch/arm/mach-omap2/cpuidle34xx.c
        - arch/drivers/acpi/processor_idle.c (for all cases, not only mwait)
        - arch/x86/kernel/process.c (did throw events before, but was a mess)
        - drivers/idle/intel_idle.c (did throw events before)
      Convention should be:
      Fire cpu_idle events inside the current pm_idle function (not somewhere
      down the the callee tree) to keep things easy.
      Current possible pm_idle functions in X86:
      c1e_idle, poll_idle, cpuidle_idle_call, mwait_idle, default_idle
      -> this is really easy is now.
      This affects userspace:
      The type field of the cpu_idle power event can now direclty get
      mapped to:
      instead of throwing very CPU/mwait specific values.
      This change is not visible for the intel_idle driver.
      For the acpi_idle driver it should only be visible if the vendor
      misses out C-states in his BIOS.
      Another (perf timechart) patch reads out cpuidle info of cpu_idle
      events from:
      /sys/.../cpuidle/stateX/*, then the cpuidle events are mapped
      to the correct C-/cpuidle state again, even if e.g. vendors miss
      out C-states in their BIOS and for example only export C1 and C3.
      -> everything is fine.
      Signed-off-by: default avatarThomas Renninger <trenn@suse.de>
      CC: Robert Schoene <robert.schoene@tu-dresden.de>
      CC: Jean Pihet <j-pihet@ti.com>
      CC: Arjan van de Ven <arjan@linux.intel.com>
      CC: Ingo Molnar <mingo@elte.hu>
      CC: Frederic Weisbecker <fweisbec@gmail.com>
      CC: linux-pm@lists.linux-foundation.org
      CC: linux-acpi@vger.kernel.org
      CC: linux-kernel@vger.kernel.org
      CC: linux-perf-users@vger.kernel.org
      CC: linux-omap@vger.kernel.org
      Signed-off-by: default avatarLen Brown <len.brown@intel.com>