1. 11 6月, 2014 1 次提交
    • T
      PM / sleep: trace events for device PM callbacks · e8bca479
      Todd E Brandt 提交于
      Adds two trace events which supply the same info that initcall_debug
      provides, but via ftrace instead of dmesg. The existing initcall_debug
      calls require the pm_print_times_enabled var to be set (either via
      sysfs or via the kernel cmd line). The new trace events provide all the
      same info as the initcall_debug prints but with less overhead, and also
      with coverage of device prepare and complete device callbacks.
      
      These events replace the device_pm_report_time event (which has been
      removed). device_pm_callback_start is called first and provides the device
      and callback info. device_pm_callback_end is called after with the
      device name and error info. The time and pid are gathered from the trace
      data headers.
      Signed-off-by: NTodd Brandt <todd.e.brandt@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      e8bca479
  2. 07 6月, 2014 1 次提交
    • T
      PM / sleep: trace events for suspend/resume · bb3632c6
      Todd E Brandt 提交于
      Adds trace events that give finer resolution into suspend/resume. These
      events are graphed in the timelines generated by the analyze_suspend.py
      script. They represent large areas of time consumed that are typical to
      suspend and resume.
      
      The event is triggered by calling the function "trace_suspend_resume"
      with three arguments: a string (the name of the event to be displayed
      in the timeline), an integer (case specific number, such as the power
      state or cpu number), and a boolean (where true is used to denote the start
      of the timeline event, and false to denote the end).
      
      The suspend_resume trace event reproduces the data that the machine_suspend
      trace event did, so the latter has been removed.
      Signed-off-by: NTodd Brandt <todd.e.brandt@intel.com>
      Acked-by: NSteven Rostedt <rostedt@goodmis.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      bb3632c6
  3. 05 6月, 2014 3 次提交
  4. 30 5月, 2014 1 次提交
  5. 29 5月, 2014 1 次提交
  6. 28 5月, 2014 4 次提交
  7. 27 5月, 2014 1 次提交
  8. 26 5月, 2014 2 次提交
  9. 24 5月, 2014 1 次提交
  10. 23 5月, 2014 1 次提交
    • G
      of/irq: do irq resolution in platform_get_irq_byname() · ad69674e
      Grygorii Strashko 提交于
      The commit 9ec36caf
      "of/irq: do irq resolution in platform_get_irq" from Rob Herring -
      moves resolving of the interrupt resources in platform_get_irq().
      But this solution isn't complete because platform_get_irq_byname()
      need to be modified the same way.
      
      Hence, fix it by adding interrupt resolution code at the
      platform_get_irq_byname() function too.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      ad69674e
  11. 22 5月, 2014 1 次提交
  12. 21 5月, 2014 1 次提交
  13. 20 5月, 2014 1 次提交
  14. 17 5月, 2014 1 次提交
    • R
      PM / sleep: Mechanism to avoid resuming runtime-suspended devices unnecessarily · aae4518b
      Rafael J. Wysocki 提交于
      Currently, some subsystems (e.g. PCI and the ACPI PM domain) have to
      resume all runtime-suspended devices during system suspend, mostly
      because those devices may need to be reprogrammed due to different
      wakeup settings for system sleep and for runtime PM.
      
      For some devices, though, it's OK to remain in runtime suspend
      throughout a complete system suspend/resume cycle (if the device was in
      runtime suspend at the start of the cycle).  We would like to do this
      whenever possible, to avoid the overhead of extra power-up and power-down
      events.
      
      However, problems may arise because the device's descendants may require
      it to be at full power at various points during the cycle.  Therefore the
      most straightforward way to do this safely is if the device and all its
      descendants can remain runtime suspended until the complete stage of
      system resume.
      
      To this end, introduce a new device PM flag, power.direct_complete
      and modify the PM core to use that flag as follows.
      
      If the ->prepare() callback of a device returns a positive number,
      the PM core will regard that as an indication that it may leave the
      device runtime-suspended.  It will then check if the system power
      transition in progress is a suspend (and not hibernation in particular)
      and if the device is, indeed, runtime-suspended.  In that case, the PM
      core will set the device's power.direct_complete flag.  Otherwise it
      will clear power.direct_complete for the device and it also will later
      clear it for the device's parent (if there's one).
      
      Next, the PM core will not invoke the ->suspend() ->suspend_late(),
      ->suspend_irq(), ->resume_irq(), ->resume_early(), or ->resume()
      callbacks for all devices having power.direct_complete set.  It
      will invoke their ->complete() callbacks, however, and those
      callbacks are then responsible for resuming the devices as
      appropriate, if necessary.  For example, in some cases they may
      need to queue up runtime resume requests for the devices using
      pm_request_resume().
      
      Changelog partly based on an Alan Stern's description of the idea
      (http://marc.info/?l=linux-pm&m=139940466625569&w=2).
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NAlan Stern <stern@rowland.harvard.edu>
      aae4518b
  15. 15 5月, 2014 1 次提交
    • L
      cma: Remove potential deadlock situation · 7ee793a6
      Laura Abbott 提交于
      CMA locking is currently very coarse. The cma_mutex protects both
      the bitmap and avoids concurrency with alloc_contig_range. There
      are several situations which may result in a deadlock on the CMA
      mutex currently, mostly involving AB/BA situations with alloc and
      free. Fix this issue by protecting the bitmap with a mutex per CMA
      region and use the existing mutex for protecting against concurrency
      with alloc_contig_range.
      Signed-off-by: NLaura Abbott <lauraa@codeaurora.org>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      7ee793a6
  16. 07 5月, 2014 2 次提交
    • N
      PM / OPP: Move cpufreq specific OPP functions out of generic OPP library · a0dd7b79
      Nishanth Menon 提交于
      CPUFreq specific helper functions for OPP (Operating Performance Points)
      now use generic OPP functions that allow CPUFreq to be be moved back
      into CPUFreq framework. This allows for independent modifications
      or future enhancements as needed isolated to just CPUFreq framework
      alone.
      
      Here, we just move relevant code and documentation to make this part of
      CPUFreq infrastructure.
      
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a0dd7b79
    • N
      PM / OPP: Remove cpufreq wrapper dependency on internal data organization · 0f5c890e
      Nishanth Menon 提交于
      CPUFREQ custom functions for OPP (Operating Performance Points)
      currently exist inside the OPP library. These custom functions currently
      depend on internal data structures to pick up OPP information to create
      the cpufreq table.  For example, the cpufreq table is created precisely
      in the same order of how OPP entries are stored inside the list implementation.
      
      This kind of tight interdependency is purely artificial since the same
      functionality can be achieved using the generic OPP functions
      meant to do the same. This interdependency also limits the independent
      modification of cpufreq and OPP library.
      
      So use the generic dev_pm_opp_find_freq_ceil function that achieves the
      table organization as we currently use.
      
      As a result of this, we dont need to use the internal device_opp
      structure anymore, and we hence we can switch over to rcu lock instead
      of the mutex holding the internal list lock.
      
      This breaking of dependency on internal data structure imposes no change
      to usage of these.
      
      NOTE: This change is a precursor to moving this cpufreq specific logic
      out of the generic library into cpufreq.
      
      Cc: Kevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: NNishanth Menon <nm@ti.com>
      Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      0f5c890e
  17. 05 5月, 2014 1 次提交
  18. 01 5月, 2014 2 次提交
  19. 30 4月, 2014 1 次提交
  20. 29 4月, 2014 1 次提交
    • G
      drivercore: deferral race condition fix · 58b116bc
      Grant Likely 提交于
      When the kernel is built with CONFIG_PREEMPT it is possible to reach a state
      when all modules loaded but some driver still stuck in the deferred list
      and there is a need for external event to kick the deferred queue to probe
      these drivers.
      
      The issue has been observed on embedded systems with CONFIG_PREEMPT enabled,
      audio support built as modules and using nfsroot for root filesystem.
      
      The following log fragment shows such sequence when all audio modules
      were loaded but the sound card is not present since the machine driver has
      failed to probe due to missing dependency during it's probe.
      The board is am335x-evmsk (McASP<->tlv320aic3106 codec) with davinci-evm
      machine driver:
      
      ...
      [   12.615118] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: ENTER
      [   12.719969] davinci_evm sound.3: davinci_evm_probe: ENTER
      [   12.725753] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card
      [   12.753846] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component
      [   12.922051] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component DONE
      [   12.950839] davinci_evm sound.3: ASoC: platform (null) not registered
      [   12.957898] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card DONE (-517)
      [   13.099026] davinci-mcasp 4803c000.mcasp: Kicking the deferred list
      [   13.177838] davinci-mcasp 4803c000.mcasp: really_probe: probe_count = 2
      [   13.194130] davinci_evm sound.3: snd_soc_register_card failed (-517)
      [   13.346755] davinci_mcasp_driver_init: LEAVE
      [   13.377446] platform sound.3: Driver davinci_evm requests probe deferral
      [   13.592527] platform sound.3: really_probe: probe_count = 0
      
      In the log the machine driver enters it's probe at 12.719969 (this point it
      has been removed from the deferred lists). McASP driver already executing
      it's probing (since 12.615118).
      The machine driver tries to construct the sound card (12.950839) but did
      not found one of the components so it fails. After this McASP driver
      registers all the ASoC components (the machine driver still in it's probe
      function after it failed to construct the card) and the deferred work is
      prepared at 13.099026 (note that this time the machine driver is not in the
      lists so it is not going to be handled when the work is executing).
      Lastly the machine driver exit from it's probe and the core places it to
      the deferred list but there will be no other driver going to load and the
      deferred queue is not going to be kicked again - till we have external event
      like connecting USB stick, etc.
      
      The proposed solution is to try the deferred queue once more when the last
      driver is asking for deferring and we had drivers loaded while this last
      driver was probing.
      
      This way we can avoid drivers stuck in the deferred queue.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Tested-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Stable <stable@vger.kernel.org> # v3.4+
      58b116bc
  21. 26 4月, 2014 1 次提交
  22. 25 4月, 2014 1 次提交
    • R
      of/irq: do irq resolution in platform_get_irq · 9ec36caf
      Rob Herring 提交于
      Currently we get the following kind of errors if we try to use interrupt
      phandles to irqchips that have not yet initialized:
      
      irq: no irq domain found for /ocp/pinmux@48002030 !
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184()
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012
      (show_stack+0x14/0x1c)
      (dump_stack+0x6c/0xa0)
      (warn_slowpath_common+0x64/0x84)
      (warn_slowpath_null+0x1c/0x24)
      (of_device_alloc+0x144/0x184)
      (of_platform_device_create_pdata+0x44/0x9c)
      (of_platform_bus_create+0xd0/0x170)
      (of_platform_bus_create+0x12c/0x170)
      (of_platform_populate+0x60/0x98)
      
      This is because we're wrongly trying to populate resources that are not
      yet available. It's perfectly valid to create irqchips dynamically, so
      let's fix up the issue by resolving the interrupt resources when
      platform_get_irq is called.
      
      And then we also need to accept the fact that some irqdomains do not
      exist that early on, and only get initialized later on. So we can
      make the current WARN_ON into just into a pr_debug().
      
      We still attempt to populate irq resources when we create the devices.
      This allows current drivers which don't use platform_get_irq to continue
      to function. Once all drivers are fixed, this code can be removed.
      Suggested-by: NRussell King <linux@arm.linux.org.uk>
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Cc: stable@vger.kernel.org # v3.10+
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      9ec36caf
  23. 22 4月, 2014 1 次提交
  24. 18 4月, 2014 2 次提交
  25. 17 4月, 2014 3 次提交
  26. 14 4月, 2014 3 次提交
  27. 07 4月, 2014 1 次提交