1. 15 11月, 2012 1 次提交
    • V
      cpufreq / core: Fix printing of governor and driver name · 4b972f0b
      viresh kumar 提交于
      Arrays for governer and driver name are of size CPUFREQ_NAME_LEN or 16.
      i.e. 15 bytes for name and 1 for trailing '\0'.
      
      When cpufreq driver print these names (for sysfs), it includes '\n' or ' ' in
      the fmt string and still passes length as CPUFREQ_NAME_LEN. If the driver or
      governor names are using all 15 fields allocated to them, then the trailing '\n'
      or ' ' will never be printed. And so commands like:
      
      root@linaro-developer# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
      
      will print something like:
      
      cpufreq_foodrvroot@linaro-developer#
      
      Fix this by increasing print length by one character.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      4b972f0b
  2. 21 3月, 2012 1 次提交
  3. 16 3月, 2012 1 次提交
    • P
      device.h: audit and cleanup users in main include dir · 313162d0
      Paul Gortmaker 提交于
      The <linux/device.h> header includes a lot of stuff, and
      it in turn gets a lot of use just for the basic "struct device"
      which appears so often.
      
      Clean up the users as follows:
      
      1) For those headers only needing "struct device" as a pointer
      in fcn args, replace the include with exactly that.
      
      2) For headers not really using anything from device.h, simply
      delete the include altogether.
      
      3) For headers relying on getting device.h implicitly before
      being included themselves, now explicitly include device.h
      
      4) For files in which doing #1 or #2 uncovers an implicit
      dependency on some other header, fix by explicitly adding
      the required header(s).
      
      Any C files that were implicitly relying on device.h to be
      present have already been dealt with in advance.
      
      Total removals from #1 and #2: 51.  Total additions coming
      from #3: 9.  Total other implicit dependencies from #4: 7.
      
      As of 3.3-rc1, there were 110, so a net removal of 42 gives
      about a 38% reduction in device.h presence in include/*
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      313162d0
  4. 15 3月, 2012 1 次提交
  5. 29 6月, 2011 1 次提交
  6. 04 5月, 2011 2 次提交
    • T
      [CPUFREQ] cpufreq.h: Fix some checkpatch.pl coding style issues. · 335dc333
      Thiago Farina 提交于
      Before:
      $ scripts/checkpatch.pl --file --terse include/linux/cpufreq.h
      total: 14 errors, 11 warnings, 419 lines checked
      
      After:
      $ scripts/checkpatch.pl --file --terse include/linux/cpufreq.h
      total: 2 errors, 4 warnings, 422 lines checked
      Signed-off-by: NThiago Farina <tfransosi@gmail.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      335dc333
    • 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
  7. 17 3月, 2011 2 次提交
  8. 04 8月, 2010 1 次提交
  9. 10 4月, 2010 1 次提交
  10. 25 11月, 2009 1 次提交
    • 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
  11. 29 10月, 2009 1 次提交
  12. 02 9月, 2009 1 次提交
  13. 10 3月, 2009 1 次提交
    • D
      Revert "[CPUFREQ] Disable sysfs ui for p4-clockmod." · 129f8ae9
      Dave Jones 提交于
      This reverts commit e088e4c9.
      
      Removing the sysfs interface for p4-clockmod was flagged as a
      regression in bug 12826.
      
      Course of action:
       - Find out the remaining causes of overheating, and fix them
         if possible. ACPI should be doing the right thing automatically.
         If it isn't, we need to fix that.
       - mark p4-clockmod ui as deprecated
       - try again with the removal in six months.
      
      It's not really feasible to printk about the deprecation, because
      it needs to happen at all the sysfs entry points, which means adding
      a lot of strcmp("p4-clockmod".. calls to the core, which.. bleuch.
      Signed-off-by: NDave Jones <davej@redhat.com>
      129f8ae9
  14. 06 1月, 2009 1 次提交
  15. 06 12月, 2008 1 次提交
    • M
      [CPUFREQ] Disable sysfs ui for p4-clockmod. · e088e4c9
      Matthew Garrett 提交于
      p4-clockmod has a long history of abuse.   It pretends to be a CPU
      frequency scaling driver, even though it doesn't actually change
      the CPU frequency, but instead just modulates the frequency with
      wait-states.
      The biggest misconception is that when running at the lower 'frequency'
      p4-clockmod is saving power.  This isn't the case, as workloads running
      slower take longer to complete, preventing the CPU from entering deep C states.
      
      However p4-clockmod does have a purpose.  It can prevent overheating.
      Having it hooked up to the cpufreq interfaces is the wrong way to achieve
      cooling however. It should instead be hooked up to ACPI.
      
      This diff introduces a means for a cpufreq driver to register with the
      cpufreq core, but not present a sysfs interface.
      Signed-off-by: NMatthew Garrett <mjg@redhat.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      e088e4c9
  16. 10 10月, 2008 1 次提交
  17. 31 7月, 2008 1 次提交
  18. 20 5月, 2008 1 次提交
  19. 29 4月, 2008 2 次提交
  20. 07 2月, 2008 1 次提交
    • 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
  21. 05 10月, 2007 3 次提交
  22. 27 9月, 2007 1 次提交
  23. 03 5月, 2007 1 次提交
  24. 27 4月, 2007 1 次提交
  25. 27 2月, 2007 1 次提交
  26. 23 2月, 2007 1 次提交
  27. 11 2月, 2007 1 次提交
  28. 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
  29. 26 7月, 2006 1 次提交
    • A
      [PATCH] Reorganize the cpufreq cpu hotplug locking to not be totally bizare · 153d7f3f
      Arjan van de Ven 提交于
      The patch below moves the cpu hotplugging higher up in the cpufreq
      layering; this is needed to avoid recursive taking of the cpu hotplug
      lock and to otherwise detangle the mess.
      
      The new rules are:
      1. you must do lock_cpu_hotplug() around the following functions:
         __cpufreq_driver_target
         __cpufreq_governor (for CPUFREQ_GOV_LIMITS operation only)
         __cpufreq_set_policy
      2. governer methods (.governer) must NOT take the lock_cpu_hotplug()
         lock in any way; they are called with the lock taken already
      3. if your governer spawns a thread that does things, like calling
         __cpufreq_driver_target, your thread must honor rule #1.
      4. the policy lock and other cpufreq internal locks nest within
         the lock_cpu_hotplug() lock.
      
      I'm not entirely happy about how the __cpufreq_governor rule ended up
      (conditional locking rule depending on the argument) but basically all
      callers pass this as a constant so it's not too horrible.
      
      The patch also removes the cpufreq_governor() function since during the
      locking audit it turned out to be entirely unused (so no need to fix it)
      
      The patch works on my testbox, but it could use more testing
      (otoh... it can't be much worse than the current code)
      Signed-off-by: NArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      153d7f3f
  30. 26 6月, 2006 1 次提交
  31. 26 4月, 2006 1 次提交
  32. 09 2月, 2006 1 次提交
  33. 19 1月, 2006 1 次提交
  34. 07 12月, 2005 1 次提交
    • V
      [CPUFREQ] CPU frequency display in /proc/cpuinfo · 95235ca2
      Venkatesh Pallipadi 提交于
      What is the value shown in "cpu MHz" of /proc/cpuinfo when CPUs are capable of
      changing frequency?
      
      Today the answer is: It depends.
      On i386:
      SMP kernel - It is always the boot frequency
      UP kernel - Scales with the frequency change and shows that was last set.
      
      On x86_64:
      There is one single variable cpu_khz that gets written by all the CPUs. So,
      the frequency set by last CPU will be seen on /proc/cpuinfo of all the
      CPUs in the system. What you see also depends on whether you have constant_tsc
      capable CPU or not.
      
      On ia64:
      It is always boot time frequency of a particular CPU that gets displayed.
      
      The patch below changes this to:
      Show the last known frequency of the particular CPU, when cpufreq is present. If
      cpu doesnot support changing of frequency through cpufreq, then boot frequency
      will be shown. The patch affects i386, x86_64 and ia64 architectures.
      
      Signed-off-by: Venkatesh Pallipadi<venkatesh.pallipadi@intel.com>
      Signed-off-by: NDave Jones <davej@redhat.com>
      95235ca2
  35. 31 10月, 2005 1 次提交
    • T
      [PATCH] fix missing includes · 4e57b681
      Tim Schmielau 提交于
      I recently picked up my older work to remove unnecessary #includes of
      sched.h, starting from a patch by Dave Jones to not include sched.h
      from module.h. This reduces the number of indirect includes of sched.h
      by ~300. Another ~400 pointless direct includes can be removed after
      this disentangling (patch to follow later).
      However, quite a few indirect includes need to be fixed up for this.
      
      In order to feed the patches through -mm with as little disturbance as
      possible, I've split out the fixes I accumulated up to now (complete for
      i386 and x86_64, more archs to follow later) and post them before the real
      patch.  This way this large part of the patch is kept simple with only
      adding #includes, and all hunks are independent of each other.  So if any
      hunk rejects or gets in the way of other patches, just drop it.  My scripts
      will pick it up again in the next round.
      Signed-off-by: NTim Schmielau <tim@physik3.uni-rostock.de>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      4e57b681