1. 20 3月, 2014 1 次提交
    • S
      acpi-cpufreq: Fix CPU hotplug callback registration · 0197fbd2
      Srivatsa S. Bhat 提交于
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      Instead, the correct and race-free way of performing the callback
      registration is:
      
      	cpu_notifier_register_begin();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	/* Note the use of the double underscored version of the API */
      	__register_cpu_notifier(&foobar_cpu_notifier);
      
      	cpu_notifier_register_done();
      
      Fix the acpi-cpufreq code by using this latter form of callback registration.
      
      Cc: Ingo Molnar <mingo@kernel.org>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0197fbd2
  2. 29 1月, 2014 1 次提交
  3. 17 1月, 2014 1 次提交
  4. 31 10月, 2013 1 次提交
  5. 26 10月, 2013 1 次提交
    • V
      cpufreq: Implement light weight ->target_index() routine · 9c0ebcf7
      Viresh Kumar 提交于
      Currently, the prototype of cpufreq_drivers target routines is:
      
      int target(struct cpufreq_policy *policy, unsigned int target_freq,
      		unsigned int relation);
      
      And most of the drivers call cpufreq_frequency_table_target() to get a valid
      index of their frequency table which is closest to the target_freq. And they
      don't use target_freq and relation after that.
      
      So, it makes sense to just do this work in cpufreq core before calling
      cpufreq_frequency_table_target() and simply pass index instead. But this can be
      done only with drivers which expose their frequency table with cpufreq core. For
      others we need to stick with the old prototype of target() until those drivers
      are converted to expose frequency tables.
      
      This patch implements the new light weight prototype for target_index() routine.
      It looks like this:
      
      int target_index(struct cpufreq_policy *policy, unsigned int index);
      
      CPUFreq core will call cpufreq_frequency_table_target() before calling this
      routine and pass index to it. Because CPUFreq core now requires to call routines
      present in freq_table.c CONFIG_CPU_FREQ_TABLE must be enabled all the time.
      
      This also marks target() interface as deprecated. So, that new drivers avoid
      using it. And Documentation is updated accordingly.
      
      It also converts existing .target() to newly defined light weight
      .target_index() routine for many driver.
      Acked-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      Acked-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NRussell King <linux@arm.linux.org.uk>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      9c0ebcf7
  6. 25 10月, 2013 1 次提交
  7. 17 10月, 2013 1 次提交
  8. 16 10月, 2013 2 次提交
  9. 01 10月, 2013 1 次提交
  10. 25 9月, 2013 1 次提交
  11. 15 8月, 2013 1 次提交
  12. 10 8月, 2013 1 次提交
  13. 08 8月, 2013 1 次提交
  14. 26 7月, 2013 1 次提交
  15. 28 6月, 2013 1 次提交
  16. 24 6月, 2013 1 次提交
  17. 07 6月, 2013 1 次提交
  18. 05 6月, 2013 1 次提交
  19. 04 6月, 2013 1 次提交
  20. 27 5月, 2013 1 次提交
  21. 02 4月, 2013 1 次提交
  22. 25 3月, 2013 1 次提交
  23. 02 2月, 2013 2 次提交
  24. 23 1月, 2013 1 次提交
  25. 10 9月, 2012 4 次提交
    • A
      acpi-cpufreq: Add compatibility for legacy AMD cpb sysfs knob · 11269ff5
      Andre Przywara 提交于
      The powernow-k8 driver supported a sysfs knob called "cpb", which was
      instantiated per CPU, but actually acted globally for the whole
      system. To keep some compatibility with this feature, we re-introduce
      this behavior here, but:
      a) only enable it on AMD CPUs and
      b) protect it with a Kconfig switch
      
      I'd like to consider this feature obsolete. Lets keep it around for
      some kernel versions and then phase it out.
      Signed-off-by: NAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      11269ff5
    • A
      acpi-cpufreq: Add support for disabling dynamic overclocking · 615b7300
      Andre Przywara 提交于
      One feature present in powernow-k8 that isn't present in acpi-cpufreq
      is support for enabling or disabling AMD's core performance boost
      technology. This patch adds support to acpi-cpufreq, but also
      includes support for Intel's dynamic acceleration.
      
      The original boost disabling sysfs file was per CPU, but acted
      globally. Also the naming (cpb) was at least not intuitive.
      So lets introduce a single file simply called "boost", which sits
      once in /sys/devices/system/cpu/cpufreq.
      This should be the only way of using this feature, so add
      documentation about the rationale and the usage.
      
      A following patch will re-introduce the cpb knob for compatibility
      reasons on AMD CPUs.
      
      Per-CPU boost switching is possible, but not trivial and is thus
      postponed to a later patch series.
      Signed-off-by: NAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      615b7300
    • A
      acpi-cpufreq: Add quirk to disable _PSD usage on all AMD CPUs · acd31624
      Andre Przywara 提交于
      To workaround some Windows specific behavior, the ACPI _PSD table
      on AMD desktop boards advertises all cores as dependent, meaning
      that they all can only use the same P-state. acpi-cpufreq strictly
      obeys this description, instantiating one CPU only and symlinking
      the others. But the hardware can have distinct frequencies for each
      core and powernow-k8 did it that way.
      So, in order to use the hardware to its full potential and keep the
      original powernow-k8 behavior, lets override the _PSD table setting
      on AMD hardware.
      We use the siblings table, as it matches the current hardware
      behavior.
      Signed-off-by: NAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      acd31624
    • M
      acpi-cpufreq: Add support for modern AMD CPUs · 3dc9a633
      Matthew Garrett 提交于
      The programming model for P-states on modern AMD CPUs is very similar to
      that of Intel and VIA. It makes sense to consolidate this support into one
      driver rather than duplicating functionality between two of them. This
      patch adds support for AMDs with hardware P-state control to acpi-cpufreq.
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      Signed-off-by: NAndre Przywara <andre.przywara@amd.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      3dc9a633
  26. 14 7月, 2011 1 次提交
  27. 11 7月, 2011 1 次提交
  28. 20 5月, 2011 1 次提交
  29. 04 5月, 2011 1 次提交
    • 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
  30. 12 10月, 2010 1 次提交
    • Z
      acpi-cpufreq: fix a memleak when unloading driver · dab5fff1
      Zhang Rui 提交于
      We didn't free per_cpu(acfreq_data, cpu)->freq_table
      when acpi_freq driver is unloaded.
      
      Resulting in the following messages in /sys/kernel/debug/kmemleak:
      
      unreferenced object 0xf6450e80 (size 64):
        comm "modprobe", pid 1066, jiffies 4294677317 (age 19290.453s)
        hex dump (first 32 bytes):
          00 00 00 00 e8 a2 24 00 01 00 00 00 00 9f 24 00  ......$.......$.
          02 00 00 00 00 6a 18 00 03 00 00 00 00 35 0c 00  .....j.......5..
        backtrace:
          [<c123ba97>] kmemleak_alloc+0x27/0x50
          [<c109f96f>] __kmalloc+0xcf/0x110
          [<f9da97ee>] acpi_cpufreq_cpu_init+0x1ee/0x4e4 [acpi_cpufreq]
          [<c11cd8d2>] cpufreq_add_dev+0x142/0x3a0
          [<c11920b7>] sysdev_driver_register+0x97/0x110
          [<c11cce56>] cpufreq_register_driver+0x86/0x140
          [<f9dad080>] 0xf9dad080
          [<c1001130>] do_one_initcall+0x30/0x160
          [<c10626e9>] sys_init_module+0x99/0x1e0
          [<c1002d97>] sysenter_do_call+0x12/0x26
          [<ffffffff>] 0xffffffff
      
      https://bugzilla.kernel.org/show_bug.cgi?id=15807#c21Tested-by: NToralf Forster <toralf.foerster@gmx.de>
      Signed-off-by: NZhang Rui <rui.zhang@intel.com>
      Signed-off-by: NLen Brown <len.brown@intel.com>
      dab5fff1
  31. 01 10月, 2010 1 次提交
  32. 13 8月, 2010 1 次提交
  33. 04 8月, 2010 2 次提交
    • T
      [CPUFREQ] x86 cpufreq: Make trace_power_frequency cpufreq driver independent · 6f4f2723
      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
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      CC: davej@redhat.com
      CC: arjan@infradead.org
      CC: linux-kernel@vger.kernel.org
      CC: robert.schoene@tu-dresden.de
      Tested-by: robert.schoene@tu-dresden.de
      Signed-off-by: NDave Jones <davej@redhat.com>
      6f4f2723
    • T
      [CPUFREQ] acpi-cpufreq: Fix CPU_ANY CPUFREQ_{PRE,POST}CHANGE notification · 6b72e393
      Thomas Renninger 提交于
      Signed-off-by: NThomas Renninger <trenn@suse.de>
      CC: venki@google.com
      CC: davej@redhat.com
      CC: arjan@infradead.org
      CC: linux-kernel@vger.kernel.org
      Signed-off-by: NDave Jones <davej@redhat.com>
      6b72e393
  34. 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