1. 04 5月, 2011 2 次提交
    • D
      [CPUFREQ] use dynamic debug instead of custom infrastructure · 2d06d8c4
      Dominik Brodowski 提交于
      With dynamic debug having gained the capability to report debug messages
      also during the boot process, it offers a far superior interface for
      debug messages than the custom cpufreq infrastructure. As a first step,
      remove the old cpufreq_debug_printk() function and replace it with a call
      to the generic pr_debug() function.
      
      How can dynamic debug be used on cpufreq? You need a kernel which has
      CONFIG_DYNAMIC_DEBUG enabled.
      
      To enabled debugging during runtime, mount debugfs and
      
      $ echo -n 'module cpufreq +p' > /sys/kernel/debug/dynamic_debug/control
      
      for debugging the complete "cpufreq" module. To achieve the same goal during
      boot, append
      
      	ddebug_query="module cpufreq +p"
      
      as a boot parameter to the kernel of your choice.
      
      For more detailled instructions, please see
      Documentation/dynamic-debug-howto.txt
      Signed-off-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NDave Jones <davej@redhat.com>
      2d06d8c4
    • J
      [CPUFREQ] CPU hotplug, re-create sysfs directory and symlinks · 27ecddc2
      Jacob Shin 提交于
      When we discover CPUs that are affected by each other's
      frequency/voltage transitions, the first CPU gets a sysfs directory
      created, and rest of the siblings get symlinks. Currently, when we
      hotplug off only the first CPU, all of the symlinks and the sysfs
      directory gets removed. Even though rest of the siblings are still
      online and functional, they are orphaned, and no longer governed by
      cpufreq.
      
      This patch, given the above scenario, creates a sysfs directory for
      the first sibling and symlinks for the rest of the siblings.
      
      Please note the recursive call, it was rather too ugly to roll it
      out. And the removal of redundant NULL setting (it is already taken
      care of near the top of the function).
      Signed-off-by: NJacob Shin <jacob.shin@amd.com>
      Acked-by: NMark Langsdorf <mark.langsdorf@amd.com>
      Reviewed-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NDave Jones <davej@redhat.com>
      Cc: stable@kernel.org
      27ecddc2
  2. 31 3月, 2011 1 次提交
  3. 24 3月, 2011 1 次提交
    • R
      cpufreq: Use syscore_ops for boot CPU suspend/resume (v2) · e00e56df
      Rafael J. Wysocki 提交于
      The cpufreq subsystem uses sysdev suspend and resume for
      executing cpufreq_suspend() and cpufreq_resume(), respectively,
      during system suspend, after interrupts have been switched off on the
      boot CPU, and during system resume, while interrupts are still off on
      the boot CPU.  In both cases the other CPUs are off-line at the
      relevant point (either they have been switched off via CPU hotplug
      during suspend, or they haven't been switched on yet during resume).
      For this reason, although it may seem that cpufreq_suspend() and
      cpufreq_resume() are executed for all CPUs in the system, they are
      only called for the boot CPU in fact, which is quite confusing.
      
      To remove the confusion and to prepare for elimiating sysdev
      suspend and resume operations from the kernel enirely, convernt
      cpufreq to using a struct syscore_ops object for the boot CPU
      suspend and resume and rename the callbacks so that their names
      reflect their purpose.  In addition, put some explanatory remarks
      into their kerneldoc comments.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      e00e56df
  4. 17 3月, 2011 6 次提交
  5. 02 3月, 2011 1 次提交
    • J
      [CPUFREQ] fix BUG on cpufreq policy init failure · 8f5bc2ab
      Jiri Slaby 提交于
      cpufreq_register_driver sets cpufreq_driver to a structure owned (and
      placed) in the caller's memory. If cpufreq policy fails in its ->init
      function, sysdev_driver_register returns nonzero in
      cpufreq_register_driver. Now, cpufreq_register_driver returns an error
      without setting cpufreq_driver back to NULL.
      
      Usually cpufreq policy modules are unloaded because they propagate the
      error to the module init function and return that.
      
      So a later access to any member of cpufreq_driver causes bugs like:
      BUG: unable to handle kernel paging request at ffffffffa00270a0
      IP: [<ffffffff8145eca3>] cpufreq_cpu_get+0x53/0xe0
      PGD 1805067 PUD 1809063 PMD 1c3f90067 PTE 0
      Oops: 0000 [#1] SMP
      last sysfs file: /sys/devices/virtual/net/tun0/statistics/collisions
      CPU 0
      Modules linked in: ...
      Pid: 5677, comm: thunderbird-bin Tainted: G        W   2.6.38-rc4-mm1_64+ #1389 To be filled by O.E.M./To Be Filled By O.E.M.
      RIP: 0010:[<ffffffff8145eca3>]  [<ffffffff8145eca3>] cpufreq_cpu_get+0x53/0xe0
      RSP: 0018:ffff8801aec37d98  EFLAGS: 00010086
      RAX: 0000000000000202 RBX: 0000000000000000 RCX: 0000000000000001
      RDX: ffffffffa00270a0 RSI: 0000000000001000 RDI: ffffffff8199ece8
      ...
      Call Trace:
       [<ffffffff8145f490>] cpufreq_quick_get+0x10/0x30
       [<ffffffff8103f12b>] show_cpuinfo+0x2ab/0x300
       [<ffffffff81136292>] seq_read+0xf2/0x3f0
       [<ffffffff8126c5d3>] ? __strncpy_from_user+0x33/0x60
       [<ffffffff8116850d>] proc_reg_read+0x6d/0xa0
       [<ffffffff81116e53>] vfs_read+0xc3/0x180
       [<ffffffff81116f5c>] sys_read+0x4c/0x90
       [<ffffffff81030dbb>] system_call_fastpath+0x16/0x1b
      ...
      
      It's all cause by weird fail path handling in cpufreq_register_driver.
      To fix that, shuffle the code to do proper handling with gotos.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NDave Jones <davej@redhat.com>
      8f5bc2ab
  6. 26 1月, 2011 1 次提交
  7. 21 1月, 2011 1 次提交
    • D
      kconfig: rename CONFIG_EMBEDDED to CONFIG_EXPERT · 6a108a14
      David Rientjes 提交于
      The meaning of CONFIG_EMBEDDED has long since been obsoleted; the option
      is used to configure any non-standard kernel with a much larger scope than
      only small devices.
      
      This patch renames the option to CONFIG_EXPERT in init/Kconfig and fixes
      references to the option throughout the kernel.  A new CONFIG_EMBEDDED
      option is added that automatically selects CONFIG_EXPERT when enabled and
      can be used in the future to isolate options that should only be
      considered for embedded systems (RISC architectures, SLOB, etc).
      
      Calling the option "EXPERT" more accurately represents its intention: only
      expert users who understand the impact of the configuration changes they
      are making should enable it.
      Reviewed-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NDavid Woodhouse <david.woodhouse@intel.com>
      Signed-off-by: NDavid Rientjes <rientjes@google.com>
      Cc: Greg KH <gregkh@suse.de>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Robin Holt <holt@sgi.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6a108a14
  8. 04 1月, 2011 1 次提交
    • T
      perf: Clean up power events by introducing new, more generic ones · 25e41933
      Thomas Renninger 提交于
      Add these new power trace events:
      
       power:cpu_idle
       power:cpu_frequency
       power:machine_suspend
      
      The old C-state/idle accounting events:
        power:power_start
        power:power_end
      
      Have now a replacement (but we are still keeping the old
      tracepoints for compatibility):
      
        power:cpu_idle
      
      and
        power:power_frequency
      
      is replaced with:
        power:cpu_frequency
      
      power:machine_suspend is newly introduced.
      
      Jean Pihet has a patch integrated into the generic layer
      (kernel/power/suspend.c) which will make use of it.
      
      the type= field got removed from both, it was never
      used and the type is differed by the event type itself.
      
      perf timechart userspace tool gets adjusted in a separate patch.
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Acked-by: NArjan van de Ven <arjan@linux.intel.com>
      Acked-by: NJean Pihet <jean.pihet@newoldbits.com>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: rjw@sisk.pl
      LKML-Reference: <1294073445-14812-3-git-send-email-trenn@suse.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      LKML-Reference: <1290072314-31155-2-git-send-email-trenn@suse.de>
      25e41933
  9. 22 10月, 2010 2 次提交
  10. 04 8月, 2010 7 次提交
  11. 27 7月, 2010 2 次提交
  12. 22 7月, 2010 1 次提交
    • T
      x86 cpufreq, perf: Make trace_power_frequency cpufreq driver independent · 4c21adf2
      Thomas Renninger 提交于
      and fix the broken case if a core's frequency depends on others.
      
      trace_power_frequency was only implemented in a rather ungeneric
      way in acpi-cpufreq driver's target() function only.
      
      -> Move the call to trace_power_frequency to
         cpufreq.c:cpufreq_notify_transition() where CPUFREQ_POSTCHANGE
         notifier is triggered.
         This will support power frequency tracing by all cpufreq
         drivers.
      
      trace_power_frequency did not trace frequency changes correctly
      when the userspace governor was used or when CPU cores'
      frequency depend on each other.
      
      -> Moving this into the CPUFREQ_POSTCHANGE notifier and pass the cpu
         which gets switched automatically fixes this.
      
      Robert Schoene provided some important fixes on top of my
      initial quick shot version which are integrated in this patch:
      - Forgot some changes in power_end trace (TP_printk/variable names)
      - Variable dummy in power_end must now be cpu_id
      - Use static 64 bit variable instead of unsigned int for cpu_id
      
      [akpm@linux-foundation.org: build fix]
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Cc: davej@codemonkey.org.uk
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Acked-by: NArjan van de Ven <arjan@infradead.org>
      Cc: Robert Schoene <robert.schoene@tu-dresden.de>
      Tested-by: NRobert Schoene <robert.schoene@tu-dresden.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      4c21adf2
  13. 10 5月, 2010 2 次提交
  14. 10 4月, 2010 1 次提交
  15. 01 4月, 2010 2 次提交
  16. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit 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: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  17. 08 3月, 2010 1 次提交
  18. 13 1月, 2010 1 次提交
  19. 25 11月, 2009 3 次提交
    • T
      [ACPI/CPUFREQ] Introduce bios_limit per cpu cpufreq sysfs interface · e2f74f35
      Thomas Renninger 提交于
      This interface is mainly intended (and implemented) for ACPI _PPC BIOS
      frequency limitations, but other cpufreq drivers can also use it for
      similar use-cases.
      
      Why is this needed:
      
      Currently it's not obvious why cpufreq got limited.
      People see cpufreq/scaling_max_freq reduced, but this could have
      happened by:
        - any userspace prog writing to scaling_max_freq
        - thermal limitations
        - hardware (_PPC in ACPI case) limitiations
      
      Therefore export bios_limit (in kHz) to:
        - Point the user that it's the BIOS (broken or intended) which limits
          frequency
        - Export it as a sysfs interface for userspace progs.
          While this was a rarely used feature on laptops, there will appear
          more and more server implemenations providing "Green IT" features like
          allowing the service processor to limit the frequency. People want
          to know about HW/BIOS frequency limitations.
      
      All ACPI P-state driven cpufreq drivers are covered with this patch:
        - powernow-k8
        - powernow-k7
        - acpi-cpufreq
      
      Tested with a patched DSDT which limits the first two cores (_PPC returns 1)
      via _PPC, exposed by bios_limit:
      # echo 2200000 >cpu2/cpufreq/scaling_max_freq
      # cat cpu*/cpufreq/scaling_max_freq
      2600000
      2600000
      2200000
      2200000
      # #scaling_max_freq shows general user/thermal/BIOS limitations
      
      # cat cpu*/cpufreq/bios_limit
      2600000
      2600000
      2800000
      2800000
      # #bios_limit only shows the HW/BIOS limitation
      
      CC: Pallipadi Venkatesh <venkatesh.pallipadi@intel.com>
      CC: Len Brown <lenb@kernel.org>
      CC: davej@codemonkey.org.uk
      CC: linux@dominikbrodowski.net
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NDave Jones <davej@redhat.com>
      e2f74f35
    • A
      [CPUFREQ] make internal cpufreq_add_dev_* static · cf3289d0
      Alex Chiang 提交于
      No need to export these symbols; make them static.
      
      	cpufreq_add_dev_policy
      	cpufreq_add_dev_symlink
      	cpufreq_add_dev_interface
      Signed-off-by: NAlex Chiang <achiang@hp.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      cf3289d0
    • T
      [CPUFREQ] Use global sysfs cpufreq structure for conservative governor tunings · 49b015ce
      Thomas Renninger 提交于
      Same adustments that have been added to the ondemand recently.
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      Signed-off-by: NDave Jones <davej@redhat.com>
      49b015ce
  20. 18 11月, 2009 3 次提交