1. 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
  2. 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
  3. 28 6月, 2013 3 次提交
  4. 26 6月, 2013 1 次提交
  5. 24 6月, 2013 13 次提交
  6. 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
  7. 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
  8. 18 6月, 2013 9 次提交
  9. 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
  10. 05 6月, 2013 3 次提交
    • T
      cpufreq: powerpc: Add cpufreq driver for Freescale e500mc SoCs · defa4c73
      Tang Yuantian 提交于
      Add cpufreq driver for Freescale e500mc, e5500 and e6500 SoCs
      which are capable of changing the CPU frequency dynamically
      Signed-off-by: NTang Yuantian <Yuantian.Tang@freescale.com>
      Signed-off-by: NLi Yang <leoli@freescale.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      defa4c73
    • G
      cpufreq: cpufreq-cpu0: use the exact frequency for clk_set_rate() · 0ca68436
      Guennadi Liakhovetski 提交于
      clk_set_rate() isn't supposed to accept approximate frequencies, instead
      a supported frequency should be obtained from clk_round_rate() and then
      used to set the clock.
      Signed-off-by: NGuennadi Liakhovetski <g.liakhovetski@gmx.de>
      Acked-by: NShawn Guo <shawn.guo@linaro.org>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0ca68436
    • M
      cpufreq: protect 'policy->cpus' from offlining during __gov_queue_work() · 2f7021a8
      Michael Wang 提交于
      Jiri Kosina <jkosina@suse.cz> and Borislav Petkov <bp@alien8.de>
      reported the warning:
      
      [   51.616759] ------------[ cut here ]------------
      [   51.621460] WARNING: at arch/x86/kernel/smp.c:123 native_smp_send_reschedule+0x58/0x60()
      [   51.629638] Modules linked in: ext2 vfat fat loop snd_hda_codec_hdmi usbhid snd_hda_codec_realtek coretemp kvm_intel kvm snd_hda_intel snd_hda_codec crc32_pclmul crc32c_intel ghash_clmulni_intel snd_hwdep snd_pcm aesni_intel sb_edac aes_x86_64 ehci_pci snd_page_alloc glue_helper snd_timer xhci_hcd snd iTCO_wdt iTCO_vendor_support ehci_hcd edac_core lpc_ich acpi_cpufreq lrw gf128mul ablk_helper cryptd mperf usbcore usb_common soundcore mfd_core dcdbas evdev pcspkr processor i2c_i801 button microcode
      [   51.675581] CPU: 0 PID: 244 Comm: kworker/1:1 Tainted: G        W    3.10.0-rc1+ #10
      [   51.683407] Hardware name: Dell Inc. Precision T3600/0PTTT9, BIOS A08 01/24/2013
      [   51.690901] Workqueue: events od_dbs_timer
      [   51.695069]  0000000000000009 ffff88043a2f5b68 ffffffff8161441c ffff88043a2f5ba8
      [   51.702602]  ffffffff8103e540 0000000000000033 0000000000000001 ffff88043d5f8000
      [   51.710136]  00000000ffff0ce1 0000000000000001 ffff88044fc4fc08 ffff88043a2f5bb8
      [   51.717691] Call Trace:
      [   51.720191]  [<ffffffff8161441c>] dump_stack+0x19/0x1b
      [   51.725396]  [<ffffffff8103e540>] warn_slowpath_common+0x70/0xa0
      [   51.731473]  [<ffffffff8103e58a>] warn_slowpath_null+0x1a/0x20
      [   51.737378]  [<ffffffff81025628>] native_smp_send_reschedule+0x58/0x60
      [   51.744013]  [<ffffffff81072cfd>] wake_up_nohz_cpu+0x2d/0xa0
      [   51.749745]  [<ffffffff8104f6bf>] add_timer_on+0x8f/0x110
      [   51.755214]  [<ffffffff8105f6fe>] __queue_delayed_work+0x16e/0x1a0
      [   51.761470]  [<ffffffff8105f251>] ? try_to_grab_pending+0xd1/0x1a0
      [   51.767724]  [<ffffffff8105f78a>] mod_delayed_work_on+0x5a/0xa0
      [   51.773719]  [<ffffffff814f6b5d>] gov_queue_work+0x4d/0xc0
      [   51.779271]  [<ffffffff814f60cb>] od_dbs_timer+0xcb/0x170
      [   51.784734]  [<ffffffff8105e75d>] process_one_work+0x1fd/0x540
      [   51.790634]  [<ffffffff8105e6f2>] ? process_one_work+0x192/0x540
      [   51.796711]  [<ffffffff8105ef22>] worker_thread+0x122/0x380
      [   51.802350]  [<ffffffff8105ee00>] ? rescuer_thread+0x320/0x320
      [   51.808264]  [<ffffffff8106634a>] kthread+0xea/0xf0
      [   51.813200]  [<ffffffff81066260>] ? flush_kthread_worker+0x150/0x150
      [   51.819644]  [<ffffffff81623d5c>] ret_from_fork+0x7c/0xb0
      [   51.918165] nouveau E[     DRM] GPU lockup - switching to software fbcon
      [   51.930505]  [<ffffffff81066260>] ? flush_kthread_worker+0x150/0x150
      [   51.936994] ---[ end trace f419538ada83b5c5 ]---
      
      It was caused by the policy->cpus changed during the process of
      __gov_queue_work(), in other word, cpu offline happened.
      
      Use get/put_online_cpus() to prevent the offline from happening while
      __gov_queue_work() is running.
      
      [rjw: The problem has been present since recent commit 031299b3
      (cpufreq: governors: Avoid unnecessary per cpu timer interrupts)]
      
      References: https://lkml.org/lkml/2013/6/5/88Reported-by: NBorislav Petkov <bp@alien8.de>
      Reported-and-tested-by: NJiri Kosina <jkosina@suse.cz>
      Signed-off-by: NMichael Wang <wangyun@linux.vnet.ibm.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2f7021a8