1. 23 3月, 2016 1 次提交
  2. 20 3月, 2016 1 次提交
  3. 03 3月, 2016 1 次提交
    • R
      cpufreq: acpi-cpufreq: Make read and write operations more efficient · ed757a2c
      Rafael J. Wysocki 提交于
      Setting a new CPU frequency and reading the current request value
      in the ACPI cpufreq driver involves each at least two switch
      instructions (there's more if the policy is shared).  One of
      them is present in drv_read/write() that prepares a command
      structure and the other happens in subsequent do_drv_read/write()
      when that structure is interpreted.  However, all of those switches
      may be avoided by using function pointers.
      
      To that end, add two function pointers to struct acpi_cpufreq_data
      to represent read and write operations on the frequency register
      and set them up during policy intitialization to point to the pair
      of routines suitable for the given processor (Intel/AMD MSR access
      or I/O port access).  Then, use those pointers in do_drv_read/write()
      and modify drv_read/write() to prepare the command structure for
      them without any checks.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      ed757a2c
  4. 27 2月, 2016 1 次提交
  5. 01 1月, 2016 2 次提交
  6. 09 10月, 2015 1 次提交
    • S
      cpufreq: acpi_cpufreq: prevent crash on reading freqdomain_cpus · e2530367
      Srinivas Pandruvada 提交于
      When freqdomain_cpus attribute is read from an offlined cpu, it will
      cause crash. This change prevents calling cpufreq_show_cpus when
      policy driver_data is NULL.
      
      Crash info:
      
      [  170.814949] BUG: unable to handle kernel NULL pointer dereference at 0000000000000018
      [  170.814990] IP: [<ffffffff813b2490>] _find_next_bit.part.0+0x10/0x70
      [  170.815021] PGD 227d30067 PUD 229e56067 PMD 0
      [  170.815043] Oops: 0000 [#2] SMP
      [  170.816022] CPU: 3 PID: 3121 Comm: cat Tainted: G      D    OE   4.3.0-rc3+ #33
      ...
      ...
      [  170.816657] Call Trace:
      [  170.816672]  [<ffffffff813b2505>] ? find_next_bit+0x15/0x20
      [  170.816696]  [<ffffffff8160e47c>] cpufreq_show_cpus+0x5c/0xd0
      [  170.816722]  [<ffffffffa031a409>] show_freqdomain_cpus+0x19/0x20 [acpi_cpufreq]
      [  170.816749]  [<ffffffff8160e65b>] show+0x3b/0x60
      [  170.816769]  [<ffffffff8129b31c>] sysfs_kf_seq_show+0xbc/0x130
      [  170.816793]  [<ffffffff81299be3>] kernfs_seq_show+0x23/0x30
      [  170.816816]  [<ffffffff81240f2c>] seq_read+0xec/0x390
      [  170.816837]  [<ffffffff8129a64a>] kernfs_fop_read+0x10a/0x160
      [  170.816861]  [<ffffffff8121d9b7>] __vfs_read+0x37/0x100
      [  170.816883]  [<ffffffff813217c0>] ? security_file_permission+0xa0/0xc0
      [  170.816909]  [<ffffffff8121e2e3>] vfs_read+0x83/0x130
      [  170.816930]  [<ffffffff8121f035>] SyS_read+0x55/0xc0
      ...
      ...
      [  170.817185] ---[ end trace bc6eadf82b2b965a ]---
      Signed-off-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Cc: 4.2+ <stable@vger.kernel.org> # 4.2+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e2530367
  7. 16 9月, 2015 1 次提交
  8. 23 7月, 2015 3 次提交
  9. 17 7月, 2015 2 次提交
  10. 27 5月, 2015 1 次提交
  11. 30 4月, 2014 1 次提交
  12. 07 4月, 2014 1 次提交
  13. 20 3月, 2014 1 次提交
    • S
      acpi-cpufreq: Fix CPU hotplug callback registration · 0197fbd2
      Srivatsa S. Bhat 提交于
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      Instead, the correct and race-free way of performing the callback
      registration is:
      
      	cpu_notifier_register_begin();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	/* Note the use of the double underscored version of the API */
      	__register_cpu_notifier(&foobar_cpu_notifier);
      
      	cpu_notifier_register_done();
      
      Fix the acpi-cpufreq code by using this latter form of callback registration.
      
      Cc: Ingo Molnar <mingo@kernel.org>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0197fbd2
  14. 12 3月, 2014 1 次提交
  15. 29 1月, 2014 1 次提交
  16. 17 1月, 2014 1 次提交
  17. 31 10月, 2013 1 次提交
  18. 26 10月, 2013 1 次提交
    • V
      cpufreq: Implement light weight ->target_index() routine · 9c0ebcf7
      Viresh Kumar 提交于
      Currently, the prototype of cpufreq_drivers target routines is:
      
      int target(struct cpufreq_policy *policy, unsigned int target_freq,
      		unsigned int relation);
      
      And most of the drivers call cpufreq_frequency_table_target() to get a valid
      index of their frequency table which is closest to the target_freq. And they
      don't use target_freq and relation after that.
      
      So, it makes sense to just do this work in cpufreq core before calling
      cpufreq_frequency_table_target() and simply pass index instead. But this can be
      done only with drivers which expose their frequency table with cpufreq core. For
      others we need to stick with the old prototype of target() until those drivers
      are converted to expose frequency tables.
      
      This patch implements the new light weight prototype for target_index() routine.
      It looks like this:
      
      int target_index(struct cpufreq_policy *policy, unsigned int index);
      
      CPUFreq core will call cpufreq_frequency_table_target() before calling this
      routine and pass index to it. Because CPUFreq core now requires to call routines
      present in freq_table.c CONFIG_CPU_FREQ_TABLE must be enabled all the time.
      
      This also marks target() interface as deprecated. So, that new drivers avoid
      using it. And Documentation is updated accordingly.
      
      It also converts existing .target() to newly defined light weight
      .target_index() routine for many driver.
      Acked-by: NHans-Christian Egtvedt <egtvedt@samfundet.no>
      Acked-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Acked-by: NRussell King <linux@arm.linux.org.uk>
      Acked-by: NDavid S. Miller <davem@davemloft.net>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rjw@rjwysocki.net>
      9c0ebcf7
  19. 25 10月, 2013 1 次提交
  20. 17 10月, 2013 1 次提交
  21. 16 10月, 2013 2 次提交
  22. 01 10月, 2013 1 次提交
  23. 25 9月, 2013 1 次提交
  24. 15 8月, 2013 1 次提交
  25. 10 8月, 2013 1 次提交
  26. 08 8月, 2013 1 次提交
  27. 26 7月, 2013 1 次提交
  28. 28 6月, 2013 1 次提交
  29. 24 6月, 2013 1 次提交
  30. 07 6月, 2013 1 次提交
  31. 05 6月, 2013 1 次提交
  32. 04 6月, 2013 1 次提交
  33. 27 5月, 2013 1 次提交
  34. 02 4月, 2013 1 次提交
  35. 25 3月, 2013 1 次提交