Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm-6.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull more power management updates from Rafael Wysocki:
"Fix a runtime PM unit test added during the 6.18 development cycle and
change the pm_runtime_barrier() return type to void (Brian Norris)"

* tag 'pm-6.19-rc1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
coccinelle: Drop pm_runtime_barrier() error code checks
PM: runtime: Make pm_runtime_barrier() return void
PM: runtime: Stop checking pm_runtime_barrier() return code

+8 -25
+2 -4
Documentation/power/runtime_pm.rst
··· 443 443 necessary to execute the subsystem-level resume callback for the device 444 444 to satisfy that request, otherwise 0 is returned 445 445 446 - `int pm_runtime_barrier(struct device *dev);` 446 + `void pm_runtime_barrier(struct device *dev);` 447 447 - check if there's a resume request pending for the device and resume it 448 448 (synchronously) in that case, cancel any other pending runtime PM requests 449 449 regarding it and wait for all runtime PM operations on it in progress to 450 - complete; returns 1 if there was a resume request pending and it was 451 - necessary to execute the subsystem-level resume callback for the device to 452 - satisfy that request, otherwise 0 is returned 450 + complete 453 451 454 452 `void pm_suspend_ignore_children(struct device *dev, bool enable);` 455 453 - set/unset the power.ignore_children flag of the device
+2 -6
drivers/base/power/runtime-test.c
··· 38 38 KUNIT_EXPECT_TRUE(test, pm_runtime_suspended(dev)); 39 39 40 40 pm_runtime_get_noresume(dev); 41 - KUNIT_EXPECT_EQ(test, 0, pm_runtime_barrier(dev)); /* no wakeup needed */ 42 - pm_runtime_put(dev); 43 - 44 - pm_runtime_get_noresume(dev); 45 41 KUNIT_EXPECT_EQ(test, 1, pm_runtime_put_sync(dev)); 46 42 47 43 KUNIT_EXPECT_EQ(test, 1, pm_runtime_suspend(dev)); ··· 170 174 KUNIT_EXPECT_TRUE(test, pm_runtime_suspended(dev)); 171 175 172 176 KUNIT_EXPECT_EQ(test, 0, pm_runtime_get(dev)); 173 - KUNIT_EXPECT_EQ(test, 1, pm_runtime_barrier(dev)); /* resume was pending */ 177 + pm_runtime_barrier(dev); 174 178 pm_runtime_put(dev); 175 179 pm_runtime_suspend(dev); /* flush the put(), to suspend */ 176 180 KUNIT_EXPECT_TRUE(test, pm_runtime_suspended(dev)); ··· 221 225 KUNIT_EXPECT_TRUE(test, pm_runtime_active(dev)); 222 226 223 227 /* Nothing to flush. We stay active. */ 224 - KUNIT_EXPECT_EQ(test, 0, pm_runtime_barrier(dev)); 228 + pm_runtime_barrier(dev); 225 229 KUNIT_EXPECT_TRUE(test, pm_runtime_active(dev)); 226 230 227 231 /* Ask for idle? Now we suspend. */
+2 -12
drivers/base/power/runtime.c
··· 1467 1467 * Next, make sure that all pending requests for the device have been flushed 1468 1468 * from pm_wq and wait for all runtime PM operations involving the device in 1469 1469 * progress to complete. 1470 - * 1471 - * Return value: 1472 - * 1, if there was a resume request pending and the device had to be woken up, 1473 - * 0, otherwise 1474 1470 */ 1475 - int pm_runtime_barrier(struct device *dev) 1471 + void pm_runtime_barrier(struct device *dev) 1476 1472 { 1477 - int retval = 0; 1478 - 1479 1473 pm_runtime_get_noresume(dev); 1480 1474 spin_lock_irq(&dev->power.lock); 1481 1475 1482 1476 if (dev->power.request_pending 1483 - && dev->power.request == RPM_REQ_RESUME) { 1477 + && dev->power.request == RPM_REQ_RESUME) 1484 1478 rpm_resume(dev, 0); 1485 - retval = 1; 1486 - } 1487 1479 1488 1480 __pm_runtime_barrier(dev); 1489 1481 1490 1482 spin_unlock_irq(&dev->power.lock); 1491 1483 pm_runtime_put_noidle(dev); 1492 - 1493 - return retval; 1494 1484 } 1495 1485 EXPORT_SYMBOL_GPL(pm_runtime_barrier); 1496 1486
+2 -2
include/linux/pm_runtime.h
··· 76 76 extern int pm_runtime_get_if_in_use(struct device *dev); 77 77 extern int pm_schedule_suspend(struct device *dev, unsigned int delay); 78 78 extern int __pm_runtime_set_status(struct device *dev, unsigned int status); 79 - extern int pm_runtime_barrier(struct device *dev); 79 + extern void pm_runtime_barrier(struct device *dev); 80 80 extern bool pm_runtime_block_if_disabled(struct device *dev); 81 81 extern void pm_runtime_unblock(struct device *dev); 82 82 extern void pm_runtime_enable(struct device *dev); ··· 284 284 } 285 285 static inline int __pm_runtime_set_status(struct device *dev, 286 286 unsigned int status) { return 0; } 287 - static inline int pm_runtime_barrier(struct device *dev) { return 0; } 287 + static inline void pm_runtime_barrier(struct device *dev) {} 288 288 static inline bool pm_runtime_block_if_disabled(struct device *dev) { return true; } 289 289 static inline void pm_runtime_unblock(struct device *dev) {} 290 290 static inline void pm_runtime_enable(struct device *dev) {}
-1
scripts/coccinelle/api/pm_runtime.cocci
··· 37 37 pm_runtime_put_sync_autosuspend\| 38 38 pm_runtime_set_active\| 39 39 pm_schedule_suspend\| 40 - pm_runtime_barrier\| 41 40 pm_generic_runtime_suspend\| 42 41 pm_generic_runtime_resume\)(...); 43 42 ...