1. 15 11月, 2012 8 次提交
  2. 01 11月, 2012 1 次提交
  3. 23 10月, 2012 2 次提交
    • T
      Fix memory leak in cpufreq stats. · e3773677
      Tu, Xiaobing 提交于
      When system enters sleep, non-boot CPUs will be disabled.
      Cpufreq stats sysfs is created when the CPU is up, but it is not
      freed when the CPU is going down. This will cause memory leak.
      Signed-off-by: Nxiaobing tu <xiaobing.tu@intel.com>
      Signed-off-by: Nguifang tang <guifang.tang@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e3773677
    • A
      cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code · e4df1cbc
      Andreas Herrmann 提交于
      Commit 6889125b
      (cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another CPU)
      causes powernow-k8 to trigger a preempt warning, e.g.:
      
        BUG: using smp_processor_id() in preemptible [00000000] code: cpufreq/3776
        caller is powernowk8_target+0x20/0x49
        Pid: 3776, comm: cpufreq Not tainted 3.6.0 #9
        Call Trace:
         [<ffffffff8125b447>] debug_smp_processor_id+0xc7/0xe0
         [<ffffffff814877e7>] powernowk8_target+0x20/0x49
         [<ffffffff81482b02>] __cpufreq_driver_target+0x82/0x8a
         [<ffffffff81484fc6>] cpufreq_governor_performance+0x4e/0x54
         [<ffffffff81482c50>] __cpufreq_governor+0x8c/0xc9
         [<ffffffff81482e6f>] __cpufreq_set_policy+0x1a9/0x21e
         [<ffffffff814839af>] store_scaling_governor+0x16f/0x19b
         [<ffffffff81484f16>] ? cpufreq_update_policy+0x124/0x124
         [<ffffffff8162b4a5>] ? _raw_spin_unlock_irqrestore+0x2c/0x49
         [<ffffffff81483640>] store+0x60/0x88
         [<ffffffff811708c0>] sysfs_write_file+0xf4/0x130
         [<ffffffff8111243b>] vfs_write+0xb5/0x151
         [<ffffffff811126e0>] sys_write+0x4a/0x71
         [<ffffffff816319a9>] system_call_fastpath+0x16/0x1b
      
      Fix this by by always using work_on_cpu().
      Signed-off-by: NAndreas Herrmann <andreas.herrmann3@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e4df1cbc
  4. 09 10月, 2012 4 次提交
  5. 20 9月, 2012 2 次提交
    • A
      cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name · 1bae9958
      Axel Lin 提交于
      omap_device_get_by_hwmod_name() returns ERR_PTR on error.
      Signed-off-by: NAxel Lin <axel.lin@gmail.com>
      Acked-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      1bae9958
    • T
      cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another CPU · 6889125b
      Tejun Heo 提交于
      powernowk8_target() runs off a per-cpu work item and if the
      cpufreq_policy->cpu is different from the current one, it migrates the
      kworker to the target CPU by manipulating current->cpus_allowed.  The
      function migrates the kworker back to the original CPU but this is
      still broken.  Workqueue concurrency management requires the kworkers
      to stay on the same CPU and powernowk8_target() ends up triggerring
      BUG_ON(rq != this_rq()) in try_to_wake_up_local() if it contends on
      fidvid_mutex and sleeps.
      
      It is unclear why this bug is being reported now.  Duncan says it
      appeared to be a regression of 3.6-rc1 and couldn't reproduce it on
      3.5.  Bisection seemed to point to 63d95a91 "workqueue: use @pool
      instead of @gcwq or @cpu where applicable" which is an non-functional
      change.  Given that the reproduce case sometimes took upto days to
      trigger, it's easy to be misled while bisecting.  Maybe something made
      contention on fidvid_mutex more likely?  I don't know.
      
      This patch fixes the bug by using work_on_cpu() instead if @pol->cpu
      isn't the same as the current one.  The code assumes that
      cpufreq_policy->cpu is kept online by the caller, which Rafael tells
      me is the case.
      
      stable: ed48ece2 ("workqueue: reimplement work_on_cpu() using
              system_wq") should be applied before this; otherwise, the
              behavior could be horrible.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Reported-by: NDuncan <1i5t5.duncan@cox.net>
      Tested-by: NDuncan <1i5t5.duncan@cox.net>
      Cc: Rafael J. Wysocki <rjw@sisk.pl>
      Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
      Cc: stable@vger.kernel.org
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=47301
      6889125b
  6. 15 9月, 2012 4 次提交
  7. 10 9月, 2012 8 次提交
  8. 05 9月, 2012 1 次提交
  9. 04 9月, 2012 1 次提交
  10. 22 8月, 2012 1 次提交
  11. 09 8月, 2012 2 次提交
  12. 21 7月, 2012 1 次提交
    • S
      cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch · a9144436
      Stephen Boyd 提交于
      Running one program that continuously hotplugs and replugs a cpu
      concurrently with another program that continuously writes to the
      scaling_setspeed node eventually deadlocks with:
      
      =============================================
      [ INFO: possible recursive locking detected ]
      3.4.0 #37 Tainted: G        W
      ---------------------------------------------
      filemonkey/122 is trying to acquire lock:
       (s_active#13){++++.+}, at: [<c01a3d28>] sysfs_remove_dir+0x9c/0xb4
      
      but task is already holding lock:
       (s_active#13){++++.+}, at: [<c01a22f0>] sysfs_write_file+0xe8/0x140
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(s_active#13);
        lock(s_active#13);
      
       *** DEADLOCK ***
      
       May be due to missing lock nesting notation
      
      2 locks held by filemonkey/122:
       #0:  (&buffer->mutex){+.+.+.}, at: [<c01a2230>] sysfs_write_file+0x28/0x140
       #1:  (s_active#13){++++.+}, at: [<c01a22f0>] sysfs_write_file+0xe8/0x140
      
      stack backtrace:
      [<c0014fcc>] (unwind_backtrace+0x0/0x120) from [<c00ca600>] (validate_chain+0x6f8/0x1054)
      [<c00ca600>] (validate_chain+0x6f8/0x1054) from [<c00cb778>] (__lock_acquire+0x81c/0x8d8)
      [<c00cb778>] (__lock_acquire+0x81c/0x8d8) from [<c00cb9c0>] (lock_acquire+0x18c/0x1e8)
      [<c00cb9c0>] (lock_acquire+0x18c/0x1e8) from [<c01a3ba8>] (sysfs_addrm_finish+0xd0/0x180)
      [<c01a3ba8>] (sysfs_addrm_finish+0xd0/0x180) from [<c01a3d28>] (sysfs_remove_dir+0x9c/0xb4)
      [<c01a3d28>] (sysfs_remove_dir+0x9c/0xb4) from [<c02d0e5c>] (kobject_del+0x10/0x38)
      [<c02d0e5c>] (kobject_del+0x10/0x38) from [<c02d0f74>] (kobject_release+0xf0/0x194)
      [<c02d0f74>] (kobject_release+0xf0/0x194) from [<c0565a98>] (cpufreq_cpu_put+0xc/0x24)
      [<c0565a98>] (cpufreq_cpu_put+0xc/0x24) from [<c05683f0>] (store+0x6c/0x74)
      [<c05683f0>] (store+0x6c/0x74) from [<c01a2314>] (sysfs_write_file+0x10c/0x140)
      [<c01a2314>] (sysfs_write_file+0x10c/0x140) from [<c014af44>] (vfs_write+0xb0/0x128)
      [<c014af44>] (vfs_write+0xb0/0x128) from [<c014b06c>] (sys_write+0x3c/0x68)
      [<c014b06c>] (sys_write+0x3c/0x68) from [<c000e0e0>] (ret_fast_syscall+0x0/0x3c)
      
      This is because store() in cpufreq.c indirectly calls
      kobject_get() via cpufreq_cpu_get() and is the last one to call
      kobject_put() via cpufreq_cpu_put(). Sysfs code should not call
      kobject_get() or kobject_put() directly (see the comment around
      sysfs_schedule_callback() for more information).
      
      Fix this deadlock by introducing two new functions:
      
      	struct cpufreq_policy *cpufreq_cpu_get_sysfs(unsigned int cpu)
      	void cpufreq_cpu_put_sysfs(struct cpufreq_policy *data)
      
      which do the same thing as cpufreq_cpu_{get,put}() but don't call
      kobject functions.
      
      To easily trigger this deadlock you can insert an msleep() with a
      reasonably large value right after the fail label at the bottom
      of the store() function in cpufreq.c and then write
      scaling_setspeed in one task and offline the cpu in another. The
      first task will hang and be detected by the hung task detector.
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      a9144436
  13. 20 7月, 2012 2 次提交
  14. 19 7月, 2012 1 次提交
  15. 02 5月, 2012 1 次提交
  16. 14 4月, 2012 1 次提交
    • K
      cpufreq: OMAP: fix build errors: depends on ARCH_OMAP2PLUS · 2d59dcfb
      Kevin Hilman 提交于
      The OMAP driver needs a 'depends on ARCH_OMAP2PLUS' since it only
      builds for OMAP2+ platforms.
      
      This 'depends on' was in the original patch from Russell King, but was
      erroneously removed by me when making this option user-selectable in
      commit b09db45c (cpufreq: OMAP driver depends CPUfreq tables.)  This
      patch remedies that.
      
      Apologies to Russell King for breaking his originally working patch.
      
      Also, thanks to Grazvydas Ignotas for reporting the same problem.
      
      Cc: Russell King <rmk+kernel@arm.linux.org.uk>
      Cc: Grazvydas Ignotas <notasas@gmail.com>
      Signed-off-by: NKevin Hilman <khilman@ti.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2d59dcfb