]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge branches 'pm-core' and 'pm-runtime'
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 7 Oct 2025 10:20:36 +0000 (12:20 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 7 Oct 2025 10:20:36 +0000 (12:20 +0200)
Merge runtime PM framework updates and a core power management code fix
for 6.18-rc1:

 - Make pm_runtime_put*() family of functions return 1 when the
   given device is already suspended which is consistent with the
   documentation (Brian Norris)

 - Add basic kunit tests for runtime PM API contracts and update return
   values in kerneldoc coments for the runtime PM API (Brian Norris,
   Dan Carpenter)

 - Add auto-cleanup macros for runtime PM "resume and get" and "get
   without resume" operations, use one of them in the PCI core and
   drop the existing "free" macro introduced for similar purpose, but
   somewhat cumbersome to use (Rafael Wysocki)

 - Make the core power management code avoid waiting on device links
   marked as SYNC_STATE_ONLY which is consistent with the handling of
   those device links elsewhere (Pin-yen Lin)

* pm-core:
  PM: sleep: Do not wait on SYNC_STATE_ONLY device links

* pm-runtime:
  PM: runtime: Fix error checking for kunit_device_register()
  PM: runtime: Introduce one more usage counter guard
  PM: runtime: Drop DEFINE_FREE() for pm_runtime_put()
  PCI/sysfs: Use runtime PM guard macro for auto-cleanup
  PM: runtime: Add auto-cleanup macros for "resume and get" operations
  PM: runtime: Update kerneldoc return codes
  PM: runtime: Make put{,_sync}() return 1 when already suspended
  PM: runtime: Add basic kunit tests for API contracts

1  2  3 
drivers/base/core.c
drivers/base/power/main.c
drivers/base/power/runtime.c

Simple merge
index b9a34c3425ecfab038097e2c03645157af2e598c,c97f8b139dc202b3dd25560ad87281e21d292f72,2ea6e05e6ec90ea2a89aa9b0593536de7b0365a0..e83503bdc1fdb83de20192745ca7e416fd556e04
@@@@ -277,8 -277,9 -281,8 +277,9 @@@@ static void dpm_wait_for_suppliers(stru
         * callbacks freeing the link objects for the links in the list we're
         * walking.
         */
  -     list_for_each_entry_rcu_locked(link, &dev->links.suppliers, c_node)
  -             if (READ_ONCE(link->status) != DL_STATE_DORMANT)
  +     dev_for_each_link_to_supplier(link, dev)
-               if (READ_ONCE(link->status) != DL_STATE_DORMANT)
+ +             if (READ_ONCE(link->status) != DL_STATE_DORMANT &&
+ +                 !device_link_flag_is_sync_state_only(link->flags))
                        dpm_wait(link->supplier, async);
   
        device_links_read_unlock(idx);
@@@@ -334,8 -335,9 -338,8 +335,9 @@@@ static void dpm_wait_for_consumers(stru
         * continue instead of trying to continue in parallel with its
         * unregistration).
         */
  -     list_for_each_entry_rcu_locked(link, &dev->links.consumers, s_node)
  -             if (READ_ONCE(link->status) != DL_STATE_DORMANT)
  +     dev_for_each_link_to_consumer(link, dev)
-               if (READ_ONCE(link->status) != DL_STATE_DORMANT)
+ +             if (READ_ONCE(link->status) != DL_STATE_DORMANT &&
+ +                 !device_link_flag_is_sync_state_only(link->flags))
                        dpm_wait(link->consumer, async);
   
        device_links_read_unlock(idx);
Simple merge