1. 29 9月, 2014 3 次提交
    • S
      cpufreq: powernv: Set the cpus to nominal frequency during reboot/kexec · cf30af76
      Shilpasri G Bhat 提交于
      This patch ensures the cpus to kexec/reboot at nominal frequency.
      Nominal frequency is the highest cpu frequency on PowerPC at
      which the cores can run without getting throttled.
      
      If the host kernel had set the cpus to a low pstate and then it
      kexecs/reboots to a cpufreq disabled kernel it would cause the target
      kernel to perform poorly. It will also increase the boot up time of
      the target kernel. So set the cpus to high pstate, in this case to
      nominal frequency before rebooting to avoid such scenarios.
      
      The reboot notifier will set the cpus to nominal frequncy.
      Signed-off-by: NShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
      Reviewed-by: NPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      cf30af76
    • P
      cpufreq: powernv: Set the pstate of the last hotplugged out cpu in policy->cpus to minimum · b120339c
      Preeti U Murthy 提交于
      Its possible today that the pstate of a core is held at a high even after the
      entire core is hotplugged out if a load had just run on  the hotplugged cpu. This is
      fair, since it is assumed that the pstate does not matter to a cpu in a deep idle
      state, which is the expected state of a hotplugged core on powerpc. However on powerpc,
      the pstate at a socket level is held at the maximum of the pstates of each core. Even
      if the pstates of the active cores on that socket is low, the socket pstate is held
      high due to the pstate of the hotplugged core in the above mentioned scenario. This
      can cost significant amount of power loss for no good.
      
      Besides, since it is a non active core, nothing can be done from the kernel's end
      to set the frequency of the core right. Hence make use of the stop_cpu callback
      to explicitly set the pstate of the core to a minimum when the last cpu of the
      core gets hotplugged out.
      Signed-off-by: NPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      b120339c
    • P
      cpufreq: Allow stop CPU callback to be used by all cpufreq drivers · 789ca243
      Preeti U Murthy 提交于
      Commit 367dc4aa ("cpufreq: Add stop CPU callback to
      cpufreq_driver interface") introduced the stop CPU callback for
      intel_pstate drivers. During the CPU_DOWN_PREPARE stage, this
      callback is invoked so that drivers can take some action on the
      pstate of the cpu before it is taken offline. This callback was
      assumed to be useful only for those drivers which have implemented
      the set_policy CPU callback because they have no other way to take
      action about the cpufreq of a CPU which is being hotplugged out
      except in the exit callback which is called very late in the offline
      process.
      
      The drivers which implement the target/target_index callbacks were
      expected to take care of requirements like the ones that commit
      367dc4aa addresses in the GOV_STOP notification event. But there
      are disadvantages to restricting the usage of stop CPU callback
      to cpufreq drivers that implement the set_policy callbacks and who
      want to take explicit action on the setting the cpufreq during a
      hotplug operation.
      
      1.GOV_STOP gets called for every CPU offline and drivers would usually
      want to take action when the last cpu in the policy->cpus mask
      is taken offline. As long as there is more than one cpu in the
      policy->cpus mask, cpufreq core itself makes sure that the freq
      for the other cpus in this mask is set according to the maximum load.
      This is sensible and drivers which implement the target_index callback
      would mostly not want to modify that. However the cpufreq core leaves a
      loose end when the cpu in the policy->cpus mask is the last one to go offline;
      it does nothing explicit to the frequency of the core. Drivers may need
      a way to take some action here and stop CPU callback mechanism is the
      best way to do it today.
      
      2. We cannot implement driver specific actions in the GOV_STOP mechanism.
      So we will need another driver callback which is invoked from here which is
      unnecessary.
      
      Therefore this patch extends the usage of stop CPU callback to be used
      by all cpufreq drivers as long as they have this callback implemented
      and irrespective of whether they are set_policy/target_index drivers.
      The assumption is if the drivers find the GOV_STOP path to be a suitable
      way of implementing what they want to do with the freq of the cpu
      going offine,they will not implement the stop CPU callback at all.
      Signed-off-by: NPreeti U Murthy <preeti@linux.vnet.ibm.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      789ca243
  2. 09 9月, 2014 7 次提交
  3. 08 9月, 2014 1 次提交
  4. 03 9月, 2014 1 次提交
  5. 28 8月, 2014 3 次提交
  6. 09 8月, 2014 1 次提交
  7. 08 8月, 2014 1 次提交
  8. 07 8月, 2014 3 次提交
    • S
      cpufreq: OPP: Avoid sleeping while atomic · 3c5445ce
      Stephen Boyd 提交于
      We allocate the cpufreq table after calling rcu_read_lock(),
      which disables preemption. This causes scheduling while atomic
      warnings. Use GFP_ATOMIC instead of GFP_KERNEL and update for
      kcalloc while we're here.
      
      BUG: sleeping function called from invalid context at mm/slub.c:1246
      in_atomic(): 0, irqs_disabled(): 0, pid: 80, name: modprobe
      5 locks held by modprobe/80:
       #0:  (&dev->mutex){......}, at: [<c050d484>] __driver_attach+0x48/0x98
       #1:  (&dev->mutex){......}, at: [<c050d494>] __driver_attach+0x58/0x98
       #2:  (subsys mutex#5){+.+.+.}, at: [<c050c114>] subsys_interface_register+0x38/0xc8
       #3:  (cpufreq_rwsem){.+.+.+}, at: [<c05a9c8c>] __cpufreq_add_dev.isra.22+0x84/0x92c
       #4:  (rcu_read_lock){......}, at: [<c05ab24c>] dev_pm_opp_init_cpufreq_table+0x18/0x10c
      Preemption disabled at:[<  (null)>]   (null)
      
      CPU: 2 PID: 80 Comm: modprobe Not tainted 3.16.0-rc3-next-20140701-00035-g286857f216aa-dirty #217
      [<c0214da8>] (unwind_backtrace) from [<c02123f8>] (show_stack+0x10/0x14)
      [<c02123f8>] (show_stack) from [<c070141c>] (dump_stack+0x70/0xbc)
      [<c070141c>] (dump_stack) from [<c02f4cb0>] (__kmalloc+0x124/0x250)
      [<c02f4cb0>] (__kmalloc) from [<c05ab270>] (dev_pm_opp_init_cpufreq_table+0x3c/0x10c)
      [<c05ab270>] (dev_pm_opp_init_cpufreq_table) from [<bf000508>] (cpufreq_init+0x48/0x378 [cpufreq_generic])
      [<bf000508>] (cpufreq_init [cpufreq_generic]) from [<c05a9e08>] (__cpufreq_add_dev.isra.22+0x200/0x92c)
      [<c05a9e08>] (__cpufreq_add_dev.isra.22) from [<c050c160>] (subsys_interface_register+0x84/0xc8)
      [<c050c160>] (subsys_interface_register) from [<c05a9494>] (cpufreq_register_driver+0x108/0x2d8)
      [<c05a9494>] (cpufreq_register_driver) from [<bf000888>] (generic_cpufreq_probe+0x50/0x74 [cpufreq_generic])
      [<bf000888>] (generic_cpufreq_probe [cpufreq_generic]) from [<c050e994>] (platform_drv_probe+0x18/0x48)
      [<c050e994>] (platform_drv_probe) from [<c050d1f4>] (driver_probe_device+0x128/0x370)
      [<c050d1f4>] (driver_probe_device) from [<c050d4d0>] (__driver_attach+0x94/0x98)
      [<c050d4d0>] (__driver_attach) from [<c050b778>] (bus_for_each_dev+0x54/0x88)
      [<c050b778>] (bus_for_each_dev) from [<c050c894>] (bus_add_driver+0xe8/0x204)
      [<c050c894>] (bus_add_driver) from [<c050dd48>] (driver_register+0x78/0xf4)
      [<c050dd48>] (driver_register) from [<c0208870>] (do_one_initcall+0xac/0x1d8)
      [<c0208870>] (do_one_initcall) from [<c028b6b4>] (load_module+0x190c/0x21e8)
      [<c028b6b4>] (load_module) from [<c028c034>] (SyS_init_module+0xa4/0x110)
      [<c028c034>] (SyS_init_module) from [<c020f0c0>] (ret_fast_syscall+0x0/0x48)
      
      Fixes: a0dd7b79 (PM / OPP: Move cpufreq specific OPP functions out of generic OPP library)
      Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Cc: 3.16+ <stable@vger.kernel.org> # 3.16+
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      3c5445ce
    • M
      cpufreq: cpu0: Do not print error message when deferring · 713a3fa6
      Markus Pargmann 提交于
      -EPROBE_DEFER is no real error. We are just waiting unti the necessary
      components are ready. The driver core infrastructure will also print an
      appropriate info message.
      
      This patch changes the error message to a debug message.
      Signed-off-by: NMarkus Pargmann <mpa@pengutronix.de>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      713a3fa6
    • H
      cpufreq: integrator: Use set_cpus_allowed_ptr · 18360d6e
      Himangi Saraogi 提交于
      Several years ago there was an effort to convert all uses of
      set_cpus_allowed to use set_cpus_allowed_ptr with the goal of eventually
      removing the current definition of set_cpus_allowed and renaming
      set_cpus_allowed_ptr as set_cpus_allowed
      (https://lkml.org/lkml/2010/3/26/59). This is another step in this
      direction.
      
      The Coccinelle semantic patch that makes this change is as follows:
      
      // <smpl>
      @@
      expression E1,E2;
      @@
      
      - set_cpus_allowed(E1, cpumask_of_cpu(E2))
      + set_cpus_allowed_ptr(E1, cpumask_of(E2))
      
      @@
      expression E;
      identifier I;
      @@
      
      - set_cpus_allowed(E, I)
      + set_cpus_allowed_ptr(E, &I)
      // </smpl>
      Signed-off-by: NHimangi Saraogi <himangi774@gmail.com>
      Acked-by: NJulia Lawall <julia.lawall@lip6.fr>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      18360d6e
  9. 05 8月, 2014 1 次提交
  10. 31 7月, 2014 1 次提交
  11. 21 7月, 2014 18 次提交