1. 15 7月, 2013 1 次提交
    • P
      cpufreq: delete __cpuinit usage from all cpufreq files · 2760984f
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      This removes all the drivers/cpufreq uses of the __cpuinit macros
      from all C files.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      [v2: leave 2nd lines of args misaligned as requested by Viresh]
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: cpufreq@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Acked-by: NDirk Brandewie <dirk.j.brandewie@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      2760984f
  2. 04 7月, 2013 1 次提交
    • V
      cpufreq: Fix serialization of frequency transitions · 266c13d7
      Viresh Kumar 提交于
      Commit 7c30ed ("cpufreq: make sure frequency transitions are serialized")
      interacts poorly with systems that have a single core freqency for all
      cores.  On such systems we have a single policy for all cores with
      several CPUs.  When we do a frequency transition the governor calls the
      pre and post change notifiers which causes cpufreq_notify_transition()
      per CPU.  Since the policy is the same for all of them all CPUs after
      the first and the warnings added are generated by checking a per-policy
      flag the warnings will be triggered for all cores after the first.
      
      Fix this by allowing notifier to be called for n times. Where n is the number of
      cpus in policy->cpus.
      Reported-and-tested-by: NMark Brown <broonie@linaro.org>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      266c13d7
  3. 01 7月, 2013 1 次提交
    • S
      cpufreq: Fix cpufreq regression after suspend/resume · f51e1eb6
      Srivatsa S. Bhat 提交于
      Toralf Förster reported that the cpufreq ondemand governor behaves erratically
      (doesn't scale well) after a suspend/resume cycle. The problem was that the
      cpufreq subsystem's idea of the cpu frequencies differed from the actual
      frequencies set in the hardware after a suspend/resume cycle. Toralf bisected
      the problem to commit a66b2e50 (cpufreq: Preserve sysfs files across
      suspend/resume).
      
      Among other (harmless) things, that commit skipped the call to
      cpufreq_update_policy() in the resume path. But cpufreq_update_policy() plays
      an important role during resume, because it is responsible for checking if
      the BIOS changed the cpu frequencies behind our back and resynchronize the
      cpufreq subsystem's knowledge of the cpu frequencies, and update them
      accordingly.
      
      So, restore the call to cpufreq_update_policy() in the resume path to fix
      the cpufreq regression.
      Reported-and-tested-by: NToralf Förster <toralf.foerster@gmx.de>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Cc: 3.10+ <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f51e1eb6
  4. 28 6月, 2013 3 次提交
  5. 26 6月, 2013 1 次提交
  6. 24 6月, 2013 13 次提交
  7. 21 6月, 2013 3 次提交
    • V
      cpufreq: make __cpufreq_notify_transition() static · 0956df9c
      Viresh Kumar 提交于
      __cpufreq_notify_transition() is used only in cpufreq.c,
      make it static.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0956df9c
    • V
      cpufreq: Fix minor formatting issues · bb176f7d
      Viresh Kumar 提交于
      There were a few noticeable formatting issues in core cpufreq code.
      This cleans them up to make code look better.  The changes include:
       - Whitespace cleanup.
       - Rearrangements of code.
       - Multiline comments fixes.
       - Formatting changes to fit 80 columns.
      
      Copyright information in cpufreq.c is also updated to include my name
      for 2013.
      
      [rjw: Changelog]
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bb176f7d
    • X
      cpufreq: Fix governor start/stop race condition · 95731ebb
      Xiaoguang Chen 提交于
      Cpufreq governors' stop and start operations should be carried out
      in sequence.  Otherwise, there will be unexpected behavior, like in
      the example below.
      
      Suppose there are 4 CPUs and policy->cpu=CPU0, CPU1/2/3 are linked
      to CPU0.  The normal sequence is:
      
       1) Current governor is userspace.  An application tries to set the
          governor to ondemand.  It will call __cpufreq_set_policy() in
          which it will stop the userspace governor and then start the
          ondemand governor.
      
       2) Current governor is userspace.  The online of CPU3 runs on CPU0.
          It will call cpufreq_add_policy_cpu() in which it will first
          stop the userspace governor, and then start it again.
      
      If the sequence of the above two cases interleaves, it becomes:
      
       1) Application stops userspace governor
       2)                                  Hotplug stops userspace governor
      
      which is a problem, because the governor shouldn't be stopped twice
      in a row.  What happens next is:
      
       3) Application starts ondemand governor
       4)                                  Hotplug starts a governor
      
      In step 4, the hotplug is supposed to start the userspace governor,
      but now the governor has been changed by the application to ondemand,
      so the ondemand governor is started once again, which is incorrect.
      
      The solution is to prevent policy governors from being stopped
      multiple times in a row.  A governor should only be stopped once for
      one policy.  After it has been stopped, no more governor stop
      operations should be executed.
      
      Also add a mutex to serialize governor operations.
      
      [rjw: Changelog.  And you owe me a beverage of my choice.]
      Signed-off-by: NXiaoguang Chen <chenxg@marvell.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      95731ebb
  8. 19 6月, 2013 1 次提交
    • V
      cpufreq: Simplify userspace governor · d1922f02
      Viresh Kumar 提交于
      Userspace governor has got more code than what it needs for its
      functioning, so simplify it.
      
      Portions of code removed are:
       - Extra header files which aren't required anymore (rearrange them
         as well).
       - cpu_{max|min|cur|set}_freq, as they are always the same as
         policy->{max|min|cur}.
       - userspace_cpufreq_notifier_block as we don't need to set
         cpu_cur_freq anymore.
       - cpus_using_userspace_governor as it was for the notifier code.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d1922f02
  9. 18 6月, 2013 9 次提交
  10. 07 6月, 2013 5 次提交
    • V
      cpufreq: powerpc: move cpufreq driver to drivers/cpufreq · 7fb6a53d
      Viresh Kumar 提交于
      Move cpufreq driver of powerpc platform to drivers/cpufreq.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7fb6a53d
    • R
      ACPI / cpufreq: Add ACPI processor device IDs to acpi-cpufreq · c655affb
      Rafael J. Wysocki 提交于
      After commit ac212b69 (ACPI / processor: Use common hotplug
      infrastructure) the acpi-cpufreq module is not loaded automatically
      by udev which fails to match it against the x86cpu modalias.  Still,
      it can be matched against ACPI processor device IDs, which even
      makes more sense, because it depends on the ACPI processor driver
      that uses those device IDs to bind to processor devices.
      
      For this reason, add ACPI processor device IDs to acpi-cpufreq.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      c655affb
    • E
      cpufreq: kirkwood: Select CPU_FREQ_TABLE option · ea61623f
      Ezequiel Garcia 提交于
      We need to select CPU_FREQ_TABLE in order to build without
      this kind of errors:
      
      drivers/built-in.o: In function `kirkwood_cpufreq_cpu_exit':
      /home/zeta/linux-devel/marvell-legacy/drivers/cpufreq/kirkwood-cpufreq.c:145:
      undefined reference to `cpufreq_frequency_table_put_attr'
      Signed-off-by: NEzequiel Garcia <ezequiel.garcia@free-electrons.com>
      Acked-by: NJason Cooper <jason@lakedaemon.net>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      ea61623f
    • A
      cpufreq: big.LITTLE needs cpufreq table · fe948f54
      Arnd Bergmann 提交于
      Like a lot of the other cpufreq drivers, this one needs to
      select CONFIG_CPU_FREQ_TABLE to avoid a build error like
      
      built-in.o: In function `bL_cpufreq_set_target':
      cpufreq/arm_big_little.c:71: undefined reference to `cpufreq_frequency_table_target'
      built-in.o: In function `bL_cpufreq_verify_policy':
      cpufreq/arm_big_little.c:55: undefined reference to `cpufreq_frequency_table_verify'
      built-in.o: In function `bL_cpufreq_init':
      cpufreq/arm_big_little.c:170: undefined reference to `cpufreq_frequency_table_cpuinfo'
      cpufreq/arm_big_little.c:178: undefined reference to `cpufreq_frequency_table_get_attr'
      built-in.o:(.data+0x5a80c): undefined reference to `cpufreq_freq_attr_scaling_available_freqs'
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      fe948f54
    • A
      cpufreq: SPEAr needs cpufreq table · 4b416745
      Arnd Bergmann 提交于
      Like a lot of the other cpufreq drivers, this one needs to
      select CONFIG_CPU_FREQ_TABLE to avoid a build error like
      
      drivers/built-in.o: In function `spear_cpufreq_exit':
      spear-cpufreq.c:198: undefined reference to `cpufreq_frequency_table_put_attr'
      drivers/built-in.o: In function `spear_cpufreq_verify':
      spear-cpufreq.c:35: undefined reference to `cpufreq_frequency_table_verify'
      drivers/built-in.o: In function `spear_cpufreq_init':
      spear-cpufreq.c:181: undefined reference to `cpufreq_frequency_table_cpuinfo'
      spear-cpufreq.c:187: undefined reference to `cpufreq_frequency_table_get_attr'
      drivers/built-in.o: In function `spear_cpufreq_target':
      spear-cpufreq.c:120: undefined reference to `cpufreq_frequency_table_target'
      drivers/built-in.o:(.data+0x5e63c): undefined reference to `cpufreq_freq_attr_scaling_available_freqs'
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: cpufreq@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      4b416745
  11. 05 6月, 2013 2 次提交