@@ -308,13 +308,10 @@ static int rpm_get_suppliers(struct device *dev)
308
308
/**
309
309
* pm_runtime_release_supplier - Drop references to device link's supplier.
310
310
* @link: Target device link.
311
- * @check_idle: Whether or not to check if the supplier device is idle.
312
311
*
313
- * Drop all runtime PM references associated with @link to its supplier device
314
- * and if @check_idle is set, check if that device is idle (and so it can be
315
- * suspended).
312
+ * Drop all runtime PM references associated with @link to its supplier device.
316
313
*/
317
- void pm_runtime_release_supplier (struct device_link * link , bool check_idle )
314
+ void pm_runtime_release_supplier (struct device_link * link )
318
315
{
319
316
struct device * supplier = link -> supplier ;
320
317
@@ -327,18 +324,18 @@ void pm_runtime_release_supplier(struct device_link *link, bool check_idle)
327
324
while (refcount_dec_not_one (& link -> rpm_active ) &&
328
325
atomic_read (& supplier -> power .usage_count ) > 0 )
329
326
pm_runtime_put_noidle (supplier );
330
-
331
- if (check_idle )
332
- pm_request_idle (supplier );
333
327
}
334
328
335
329
static void __rpm_put_suppliers (struct device * dev , bool try_to_suspend )
336
330
{
337
331
struct device_link * link ;
338
332
339
333
list_for_each_entry_rcu (link , & dev -> links .suppliers , c_node ,
340
- device_links_read_lock_held ())
341
- pm_runtime_release_supplier (link , try_to_suspend );
334
+ device_links_read_lock_held ()) {
335
+ pm_runtime_release_supplier (link );
336
+ if (try_to_suspend )
337
+ pm_request_idle (link -> supplier );
338
+ }
342
339
}
343
340
344
341
static void rpm_put_suppliers (struct device * dev )
@@ -1771,7 +1768,6 @@ void pm_runtime_get_suppliers(struct device *dev)
1771
1768
if (link -> flags & DL_FLAG_PM_RUNTIME ) {
1772
1769
link -> supplier_preactivated = true;
1773
1770
pm_runtime_get_sync (link -> supplier );
1774
- refcount_inc (& link -> rpm_active );
1775
1771
}
1776
1772
1777
1773
device_links_read_unlock (idx );
@@ -1791,19 +1787,8 @@ void pm_runtime_put_suppliers(struct device *dev)
1791
1787
list_for_each_entry_rcu (link , & dev -> links .suppliers , c_node ,
1792
1788
device_links_read_lock_held ())
1793
1789
if (link -> supplier_preactivated ) {
1794
- bool put ;
1795
-
1796
1790
link -> supplier_preactivated = false;
1797
-
1798
- spin_lock_irq (& dev -> power .lock );
1799
-
1800
- put = pm_runtime_status_suspended (dev ) &&
1801
- refcount_dec_not_one (& link -> rpm_active );
1802
-
1803
- spin_unlock_irq (& dev -> power .lock );
1804
-
1805
- if (put )
1806
- pm_runtime_put (link -> supplier );
1791
+ pm_runtime_put (link -> supplier );
1807
1792
}
1808
1793
1809
1794
device_links_read_unlock (idx );
@@ -1838,7 +1823,8 @@ void pm_runtime_drop_link(struct device_link *link)
1838
1823
return ;
1839
1824
1840
1825
pm_runtime_drop_link_count (link -> consumer );
1841
- pm_runtime_release_supplier (link , true);
1826
+ pm_runtime_release_supplier (link );
1827
+ pm_request_idle (link -> supplier );
1842
1828
}
1843
1829
1844
1830
static bool pm_runtime_need_not_resume (struct device * dev )
0 commit comments