1. 27 3月, 2012 1 次提交
    • A
      PM / Runtime: don't forget to wake up waitqueue on failure · f2791d73
      Alan Stern 提交于
      This patch (as1535) fixes a bug in the runtime PM core.  When a
      runtime suspend attempt completes, whether successfully or not, the
      device's power.wait_queue is supposed to be signalled.  But this
      doesn't happen in the failure pathway of rpm_suspend() when another
      autosuspend attempt is rescheduled.  As a result, a task can get stuck
      indefinitely on the wait queue (I have seen this happen in testing).
      
      The patch fixes the problem by moving the wake_up_all() call up near
      the start of the failure code.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      f2791d73
  2. 24 3月, 2012 1 次提交
  3. 19 3月, 2012 1 次提交
  4. 17 3月, 2012 3 次提交
    • R
      PM / Domains: Introduce "always on" device flag · 1e78a0c7
      Rafael J. Wysocki 提交于
      The TMU device on the Mackerel board belongs to the A4R power domain
      and loses power when the domain is turned off.  Unfortunately, the
      TMU driver is not prepared to cope with such situations and crashes
      the system when that happens.  To work around this problem introduce
      a new helper function, pm_genpd_dev_always_on(), allowing a device
      driver to mark its device as "always on" in case it belongs to a PM
      domain, which will make the generic PM domains core code avoid
      powering off the domain containing the device, both at run time and
      during system suspend.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: NSimon Horman <horms@verge.net.au>
      Acked-by: NPaul Mundt <lethal@linux-sh.org>
      Cc: stable@vger.kernel.org
      1e78a0c7
    • R
      PM / Domains: Fix hibernation restore of devices, v2 · 65533bbf
      Rafael J. Wysocki 提交于
      During resume from hibernation pm_genpd_restore_noirq() should only
      power off domains whose suspend_power_off flags are set once and
      not every time it is called for a device in the given domain.
      Moreover, it shouldn't decrement genpd->suspended_count, because
      that field is not touched during device freezing and therefore it is
      always equal to 0 when pm_genpd_restore_noirq() runs for the first
      device in the given domain.
      
      This means pm_genpd_restore_noirq() may use genpd->suspended_count
      to determine whether or not it it has been called for the domain in
      question already in this cycle (it only needs to increment that
      field every time it runs for this purpose) and whether or not it
      should check if the domain needs to be powered off.  For that to
      work, though, pm_genpd_prepare() has to clear genpd->suspended_count
      when it runs for the first device in the given domain (in which case
      that flag need not be cleared during domain initialization).
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Cc: stable@vger.kernel.org
      65533bbf
    • R
      PM / Domains: Fix handling of wakeup devices during system resume · cc85b207
      Rafael J. Wysocki 提交于
      During system suspend pm_genpd_suspend_noirq() checks if the given
      device is in a wakeup path (i.e. it appears to be needed for one or
      more wakeup devices to work or is a wakeup device itself) and if it
      needs to be "active" for wakeup to work.  If that is the case, the
      function returns 0 without incrementing the device domain's counter
      of suspended devices and without executing genpd_stop_dev() for the
      device.  In consequence, the device is not stopped (e.g. its clock
      isn't disabled) and power is always supplied to its domain in the
      resulting system sleep state.
      
      However, pm_genpd_resume_noirq() doesn't repeat that check and it
      runs genpd_start_dev() and decrements the domain's counter of
      suspended devices even for the wakeup device that weren't stopped by
      pm_genpd_suspend_noirq().  As a result, the start callback may be run
      unnecessarily for them and their domains' counters of suspended
      devices may become negative.  Both outcomes aren't desirable, so fix
      pm_genpd_resume_noirq() to look for wakeup devices that might not be
      stopped by during system suspend.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Tested-by: NSimon Horman <horms@verge.net.au>
      Cc: stable@vger.kernel.org
      cc85b207
  5. 14 3月, 2012 1 次提交
    • R
      PM / QoS: Make it possible to expose PM QoS latency constraints · 85dc0b8a
      Rafael J. Wysocki 提交于
      A runtime suspend of a device (e.g. an MMC controller) belonging to
      a power domain or, in a more complicated scenario, a runtime suspend
      of another device in the same power domain, may cause power to be
      removed from the entire domain.  In that case, the amount of time
      necessary to runtime-resume the given device (e.g. the MMC
      controller) is often substantially greater than the time needed to
      run its driver's runtime resume callback.  That may hurt performance
      in some situations, because user data may need to wait for the
      device to become operational, so we should make it possible to
      prevent that from happening.
      
      For this reason, introduce a new sysfs attribute for devices,
      power/pm_qos_resume_latency_us, allowing user space to specify the
      upper bound of the time necessary to bring the (runtime-suspended)
      device up after the resume of it has been requested.  However, make
      that attribute appear only for the devices whose drivers declare
      support for it by calling the (new) dev_pm_qos_expose_latency_limit()
      helper function with the appropriate initial value of the attribute.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      Reviewed-by: NKevin Hilman <khilman@ti.com>
      Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      85dc0b8a
  6. 12 3月, 2012 1 次提交
    • P
      device.h: cleanup users outside of linux/include (C files) · 51990e82
      Paul Gortmaker 提交于
      For files that are actively using linux/device.h, make sure
      that they call it out.  This will allow us to clean up some
      of the implicit uses of linux/device.h within include/*
      without introducing build regressions.
      
      Yes, this was created by "cheating" -- i.e. the headers were
      cleaned up, and then the fallout was found and fixed, and then
      the two commits were reordered.  This ensures we don't introduce
      build regressions into the git history.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      51990e82
  7. 11 3月, 2012 1 次提交
    • S
      regmap: Fix future missing prototype of devres_alloc() and friends · f5d6eba7
      Stephen Warren 提交于
      [Fix for breakage which will be introduced during the merge window via
      header reworks in another tree, the regmap tree does include device.h
      but Paul's tree breaks that.  Reworded subject to reflect -- broonie]
      
      regmap.s uses devres_alloc() and others that are prototyped in device.h.
      Include that to solve the following:
      
      drivers/base/regmap/regmap.c: In function 'devm_regmap_init':
      drivers/base/regmap/regmap.c:331:2: error: implicit declaration of function 'devres_alloc' [-Werror=implicit-function-declaration]
      drivers/base/regmap/regmap.c:338:3: error: implicit declaration of function 'devres_add' [-Werror=implicit-function-declaration]
      drivers/base/regmap/regmap.c:340:3: error: implicit declaration of function 'devres_free' [-Werror=implicit-function-declaration]
      drivers/base/regmap/regmap.c: In function '_regmap_raw_write':
      drivers/base/regmap/regmap.c:421:5: error: implicit declaration of function 'dev_err' [-Werror=implicit-function-declaration]
      Signed-off-by: NStephen Warren <swarren@wwwdotorg.org>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      f5d6eba7
  8. 09 3月, 2012 4 次提交
    • S
      driver-core: remove legacy iSeries hack · fcd6f762
      Stephen Rothwell 提交于
      The PowerPC legacy iSeries plateform is being removed along with the
      "one looney iseries driver", so this code can now be removed as well.
      
      cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      fcd6f762
    • G
      driver core: minor comment formatting cleanups · 8b0372a2
      Greg Kroah-Hartman 提交于
      Came in in the deferred probe patch, quick, clean them up before a
      kernel janitor finds them and sends me 4 individual patches to fix them
      up...
      
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8b0372a2
    • G
      driver core: move the deferred probe pointer into the private area · ef8a3fd6
      Greg Kroah-Hartman 提交于
      Nothing outside of the driver core needs to get to the deferred probe
      pointer, so move it inside the private area of 'struct device' so no one
      tries to mess around with it.
      
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ef8a3fd6
    • G
      drivercore: Add driver probe deferral mechanism · d1c3414c
      Grant Likely 提交于
      Allow drivers to report at probe time that they cannot get all the resources
      required by the device, and should be retried at a later time.
      
      This should completely solve the problem of getting devices
      initialized in the right order.  Right now this is mostly handled by
      mucking about with initcall ordering which is a complete hack, and
      doesn't even remotely handle the case where device drivers are in
      modules.  This approach completely sidesteps the issues by allowing
      driver registration to occur in any order, and any driver can request
      to be retried after a few more other drivers get probed.
      
      v4: - Integrate Manjunath's addition of a separate workqueue
          - Change -EAGAIN to -EPROBE_DEFER for drivers to trigger deferral
          - Update comment blocks to reflect how the code really works
      v3: - Hold off workqueue scheduling until late_initcall so that the bulk
            of driver probes are complete before we start retrying deferred devices.
          - Tested with simple use cases.  Still needs more testing though.
            Using it to get rid of the gpio early_initcall madness, or to replace
            the ASoC internal probe deferral code would be ideal.
      v2: - added locking so it should no longer be utterly broken in that regard
          - remove device from deferred list at device_del time.
          - Still completely untested with any real use case, but has been
            boot tested.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Dilan Lee <dilee@nvidia.com>
      Cc: Manjunath GKondaiah <manjunath.gkondaiah@linaro.org>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NDavid Daney <david.daney@cavium.com>
      Reviewed-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d1c3414c
  9. 06 3月, 2012 2 次提交
  10. 05 3月, 2012 4 次提交
    • R
      PM / Sleep: Add more wakeup source initialization routines · 8671bbc1
      Rafael J. Wysocki 提交于
      The existing wakeup source initialization routines are not
      particularly useful for wakeup sources that aren't created by
      wakeup_source_create(), because their users have to open code
      filling the objects with zeros and setting their names.  For this
      reason, introduce routines that can be used for initializing, for
      example, static wakeup source objects.
      Requested-by: NArve Hjønnevåg <arve@android.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      8671bbc1
    • R
      PM / Sleep: Make __pm_stay_awake() delete wakeup source timers · 4782e165
      Rafael J. Wysocki 提交于
      If __pm_stay_awake() is called after __pm_wakeup_event() for the same
      wakep source object before its timer expires, it won't cancel the
      timer, so the wakeup source will be deactivated from the timer
      function as scheduled by __pm_wakeup_event().  In that case
      __pm_stay_awake() doesn't have any effect beyond incrementing
      the wakeup source's event_count field, although it should cancel
      the timer and make the wakeup source stay active until __pm_relax()
      is called for it.
      
      To fix this problem make __pm_stay_awake() delete the wakeup source's
      timer and ensure that it won't be deactivated from the timer funtion
      afterwards by clearing its timer_expires field.
      Reported-by: NArve Hjønnevåg <arve@android.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      4782e165
    • R
      PM / Sleep: Fix race conditions related to wakeup source timer function · da863cdd
      Rafael J. Wysocki 提交于
      If __pm_wakeup_event() has been used (with a nonzero timeout) to
      report a wakeup event and then __pm_relax() immediately followed by
      __pm_stay_awake() is called or __pm_wakeup_event() is called once
      again for the same wakeup source object before its timer expires, the
      timer function pm_wakeup_timer_fn() may still be run as a result of
      the previous __pm_wakeup_event() call.  In either of those cases it
      may mistakenly deactivate the wakeup source that has just been
      activated.
      
      To prevent that from happening, make wakeup_source_deactivate()
      clear the wakeup source's timer_expires field and make
      pm_wakeup_timer_fn() check if timer_expires is different from zero
      and if it's not in future before calling wakeup_source_deactivate()
      (if timer_expires is 0, it means that the timer has just been
      deleted and if timer_expires is in future, it means that the timer
      has just been rescheduled to a different time).
      Reported-by: NArve Hjønnevåg <arve@android.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      da863cdd
    • R
      PM / Sleep: Fix possible infinite loop during wakeup source destruction · d94aff87
      Rafael J. Wysocki 提交于
      If wakeup_source_destroy() is called for an active wakeup source that
      is never deactivated, it will spin forever.  To prevent that from
      happening, make wakeup_source_destroy() call __pm_relax() for the
      wakeup source object it is about to free instead of waiting until
      it will be deactivated by someone else.  However, for this to work
      it also needs to make sure that the timer function will not be
      executed after the final __pm_relax(), so make it run
      del_timer_sync() on the wakeup source's timer beforehand.
      
      Additionally, update the kerneldoc comment to document the
      requirement that __pm_stay_awake() and __pm_wakeup_event() must not
      be run in parallel with wakeup_source_destroy().
      Reported-by: NArve Hjønnevåg <arve@android.com>
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      d94aff87
  11. 01 3月, 2012 1 次提交
  12. 27 2月, 2012 1 次提交
  13. 24 2月, 2012 6 次提交
  14. 22 2月, 2012 3 次提交
  15. 21 2月, 2012 1 次提交
  16. 18 2月, 2012 2 次提交
  17. 16 2月, 2012 1 次提交
    • L
      regmap: Fix cache defaults initialization from raw cache defaults · 61cddc57
      Lars-Peter Clausen 提交于
      Currently registers with a value of 0 are ignored when initializing the register
      defaults from raw defaults. This worked in the past, because registers without a
      explicit default were assumed to have a default value of 0. This was changed in
      commit b03622a8 ("regmap: Ensure rbtree syncs registers set to zero properly").
      As a result registers, which have a raw default value of 0 are now assumed to
      have no default. This again can result in unnecessary writes when syncing the
      cache. It will also result in unnecessary reads for e.g. the first update
      operation. In the case where readback is not possible this will even let the
      update operation fail, if the register has not been written to before.
      
      So this patch removes the check. Instead it adds a check to ignore raw defaults
      for registers which are volatile, since those registers are not cached.
      Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: stable@vger.kernel.org
      61cddc57
  18. 15 2月, 2012 1 次提交
  19. 13 2月, 2012 1 次提交
  20. 12 2月, 2012 1 次提交
  21. 11 2月, 2012 1 次提交
    • L
      drivers/base: add bus for System-on-Chip devices · 74d1d82c
      Lee Jones 提交于
      Traditionally, any System-on-Chip based platform creates a flat list
      of platform_devices directly under /sys/devices/platform.
      
      In order to give these some better structure, this introduces a new
      bus type for soc_devices that are registered with the new
      soc_device_register() function.  All devices that are on the same
      chip should then be registered as child devices of the soc device.
      
      The soc bus also exports a few standardised device attributes which
      allow user space to query the specific type of soc.
      Signed-off-by: NLee Jones <lee.jones@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      74d1d82c
  22. 10 2月, 2012 1 次提交
  23. 09 2月, 2012 1 次提交