1. 06 3月, 2008 3 次提交
    • S
      [CPUFREQ] fix section mismatch warnings · f6ebef30
      Sam Ravnborg 提交于
      Fix the following warnings:
      WARNING: vmlinux.o(.text+0xfe6711): Section mismatch in reference from the function cpufreq_unregister_driver() to the variable .cpuinit.data:cpufreq_cpu_notifier
      WARNING: vmlinux.o(.text+0xfe68af): Section mismatch in reference from the function cpufreq_register_driver() to the variable .cpuinit.data:cpufreq_cpu_notifier
      WARNING: vmlinux.o(.exit.text+0xc4fa): Section mismatch in reference from the function cpufreq_stats_exit() to the variable .cpuinit.data:cpufreq_stat_cpu_notifier
      
      The warnings were casued by references to unregister_hotcpu_notifier()
      from normal functions or exit functions.
      This is flagged by modpost as a potential error because
      it does not know that for the non HOTPLUG_CPU
      scenario the unregister_hotcpu_notifier() is a nop.
      Silence the warning by replacing the __initdata
      annotation with a __refdata annotation.
      Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: NDave Jones <davej@codemonkey.org.uk>
      f6ebef30
    • D
      [CPUFREQ] Fix missing cpufreq_cpu_put() call in ->store · a07530b4
      Dave Jones 提交于
      refactor to use gotos instead of explicit exit paths
      Signed-off-by: NDave Jones <davej@redhat.com>
      a07530b4
    • D
      [CPUFREQ] Fix missing cpufreq_cpu_put() call in ->show · 0db4a8a9
      Dave Jones 提交于
      refactor to use gotos instead of explicit exit paths
      Signed-off-by: NDave Jones <davej@redhat.com>
      0db4a8a9
  2. 22 2月, 2008 1 次提交
    • B
      cpufreq: fix kobject reference count handling · 7ab47050
      Balaji Rao 提交于
      The cpufreq core should not take an extra kobject reference count for no
      reason, and then refuse to release it.  This has been reported as
      keeping machines from properly powering down all the way.
      Signed-off-by: NBalaji Rao <balajirrao@gmail.com>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Cc: Yi Yang <yi.y.yang@intel.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Frans Pop <elendil@planet.nl>
      Cc: Yinghai Lu <yhlu.kernel@gmail.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      7ab47050
  3. 07 2月, 2008 2 次提交
    • V
      [CPUFREQ] Eliminate cpufreq_userspace scaling_setspeed deadlock · 9e76988e
      Venki Pallipadi 提交于
      Eliminate cpufreq_userspace scaling_setspeed deadlock.
      
      Luming Yu recently uncovered yet another cpufreq related deadlock.
      One thread that continuously switches the governors and the other thread that
      repeatedly cats the contents of cpufreq directory causes both these threads to
      go into a deadlock.
      
      Detailed examination of the deadlock showed the exact flow before the deadlock
      as:
      
      Thread 1			Thread 2
      ________			________
      				cats files under /sys/devices/.../cpufreq/
      Set governor to userspace
        Adds a new sysfs entry for
        scaling_setspeed
      				cats files under /sys/devices/.../cpufreq/
      
      Set governor to performance
        Holds cpufreq_rw_sem in write
        mode
        Sends a STOP notify to
        userspace governor
      				cat /sys/devices/.../cpufreq/scaling_setspeed
      				  Gets a handle on the above sysfs entry with
      				  sysfs_get_active
      				  Blocks while trying to get cpufreq_rw_sem
      				  in read mode
        Remove a sysfs entry for
        scaling_setspeed
          Blocks on sysfs_deactivate
          while waiting for earlier
          get_active (on other thread)
          to drain
      
      At this point both threads go into deadlock and any other thread that tries to
      do anything with sysfs cpufreq will also block.
      
      There seems to be no easy way to avoid this deadlock as long as
      cpufreq_userspace adds/removes the sysfs entry under same kobject as cpufreq.
      Below patch moves scaling_setspeed to cpufreq.c, keeping it always and calling
      back the governor on read/write. This is the cleanest fix I could think of,
      even though adding two callbacks in governor structure just for this seems
      unnecessary.
      
      Note that the change makes scaling_setspeed under /sys/.../cpufreq permanent
      and returns <unsupported> when governor is not userspace.
      Signed-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      9e76988e
    • J
      [CPUFREQ] drivers/cpufreq: Add missing "space" · a4a9df58
      Joe Perches 提交于
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      a4a9df58
  4. 30 1月, 2008 1 次提交
    • Y
      cpufreq: fix obvious condition statement error · 53391fa2
      Yi Yang 提交于
      The function __cpufreq_set_policy in file drivers/cpufreq/cpufreq.c
      has a very obvious error:
      
              if (policy->min > data->min && policy->min > policy->max) {
                      ret = -EINVAL;
                      goto error_out;
              }
      
      This condtion statement is wrong because it returns -EINVAL only if
      policy->min is greater than policy->max (in this case,
      "policy->min > data->min" is true for ever.). In fact, it should
      return -EINVAL as well if policy->max is less than data->min.
      
      The correct condition should be:
      
      	if (policy->min > data->max || policy->max < data->min) {
      
      The following test result testifies the above conclusion:
      
      Before applying this patch:
      
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
      2394000 1596000
      [root@yangyi-dev /]# echo 1596000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      1596000
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
      1596000
      [root@yangyi-dev /]# echo "2000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
      -bash: echo: write error: Invalid argument
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
      1596000
      [root@yangyi-dev /]# echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      1596000
      [root@yangyi-dev /]# echo "1595000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      1596000
      [root@yangyi-dev /]#
      
      After applying this patch:
      
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
      2394000 1596000
      [root@yangyi-dev /]# echo 1596000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      1596000
      [root@yangyi-dev /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
      1596000
      [root@localhost /]# echo "2000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
      -bash: echo: write error: Invalid argument
      [root@localhost /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
      1596000
      [root@localhost /]# echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      -bash: echo: write error: Invalid argument
      [root@localhost /]# echo "1595000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      -bash: echo: write error: Invalid argument
      [root@localhost /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      1596000
      [root@localhost /]# echo "1596000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      [root@localhost /]# echo "2394000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      [root@localhost /]# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
      2394000
      [root@localhost /]
      Signed-off-by: NYi Yang <yi.y.yang@intel.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      53391fa2
  5. 25 1月, 2008 2 次提交
  6. 18 12月, 2007 1 次提交
  7. 13 10月, 2007 1 次提交
  8. 10 10月, 2007 1 次提交
    • A
      [CPUFREQ] Don't take semaphore in cpufreq_quick_get() · 9eb59573
      Andi Kleen 提交于
      I don't see any reason to take an expensive lock in cpufreq_quick_get()
      Reading policy->cur is a single atomic operation and after
      the lock is dropped again the state could change any time anyways.
      
      So don't take the lock in the first place.
      
      This also makes this function interrupt safe which is useful
      for some code of mine.
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Cc: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      9eb59573
  9. 05 10月, 2007 4 次提交
  10. 13 7月, 2007 2 次提交
  11. 22 6月, 2007 1 次提交
  12. 30 5月, 2007 1 次提交
  13. 10 5月, 2007 1 次提交
    • R
      Add suspend-related notifications for CPU hotplug · 8bb78442
      Rafael J. Wysocki 提交于
      Since nonboot CPUs are now disabled after tasks and devices have been
      frozen and the CPU hotplug infrastructure is used for this purpose, we need
      special CPU hotplug notifications that will help the CPU-hotplug-aware
      subsystems distinguish normal CPU hotplug events from CPU hotplug events
      related to a system-wide suspend or resume operation in progress.  This
      patch introduces such notifications and causes them to be used during
      suspend and resume transitions.  It also changes all of the
      CPU-hotplug-aware subsystems to take these notifications into consideration
      (for now they are handled in the same way as the corresponding "normal"
      ones).
      
      [oleg@tv-sign.ru: cleanups]
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: Gautham R Shenoy <ego@in.ibm.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Signed-off-by: NOleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8bb78442
  14. 27 4月, 2007 2 次提交
  15. 27 3月, 2007 1 次提交
  16. 27 2月, 2007 1 次提交
  17. 23 2月, 2007 1 次提交
  18. 11 2月, 2007 2 次提交
  19. 29 1月, 2007 1 次提交
  20. 13 12月, 2006 1 次提交
  21. 08 12月, 2006 1 次提交
  22. 22 11月, 2006 1 次提交
    • D
      WorkStruct: Pass the work_struct pointer instead of context data · 65f27f38
      David Howells 提交于
      Pass the work_struct pointer to the work function rather than context data.
      The work function can use container_of() to work out the data.
      
      For the cases where the container of the work_struct may go away the moment the
      pending bit is cleared, it is made possible to defer the release of the
      structure by deferring the clearing of the pending bit.
      
      To make this work, an extra flag is introduced into the management side of the
      work_struct.  This governs auto-release of the structure upon execution.
      
      Ordinarily, the work queue executor would release the work_struct for further
      scheduling or deallocation by clearing the pending bit prior to jumping to the
      work function.  This means that, unless the driver makes some guarantee itself
      that the work_struct won't go away, the work function may not access anything
      else in the work_struct or its container lest they be deallocated..  This is a
      problem if the auxiliary data is taken away (as done by the last patch).
      
      However, if the pending bit is *not* cleared before jumping to the work
      function, then the work function *may* access the work_struct and its container
      with no problems.  But then the work function must itself release the
      work_struct by calling work_release().
      
      In most cases, automatic release is fine, so this is the default.  Special
      initiators exist for the non-auto-release case (ending in _NAR).
      Signed-Off-By: NDavid Howells <dhowells@redhat.com>
      65f27f38
  23. 21 11月, 2006 1 次提交
    • L
      Add "pure_initcall" for static variable initialization · b3438f82
      Linus Torvalds 提交于
      This is a quick hack to overcome the fact that SRCU currently does not
      allow static initializers, and we need to sometimes initialize those
      things before any other initializers (even "core" ones) can do so.
      
      Currently we don't allow this at all for modules, and the only user that
      needs is right now is cpufreq. As reported by Thomas Gleixner:
      
         "Commit b4dfdbb3 ("[PATCH] cpufreq:
          make the transition_notifier chain use SRCU breaks cpu frequency
          notification users, which register the callback > on core_init
          level."
      
      Cc: Thomas Gleixner <tglx@timesys.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Andrew Morton <akpm@osdl.org>,
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b3438f82
  24. 07 11月, 2006 1 次提交
  25. 16 10月, 2006 1 次提交
    • V
      [CPUFREQ][8/8] acpi-cpufreq: Add support for freq feedback from hardware · dfde5d62
      Venkatesh Pallipadi 提交于
      Enable ondemand governor and acpi-cpufreq to use IA32_APERF and IA32_MPERF MSR
      to get active frequency feedback for the last sampling interval. This will
      make ondemand take right frequency decisions when hardware coordination of
      frequency is going on.
      
      Without APERF/MPERF, ondemand can take wrong decision at times due
      to underlying hardware coordination or TM2.
      Example:
      * CPU 0 and CPU 1 are hardware cooridnated.
      * CPU 1 running at highest frequency.
      * CPU 0 was running at highest freq. Now ondemand reduces it to
        some intermediate frequency based on utilization.
      * Due to underlying hardware coordination with other CPU 1, CPU 0 continues to
        run at highest frequency (as long as other CPU is at highest).
      * When ondemand samples CPU 0 again next time, without actual frequency
        feedback from APERF/MPERF, it will think that previous frequency change
        was successful and can go to wrong target frequency. This is because it
        thinks that utilization it has got this sampling interval is when running at
        intermediate frequency, rather than actual highest frequency.
      
      More information about IA32_APERF IA32_MPERF MSR:
      Refer to IA-32 Intel® Architecture Software Developer's Manual at
      http://developer.intel.comSigned-off-by: NVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      dfde5d62
  26. 04 10月, 2006 1 次提交
    • A
      [PATCH] cpufreq: make the transition_notifier chain use SRCU · b4dfdbb3
      Alan Stern 提交于
      This patch (as762) changes the cpufreq_transition_notifier_list from a
      blocking_notifier_head to an srcu_notifier_head.  This will prevent errors
      caused attempting to call down_read() to access the notifier chain at a
      time when interrupts must remain disabled, during system suspend.
      
      It's not clear to me whether this is really necessary; perhaps the chain
      could be made into an atomic_notifier.  However a couple of the callout
      routines do use blocking operations, so this approach seems safer.
      
      The head of the notifier chain needs to be initialized before use; this is
      done by an __init routine at core_initcall time.  If this turns out not to
      be a good choice, it can easily be changed.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Cc: Jesse Brandeburg <jesse.brandeburg@gmail.com>
      Cc: Dave Jones <davej@codemonkey.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      b4dfdbb3
  27. 27 9月, 2006 1 次提交
  28. 12 8月, 2006 1 次提交
  29. 01 8月, 2006 2 次提交