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. 31 8月, 2014 1 次提交
  6. 30 8月, 2014 2 次提交
  7. 29 8月, 2014 3 次提交
    • J
      x86, irq, PCI: Keep IRQ assignment for runtime power management · 9eabc99a
      Jiang Liu 提交于
      Now IOAPIC driver dynamically allocates IRQ numbers for IOAPIC pins.
      We need to keep IRQ assignment for PCI devices during runtime power
      management, otherwise it may cause failure of device wakeups.
      
      Commit 3eec5952 "x86, irq, PCI: Keep IRQ assignment for PCI
      devices during suspend/hibernation" has fixed the issue for suspend/
      hibernation, we also need the same fix for runtime device sleep too.
      
      Fix: https://bugzilla.kernel.org/show_bug.cgi?id=83271Reported-and-Tested-by: NEmanueL Czirai <amanual@openmailbox.org>
      Signed-off-by: NJiang Liu <jiang.liu@linux.intel.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: EmanueL Czirai <amanual@openmailbox.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Randy Dunlap <rdunlap@infradead.org>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Grant Likely <grant.likely@linaro.org>
      Link: http://lkml.kernel.org/r/1409304383-18806-1-git-send-email-jiang.liu@linux.intel.comSigned-off-by: NThomas Gleixner <tglx@linutronix.de>
      9eabc99a
    • D
      spi/rockchip: Avoid accidentally turning off the clock · 5d1d150d
      Doug Anderson 提交于
      If our client is requesting a clock that is above the maximum clock
      then the following division will result in 0:
        rs->max_freq / rs->speed
      
      We'll then program 0 into the SPI_BAUDR register.  The Rockchip TRM
      says: "If the value is 0, the serial output clock (sclk_out) is
      disabled."
      
      It's much better to end up with the fastest possible clock rather than
      a clock that is off, so enforce a minimum value.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      5d1d150d
    • M
      dm crypt: fix access beyond the end of allocated space · d49ec52f
      Mikulas Patocka 提交于
      The DM crypt target accesses memory beyond allocated space resulting in
      a crash on 32 bit x86 systems.
      
      This bug is very old (it dates back to 2.6.25 commit 3a7f6c99 "dm
      crypt: use async crypto").  However, this bug was masked by the fact
      that kmalloc rounds the size up to the next power of two.  This bug
      wasn't exposed until 3.17-rc1 commit 298a9fa0 ("dm crypt: use per-bio
      data").  By switching to using per-bio data there was no longer any
      padding beyond the end of a dm-crypt allocated memory block.
      
      To minimize allocation overhead dm-crypt puts several structures into one
      block allocated with kmalloc.  The block holds struct ablkcipher_request,
      cipher-specific scratch pad (crypto_ablkcipher_reqsize(any_tfm(cc))),
      struct dm_crypt_request and an initialization vector.
      
      The variable dmreq_start is set to offset of struct dm_crypt_request
      within this memory block.  dm-crypt allocates the block with this size:
      cc->dmreq_start + sizeof(struct dm_crypt_request) + cc->iv_size.
      
      When accessing the initialization vector, dm-crypt uses the function
      iv_of_dmreq, which performs this calculation: ALIGN((unsigned long)(dmreq
      + 1), crypto_ablkcipher_alignmask(any_tfm(cc)) + 1).
      
      dm-crypt allocated "cc->iv_size" bytes beyond the end of dm_crypt_request
      structure.  However, when dm-crypt accesses the initialization vector, it
      takes a pointer to the end of dm_crypt_request, aligns it, and then uses
      it as the initialization vector.  If the end of dm_crypt_request is not
      aligned on a crypto_ablkcipher_alignmask(any_tfm(cc)) boundary the
      alignment causes the initialization vector to point beyond the allocated
      space.
      
      Fix this bug by calculating the variable iv_size_padding and adding it
      to the allocated size.
      
      Also correct the alignment of dm_crypt_request.  struct dm_crypt_request
      is specific to dm-crypt (it isn't used by the crypto subsystem at all),
      so it is aligned on __alignof__(struct dm_crypt_request).
      
      Also align per_bio_data_size on ARCH_KMALLOC_MINALIGN, so that it is
      aligned as if the block was allocated with kmalloc.
      Reported-by: NKrzysztof Kolasa <kkolasa@winsoft.pl>
      Tested-by: NMilan Broz <gmazyland@gmail.com>
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      d49ec52f
  8. 28 8月, 2014 14 次提交
  9. 27 8月, 2014 8 次提交