1. 25 1月, 2017 1 次提交
    • Y
      memory_hotplug: make zone_can_shift() return a boolean value · 8a1f780e
      Yasuaki Ishimatsu 提交于
      online_{kernel|movable} is used to change the memory zone to
      ZONE_{NORMAL|MOVABLE} and online the memory.
      
      To check that memory zone can be changed, zone_can_shift() is used.
      Currently the function returns minus integer value, plus integer
      value and 0. When the function returns minus or plus integer value,
      it means that the memory zone can be changed to ZONE_{NORNAL|MOVABLE}.
      
      But when the function returns 0, there are two meanings.
      
      One of the meanings is that the memory zone does not need to be changed.
      For example, when memory is in ZONE_NORMAL and onlined by online_kernel
      the memory zone does not need to be changed.
      
      Another meaning is that the memory zone cannot be changed. When memory
      is in ZONE_NORMAL and onlined by online_movable, the memory zone may
      not be changed to ZONE_MOVALBE due to memory online limitation(see
      Documentation/memory-hotplug.txt). In this case, memory must not be
      onlined.
      
      The patch changes the return type of zone_can_shift() so that memory
      online operation fails when memory zone cannot be changed as follows:
      
      Before applying patch:
         # grep -A 35 "Node 2" /proc/zoneinfo
         Node 2, zone   Normal
         <snip>
            node_scanned  0
                 spanned  8388608
                 present  7864320
                 managed  7864320
         # echo online_movable > memory4097/state
         # grep -A 35 "Node 2" /proc/zoneinfo
         Node 2, zone   Normal
         <snip>
            node_scanned  0
                 spanned  8388608
                 present  8388608
                 managed  8388608
      
         online_movable operation succeeded. But memory is onlined as
         ZONE_NORMAL, not ZONE_MOVABLE.
      
      After applying patch:
         # grep -A 35 "Node 2" /proc/zoneinfo
         Node 2, zone   Normal
         <snip>
            node_scanned  0
                 spanned  8388608
                 present  7864320
                 managed  7864320
         # echo online_movable > memory4097/state
         bash: echo: write error: Invalid argument
         # grep -A 35 "Node 2" /proc/zoneinfo
         Node 2, zone   Normal
         <snip>
            node_scanned  0
                 spanned  8388608
                 present  7864320
                 managed  7864320
      
         online_movable operation failed because of failure of changing
         the memory zone from ZONE_NORMAL to ZONE_MOVABLE
      
      Fixes: df429ac0 ("memory-hotplug: more general validation of zone during online")
      Link: http://lkml.kernel.org/r/2f9c3837-33d7-b6e5-59c0-6ca4372b2d84@gmail.comSigned-off-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
      Reviewed-by: NReza Arbab <arbab@linux.vnet.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      8a1f780e
  2. 14 1月, 2017 1 次提交
  3. 01 1月, 2017 1 次提交
  4. 26 12月, 2016 3 次提交
    • L
      avoid spurious "may be used uninitialized" warning · d33d5a6c
      Linus Torvalds 提交于
      The timer type simplifications caused a new gcc warning:
      
        drivers/base/power/domain.c: In function ‘genpd_runtime_suspend’:
        drivers/base/power/domain.c:562:14: warning: ‘time_start’ may be used uninitialized in this function [-Wmaybe-uninitialized]
           elapsed_ns = ktime_to_ns(ktime_sub(ktime_get(), time_start));
      
      despite the actual use of "time_start" not having changed in any way.
      It appears that simply changing the type of ktime_t from a union to a
      plain scalar type made gcc check the use.
      
      The variable wasn't actually used uninitialized, but gcc apparently
      failed to notice that the conditional around the use was exactly the
      same as the conditional around the initialization of that variable.
      
      Add an unnecessary initialization just to shut up the compiler.
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d33d5a6c
    • T
      ktime: Cleanup ktime_set() usage · 8b0e1953
      Thomas Gleixner 提交于
      ktime_set(S,N) was required for the timespec storage type and is still
      useful for situations where a Seconds and Nanoseconds part of a time value
      needs to be converted. For anything where the Seconds argument is 0, this
      is pointless and can be replaced with a simple assignment.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      8b0e1953
    • T
      ktime: Get rid of the union · 2456e855
      Thomas Gleixner 提交于
      ktime is a union because the initial implementation stored the time in
      scalar nanoseconds on 64 bit machine and in a endianess optimized timespec
      variant for 32bit machines. The Y2038 cleanup removed the timespec variant
      and switched everything to scalar nanoseconds. The union remained, but
      become completely pointless.
      
      Get rid of the union and just keep ktime_t as simple typedef of type s64.
      
      The conversion was done with coccinelle and some manual mopping up.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      2456e855
  5. 25 12月, 2016 1 次提交
  6. 09 12月, 2016 1 次提交
  7. 08 12月, 2016 2 次提交
  8. 07 12月, 2016 2 次提交
    • T
      PM / wakeirq: Fix dedicated wakeirq for drivers not using autosuspend · bed57030
      Tony Lindgren 提交于
      I noticed some wakeirq flakeyness with consumer drivers not using
      autosuspend. For drivers not using autosuspend, the wakeirq may never
      get unmasked in rpm_suspend() because of irq desc->depth.
      
      We are configuring dedicated wakeirqs to start with IRQ_NOAUTOEN as we
      naturally don't want them running until rpm_suspend() is called.
      
      However, when a consumer driver initially calls pm_runtime_get(), we
      now wrongly start with disable_irq_nosync() call on the dedicated
      wakeirq that is disabled to start with.
      
      This causes desc->depth to toggle between 1 and 2 instead of the usual
      0 and 1. This can prevent enable_irq() from unmasking the wakeirq as
      that only happens at desc->depth 1.
      
      This does not necessarily show up with drivers using autosuspend as
      there is time for disable_irq_nosync() before rpm_suspend() gets called
      after the autosuspend timeout.
      
      Let's fix the issue by adding wirq->status that lazily gets set on
      the first rpm_suspend(). We also need PM runtime core private functions
      for dev_pm_enable_wake_irq_check() and dev_pm_disable_wake_irq_check()
      so we can enable the dedicated wakeirq on the first rpm_suspend().
      
      While at it, let's also fix the comments for dev_pm_enable_wake_irq()
      and dev_pm_disable_wake_irq(). Those can still be used by the consumer
      drivers as needed because the IRQ core manages the interrupt usecount
      for us.
      
      Fixes: 4990d4fe (PM / Wakeirq: Add automated device wake IRQ handling)
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bed57030
    • L
      PM / Domains: Fix compatible for domain idle state · 598da548
      Lina Iyer 提交于
      Re-using idle state definition provided by arm,idle-state for domain
      idle states creates a lot of confusion and limits further evolution of
      the domain idle definition. To keep things clear and simple, define a
      idle states for domain using a new compatible "domain-idle-state".
      
      Fix existing PM domains code to look for the newly defined compatible.
      Signed-off-by: NLina Iyer <lina.iyer@linaro.org>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NSudeep Holla <sudeep.holla@arm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      598da548
  9. 06 12月, 2016 7 次提交
  10. 05 12月, 2016 1 次提交
  11. 02 12月, 2016 1 次提交
  12. 01 12月, 2016 5 次提交
  13. 30 11月, 2016 13 次提交
  14. 25 11月, 2016 1 次提交
    • K
      regmap: cache: Remove unused 'blksize' variable · daaadbf0
      Kirtika Ruchandani 提交于
      Commit 2cbbb579 ("regmap: Add the LZO cache support") introduced
      'blksize' in  regcache_lzo_read() and regcache_lzo_write(), that is
      set but not used. Compiling with W=1 gives the following warnings,
      fix them.
      
      drivers/base/regmap/regcache-lzo.c: In function ‘regcache_lzo_read’:
      drivers/base/regmap/regcache-lzo.c:239:9: warning: variable ‘blksize’ set but not used [-Wunused-but-set-variable]
        size_t blksize, tmp_dst_len;
               ^
      drivers/base/regmap/regcache-lzo.c: In function ‘regcache_lzo_write’:
      drivers/base/regmap/regcache-lzo.c:278:9: warning: variable ‘blksize’ set but not used [-Wunused-but-set-variable]
        size_t blksize, tmp_dst_len;
               ^
      
      These are harmless warnings and are only being fixed to reduce the
      noise with W=1 in the kernel.
      
      Fixes: 2cbbb579 ("regmap: Add the LZO cache support")
      Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: NKirtika Ruchandani <kirtika@chromium.org>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      daaadbf0