1. 09 4月, 2021 1 次提交
  2. 03 11月, 2020 2 次提交
  3. 25 9月, 2020 1 次提交
    • X
      PM: runtime: Remove link state checks in rpm_get/put_supplier() · d12544fb
      Xiang Chen 提交于
      To support runtime PM for hisi SAS driver (the driver is in directory
      drivers/scsi/hisi_sas), we add device link between scsi_device->sdev_gendev
      (consumer device) and hisi_hba->dev(supplier device) with flags
      DL_FLAG_PM_RUNTIME | DL_FLAG_RPM_ACTIVE.
      
      After runtime suspended consumers and supplier, unload the dirver which
      causes a hung.
      
      We found that it called function device_release_driver_internal() to
      release the supplier device (hisi_hba->dev), as the device link was
      busy, it set the device link state to DL_STATE_SUPPLIER_UNBIND, and
      then it called device_release_driver_internal() to release the consumer
      device (scsi_device->sdev_gendev).
      
      Then it would try to call pm_runtime_get_sync() to resume the consumer
      device, but because consumer-supplier relation existed, it would try
      to resume the supplier first, but as the link state was already
      DL_STATE_SUPPLIER_UNBIND, so it skipped resuming the supplier and only
      resumed the consumer which hanged (it sends IOs to resume scsi_device
      while the SAS controller is suspended).
      
      Simple flow is as follows:
      
      device_release_driver_internal -> (supplier device)
          if device_links_busy ->
      	device_links_unbind_consumers ->
      	    ...
      	    WRITE_ONCE(link->status, DL_STATE_SUPPLIER_UNBIND)
      	    device_release_driver_internal (consumer device)
          pm_runtime_get_sync -> (consumer device)
      	...
      	__rpm_callback ->
      	    rpm_get_suppliers ->
      		if link->state == DL_STATE_SUPPLIER_UNBIND -> skip the action of resuming the supplier
      		...
          pm_runtime_clean_up_links
          ...
      
      Correct suspend/resume ordering between a supplier device and its consumer
      devices (resume the supplier device before resuming consumer devices, and
      suspend consumer devices before suspending the supplier device) should be
      guaranteed by runtime PM, but the state checks in rpm_get_supplier() and
      rpm_put_supplier() break this rule, so remove them.
      Signed-off-by: NXiang Chen <chenxiang66@hisilicon.com>
      [ rjw: Subject and changelog edits ]
      Cc: All applicable <stable@vger.kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      d12544fb
  4. 04 8月, 2020 1 次提交
  5. 25 5月, 2020 1 次提交
  6. 04 3月, 2020 1 次提交
    • S
      PM: runtime: Add pm_runtime_get_if_active() · c111566b
      Sakari Ailus 提交于
      pm_runtime_get_if_in_use() bumps up the PM-runtime usage count if it
      is not equal to zero and the device's PM-runtime status is 'active'.
      This works for drivers that do not use autoidle, but for those that
      do, the function returns zero even when the device is active.
      
      In order to maintain sane device state while the device is powered on
      in the hope that it'll be needed, pm_runtime_get_if_active(dev, true)
      returns a positive value if the device's PM-runtime status is 'active'
      when it is called, in which case it also increments the device's usage
      count.
      
      If the second argument of pm_runtime_get_if_active() is 'false', the
      function behaves just like pm_runtime_get_if_in_use(), so redefine
      the latter as a wrapper around the former.
      Signed-off-by: NSakari Ailus <sakari.ailus@linux.intel.com>
      [ rjw: Changelog ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      c111566b
  7. 13 1月, 2020 1 次提交
  8. 14 8月, 2019 1 次提交
  9. 25 7月, 2019 1 次提交
    • R
      driver core: Remove device link creation limitation · 515db266
      Rafael J. Wysocki 提交于
      If device_link_add() is called for a consumer/supplier pair with an
      existing device link between them and the existing link's type is
      not in agreement with the flags passed to that function by its
      caller, NULL will be returned.  That is seriously inconvenient,
      because it forces the callers of device_link_add() to worry about
      what others may or may not do even if that is not relevant to them
      for any other reasons.
      
      It turns out, however, that this limitation can be made go away
      relatively easily.
      
      The underlying observation is that if DL_FLAG_STATELESS has been
      passed to device_link_add() in flags for the given consumer/supplier
      pair at least once, calling either device_link_del() or
      device_link_remove() to release the link returned by it should work,
      but there are no other requirements associated with that flag.  In
      turn, if at least one of the callers of device_link_add() for the
      given consumer/supplier pair has not passed DL_FLAG_STATELESS to it
      in flags, the driver core should track the status of the link and act
      on it as appropriate (ie. the link should be treated as "managed").
      This means that DL_FLAG_STATELESS needs to be set for managed device
      links and it should be valid to call device_link_del() or
      device_link_remove() to drop references to them in certain
      sutiations.
      
      To allow that to happen, introduce a new (internal) device link flag
      called DL_FLAG_MANAGED and make device_link_add() set it automatically
      whenever DL_FLAG_STATELESS is not passed to it.  Also make it take
      additional references to existing device links that were previously
      stateless (that is, with DL_FLAG_STATELESS set and DL_FLAG_MANAGED
      unset) and will need to be managed going forward and initialize
      their status (which has been DL_STATE_NONE so far).
      
      Accordingly, when a managed device link is dropped automatically
      by the driver core, make it clear DL_FLAG_MANAGED, reset the link's
      status back to DL_STATE_NONE and drop the reference to it associated
      with DL_FLAG_MANAGED instead of just deleting it right away (to
      allow it to stay around in case it still needs to be released
      explicitly by someone).
      
      With that, since setting DL_FLAG_STATELESS doesn't mean that the
      device link in question is not managed any more, replace all of the
      status-tracking checks against DL_FLAG_STATELESS with analogous
      checks against DL_FLAG_MANAGED and update the documentation to
      reflect these changes.
      
      While at it, make device_link_add() reject flags that it does not
      recognize, including DL_FLAG_MANAGED.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NSaravana Kannan <saravanak@google.com>
      Tested-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Review-by: NSaravana Kannan <saravanak@google.com>
      Link: https://lore.kernel.org/r/2305283.AStDPdUUnE@kreacherSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      515db266
  10. 04 7月, 2019 1 次提交
  11. 05 4月, 2019 1 次提交
  12. 07 3月, 2019 2 次提交
  13. 21 2月, 2019 1 次提交
  14. 20 2月, 2019 1 次提交
    • R
      driver core: Fix PM-runtime for links added during consumer probe · 36003d4c
      Rafael J. Wysocki 提交于
      Commit 4c06c4e6 ("driver core: Fix possible supplier PM-usage
      counter imbalance") introduced a regression that causes suppliers
      to be suspended prematurely for device links added during consumer
      driver probe if the initial PM-runtime status of the consumer is
      "suspended" and the consumer is resumed after adding the link and
      before pm_runtime_put_suppliers() is called.  In that case,
      pm_runtime_put_suppliers() will drop the rpm_active refcount for
      the link by one and (since rpm_active is equal to two after the
      preceding consumer resume) the supplier's PM-runtime usage counter
      will be decremented, which may cause the supplier to suspend even
      though the consumer's PM-runtime status is "active".
      
      For this reason, partially revert commit 4c06c4e6 as the problem
      it tried to fix needs to be addressed somewhat differently, and
      change pm_runtime_get_suppliers() and pm_runtime_put_suppliers() so
      that the latter only drops rpm_active references acquired by the
      former.  [This requires adding a new field to struct device_link,
      but I coulnd't find a cleaner way to address the issue that would
      work in all cases.]
      
      This causes pm_runtime_put_suppliers() to effectively ignore device
      links added during consumer probe, so device_link_add() doesn't need
      to worry about ensuring that suppliers will remain active after
      pm_runtime_put_suppliers() for links created with DL_FLAG_RPM_ACTIVE
      set and it only needs to bump up rpm_active by one for those links,
      so pm_runtime_active_link() is not necessary any more.
      
      Fixes: 4c06c4e6 ("driver core: Fix possible supplier PM-usage counter imbalance")
      Reported-by: NJon Hunter <jonathanh@nvidia.com>
      Tested-by: NJon Hunter <jonathanh@nvidia.com>
      Tested-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Tested-by: NThierry Reding <treding@nvidia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36003d4c
  15. 13 2月, 2019 2 次提交
    • R
      driver core: Fix possible supplier PM-usage counter imbalance · 4c06c4e6
      Rafael J. Wysocki 提交于
      If a stateless device link to a certain supplier with
      DL_FLAG_PM_RUNTIME set in the flags is added and then removed by the
      consumer driver's probe callback, the supplier's PM-runtime usage
      counter will be nonzero after that which effectively causes the
      supplier to remain "always on" going forward.
      
      Namely, device_link_add() called to add the link invokes
      device_link_rpm_prepare() which notices that the consumer driver is
      probing, so it increments the supplier's PM-runtime usage counter
      with the assumption that the link will stay around until
      pm_runtime_put_suppliers() is called by driver_probe_device(),
      but if the link goes away before that point, the supplier's
      PM-runtime usage counter will remain nonzero.
      
      To prevent that from happening, first rework pm_runtime_get_suppliers()
      and pm_runtime_put_suppliers() to use the rpm_active refounts of device
      links and make the latter only drop rpm_active and the supplier's
      PM-runtime usage counter for each link by one, unless rpm_active is
      one already for it.  Next, modify device_link_add() to bump up the
      new link's rpm_active refcount and the suppliers PM-runtime usage
      counter by two, to prevent pm_runtime_put_suppliers(), if it is
      called subsequently, from suspending the supplier prematurely (in
      case its PM-runtime usage counter goes down to 0 in there).
      
      Due to the way rpm_put_suppliers() works, this change does not
      affect runtime suspend of the consumer ends of new device links (or,
      generally, device links for which DL_FLAG_PM_RUNTIME has just been
      set).
      
      Fixes: e2f3cd83 ("driver core: Fix handling of runtime PM flags in device_link_add()")
      Reported-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c06c4e6
    • R
      PM-runtime: Fix __pm_runtime_set_status() race with runtime resume · c1567f81
      Rafael J. Wysocki 提交于
      Commit 4080ab08 ("PM-runtime: Take suppliers into account in
      __pm_runtime_set_status()") introduced a race condition that may
      trigger if __pm_runtime_set_status() is used incorrectly (that is,
      if it is called when PM-runtime is enabled for the target device
      and working).
      
      In that case, if the original PM-runtime status of the device is
      RPM_SUSPENDED, a runtime resume of the device may occur after
      __pm_runtime_set_status() has dropped its power.lock spinlock
      and before deactivating its suppliers, so the suppliers may be
      deactivated while the device is PM-runtime-active which may lead
      to functional issues.
      
      To avoid that, modify __pm_runtime_set_status() to check whether
      or not PM-runtime is enabled for the device before activating its
      suppliers (if the new status is RPM_ACTIVE) and either return an
      error if that's the case or increment the device's disable_depth
      counter to prevent PM-runtime from being enabled for it while
      the remaining part of the function is running (disable_depth is
      then decremented on the way out).
      
      Fixes: 4080ab08 ("PM-runtime: Take suppliers into account in __pm_runtime_set_status()")
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c1567f81
  16. 08 2月, 2019 1 次提交
    • R
      PM-runtime: Take suppliers into account in __pm_runtime_set_status() · 4080ab08
      Rafael J. Wysocki 提交于
      If the target device has any suppliers, as reflected by device links
      to them, __pm_runtime_set_status() does not take them into account,
      which is not consistent with the other parts of the PM-runtime
      framework and may lead to programming mistakes.
      
      Modify __pm_runtime_set_status() to take suppliers into account by
      activating them upfront if the new status is RPM_ACTIVE and
      deactivating them on exit if the new status is RPM_SUSPENDED.
      
      If the activation of one of the suppliers fails, the new status
      will be RPM_SUSPENDED and the (remaining) suppliers will be
      deactivated on exit (the child count of the device's parent
      will be dropped too then).
      
      Of course, adding device links locking to __pm_runtime_set_status()
      means that it cannot be run fron interrupt context, so make it use
      spin_lock_irq() and spin_unlock_irq() instead of spin_lock_irqsave()
      and spin_unlock_irqrestore(), respectively.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4080ab08
  17. 05 2月, 2019 2 次提交
  18. 01 2月, 2019 3 次提交
    • L
      PM-runtime: Optimize pm_runtime_autosuspend_expiration() · f800ea32
      Ladislav Michl 提交于
      pm_runtime_autosuspend_expiration calls ktime_get_mono_fast_ns()
      even when its returned value may be unused. Therefore get the
      current time later and remove gotos while there.
      Signed-off-by: NLadislav Michl <ladis@linux-mips.org>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NVincent Guittot <vincent.guittot@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f800ea32
    • R
      driver core: Do not call rpm_put_suppliers() in pm_runtime_drop_link() · a1fdbfbb
      Rafael J. Wysocki 提交于
      Calling rpm_put_suppliers() from pm_runtime_drop_link() is excessive
      as it affects all suppliers of the consumer device and not just the
      one pointed to by the device link being dropped.  Worst case it may
      cause the consumer device to stop working unexpectedly.  Moreover, in
      principle it is racy with respect to runtime PM of the consumer
      device.
      
      To avoid these problems drop runtime PM references on the particular
      supplier pointed to by the link in question only and do that after
      the link has been dropped from the consumer device's list of links to
      suppliers, which is in device_link_free().
      
      Fixes: a0504aec ("PM / runtime: Drop usage count for suppliers at device link removal")
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a1fdbfbb
    • R
      driver core: Fix handling of runtime PM flags in device_link_add() · e2f3cd83
      Rafael J. Wysocki 提交于
      After commit ead18c23 ("driver core: Introduce device links
      reference counting"), if there is a link between the given supplier
      and the given consumer already, device_link_add() will refcount it
      and return it unconditionally without updating its flags.  It is
      possible, however, that the second (or any subsequent) caller of
      device_link_add() for the same consumer-supplier pair will pass
      DL_FLAG_PM_RUNTIME, possibly along with DL_FLAG_RPM_ACTIVE, in flags
      to it and the existing link may not behave as expected then.
      
      First, if DL_FLAG_PM_RUNTIME is not set in the existing link's flags
      at all, it needs to be set like during the original initialization of
      the link.
      
      Second, if DL_FLAG_RPM_ACTIVE is passed to device_link_add() in flags
      (in addition to DL_FLAG_PM_RUNTIME), the existing link should to be
      updated to reflect the "active" runtime PM configuration of the
      consumer-supplier pair and extra care must be taken here to avoid
      possible destructive races with runtime PM of the consumer.
      
      To that end, redefine the rpm_active field in struct device_link
      as a refcount, initialize it to 1 and make rpm_resume() (for the
      consumer) and device_link_add() increment it whenever they acquire
      a runtime PM reference on the supplier device.  Accordingly, make
      rpm_suspend() (for the consumer) and pm_runtime_clean_up_links()
      decrement it and drop runtime PM references to the supplier
      device in a loop until rpm_active becones 1 again.
      
      Fixes: ead18c23 ("driver core: Introduce device links reference counting")
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e2f3cd83
  19. 31 1月, 2019 3 次提交
  20. 16 1月, 2019 1 次提交
  21. 10 1月, 2019 2 次提交
  22. 19 12月, 2018 1 次提交
    • V
      PM-runtime: Switch autosuspend over to using hrtimers · 8234f673
      Vincent Guittot 提交于
      PM-runtime uses the timer infrastructure for autosuspend. This implies
      that the minimum time before autosuspending a device is in the range
      of 1 tick included to 2 ticks excluded
       -On arm64 this means between 4ms and 8ms with default jiffies
        configuration
       -And on arm, it is between 10ms and 20ms
      
      These values are quite high for embedded systems which sometimes want
      the duration to be in the range of 1 ms.
      
      It is possible to switch autosuspend over to using hrtimers to get
      finer granularity for short durations and take advantage of slack to
      retain some margins and get long timeouts with minimum wakeups.
      
      On an arm64 platform that uses 1ms for autosuspending timeout of its
      GPU, idle power is reduced by 10% with hrtimer.
      
      The latency impact on arm64 hikey octo cores is:
       - mark_last_busy: from 1.11 us to 1.25 us
       - rpm_suspend: from 15.54 us to 15.38 us
      [Only the code path of rpm_suspend() that starts hrtimer has been
      measured.]
      
      arm64 image (arm64 default defconfig) decreases by around 3KB
      with following details:
      
      $ size vmlinux-timer
         text	   data	    bss	    dec	    hex	filename
      12034646	6869268	 386840	19290754	1265a82	vmlinux
      
      $ size vmlinux-hrtimer
         text	   data	    bss	    dec	    hex	filename
      12030550	6870164	 387032	19287746	1264ec2	vmlinux
      
      The latency impact on arm 32bits snowball dual cores is :
       - mark_last_busy: from 0.31 us usec to 0.77 us
       - rpm_suspend: from 6.83 us to 6.67 usec
      
      The increase of the image for snowball platform that I used for
      testing performance impact, is neglictable (244B).
      
      $ size vmlinux-timer
         text	   data	    bss	    dec	    hex	filename
      7157961	2119580	 264120	9541661	 91981d	build-ux500/vmlinux
      
      size vmlinux-hrtimer
         text	   data	    bss	    dec	    hex	filename
      7157773	21198846	 264248	9541905	 919911	vmlinux-hrtimer
      
      And arm 32bits image (multi_v7_defconfig) increases by around 1.7KB
      with following details:
      
      $ size vmlinux-timer
         text	   data	    bss	    dec	    hex	filename
      13304443	6803420	 402768	20510631	138f7a7	vmlinux
      
      $ size vmlinux-hrtimer
         text	   data	    bss	    dec	    hex	filename
      13304299	6805276	 402768	20512343	138fe57	vmlinux
      Signed-off-by: NVincent Guittot <vincent.guittot@linaro.org>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      8234f673
  23. 12 6月, 2018 1 次提交
  24. 27 5月, 2018 2 次提交
    • U
      PM / runtime: Drop usage count for suppliers at device link removal · a0504aec
      Ulf Hansson 提交于
      In the case consumer device is runtime resumed, while the link to the
      supplier is removed, the earlier call to pm_runtime_get_sync() made from
      rpm_get_suppliers() does not get properly balanced with a corresponding
      call to pm_runtime_put(). This leads to that suppliers remains to be
      runtime resumed forever, while they don't need to.
      
      Let's fix the behaviour by calling rpm_put_suppliers() when dropping a
      device link. Not that, since rpm_put_suppliers() checks the
      link->rpm_active flag, we can correctly avoid to call pm_runtime_put() in
      cases when we shouldn't.
      Reported-by: NTodor Tomov <todor.tomov@linaro.org>
      Fixes: 21d5c57b (PM / runtime: Use device links)
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      a0504aec
    • U
      PM / runtime: Fixup reference counting of device link suppliers at probe · 1e837861
      Ulf Hansson 提交于
      In the driver core, before it invokes really_probe() it runtime resumes the
      suppliers for the device via calling pm_runtime_get_suppliers(), which also
      increases the runtime PM usage count for each of the available supplier.
      
      This makes sense, as to be able to allow the consumer device to be probed
      by its driver. However, if the driver decides to add a new supplier link
      during ->probe(), hence updating the list of suppliers, the following call
      to pm_runtime_put_suppliers(), invoked after really_probe() in the driver
      core, we get into trouble.
      
      More precisely, pm_runtime_put() gets called also for the new supplier(s),
      which is wrong as the driver core, didn't trigger pm_runtime_get_sync() to
      be called for it in the first place. In other words, the new supplier may
      be runtime suspended even in cases when it shouldn't.
      
      Fix this behaviour, by runtime resume suppliers according to the same
      conditions as managed by the runtime PM core, when runtime resume callbacks
      are being invoked.
      
      Additionally, don't try to runtime suspend any of the suppliers after
      really_probe(), but instead rely on that to happen via the consumer device,
      when it becomes runtime suspended.
      
      Fixes: 21d5c57b (PM / runtime: Use device links)
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1e837861
  25. 17 1月, 2018 1 次提交
  26. 16 1月, 2018 1 次提交
  27. 15 1月, 2018 1 次提交
    • R
      PM / runtime: Rework pm_runtime_force_suspend/resume() · 4918e1f8
      Rafael J. Wysocki 提交于
      One of the limitations of pm_runtime_force_suspend/resume() is that
      if a parent driver wants to use these functions, all of its child
      drivers generally have to do that too because of the parent usage
      counter manipulations necessary to get the correct state of the parent
      during system-wide transitions to the working state (system resume).
      However, that limitation turns out to be artificial, so remove it.
      
      Namely, pm_runtime_force_suspend() only needs to update the children
      counter of its parent (if there's is a parent) when the device can
      stay in suspend after the subsequent system resume transition, as
      that counter is correct already otherwise.  Now, if the parent's
      children counter is not updated, it is not necessary to increment
      the parent's usage counter in that case any more, as long as the
      children counters of devices are checked along with their usage
      counters in order to decide whether or not the devices may be left
      in suspend after the subsequent system resume transition.
      
      Accordingly, modify pm_runtime_force_suspend() to only call
      pm_runtime_set_suspended() for devices whose usage and children
      counters are at the "no references" level (the runtime PM status
      of the device needs to be updated to "suspended" anyway in case
      this function is called once again for the same device during the
      transition under way), drop the parent usage counter incrementation
      from it and update pm_runtime_force_resume() to compensate for these
      changes.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      4918e1f8
  28. 04 12月, 2017 1 次提交
  29. 17 11月, 2017 1 次提交
    • R
      PM / runtime: Drop children check from __pm_runtime_set_status() · f8817f61
      Rafael J. Wysocki 提交于
      The check for "active" children in __pm_runtime_set_status(), when
      trying to set the parent device status to "suspended", doesn't
      really make sense, because in fact it is not invalid to set the
      status of a device with runtime PM disabled to "suspended" in any
      case.  It is invalid to enable runtime PM for a device with its
      status set to "suspended" while its child_count reference counter
      is nonzero, but the check in __pm_runtime_set_status() doesn't
      really cover that situation.
      
      For this reason, drop the children check from __pm_runtime_set_status()
      and add a check against child_count reference counters of "suspended"
      devices to pm_runtime_enable().
      
      Fixes: a8636c89 (PM / Runtime: Don't allow to suspend a device with an active child)
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NJohan Hovold <johan@kernel.org>
      f8817f61
  30. 08 11月, 2017 1 次提交