Skip to content

Commit 9f20d9b

Browse files
committed
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
2 parents 7a3984b + 316f0b4 commit 9f20d9b

5 files changed

Lines changed: 8 additions & 25 deletions

File tree

Documentation/power/runtime_pm.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,13 +443,11 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
443443
necessary to execute the subsystem-level resume callback for the device
444444
to satisfy that request, otherwise 0 is returned
445445

446-
`int pm_runtime_barrier(struct device *dev);`
446+
`void pm_runtime_barrier(struct device *dev);`
447447
- check if there's a resume request pending for the device and resume it
448448
(synchronously) in that case, cancel any other pending runtime PM requests
449449
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
453451

454452
`void pm_suspend_ignore_children(struct device *dev, bool enable);`
455453
- set/unset the power.ignore_children flag of the device

drivers/base/power/runtime-test.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ static void pm_runtime_already_suspended_test(struct kunit *test)
3737
pm_runtime_enable(dev);
3838
KUNIT_EXPECT_TRUE(test, pm_runtime_suspended(dev));
3939

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-
4440
pm_runtime_get_noresume(dev);
4541
KUNIT_EXPECT_EQ(test, 1, pm_runtime_put_sync(dev));
4642

@@ -174,7 +170,7 @@ static void pm_runtime_error_test(struct kunit *test)
174170
KUNIT_EXPECT_TRUE(test, pm_runtime_suspended(dev));
175171

176172
KUNIT_EXPECT_EQ(test, 0, pm_runtime_get(dev));
177-
KUNIT_EXPECT_EQ(test, 1, pm_runtime_barrier(dev)); /* resume was pending */
173+
pm_runtime_barrier(dev);
178174
pm_runtime_put(dev);
179175
pm_runtime_suspend(dev); /* flush the put(), to suspend */
180176
KUNIT_EXPECT_TRUE(test, pm_runtime_suspended(dev));
@@ -225,7 +221,7 @@ static void pm_runtime_probe_active_test(struct kunit *test)
225221
KUNIT_EXPECT_TRUE(test, pm_runtime_active(dev));
226222

227223
/* Nothing to flush. We stay active. */
228-
KUNIT_EXPECT_EQ(test, 0, pm_runtime_barrier(dev));
224+
pm_runtime_barrier(dev);
229225
KUNIT_EXPECT_TRUE(test, pm_runtime_active(dev));
230226

231227
/* Ask for idle? Now we suspend. */

drivers/base/power/runtime.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,30 +1467,20 @@ static void __pm_runtime_barrier(struct device *dev)
14671467
* Next, make sure that all pending requests for the device have been flushed
14681468
* from pm_wq and wait for all runtime PM operations involving the device in
14691469
* 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
14741470
*/
1475-
int pm_runtime_barrier(struct device *dev)
1471+
void pm_runtime_barrier(struct device *dev)
14761472
{
1477-
int retval = 0;
1478-
14791473
pm_runtime_get_noresume(dev);
14801474
spin_lock_irq(&dev->power.lock);
14811475

14821476
if (dev->power.request_pending
1483-
&& dev->power.request == RPM_REQ_RESUME) {
1477+
&& dev->power.request == RPM_REQ_RESUME)
14841478
rpm_resume(dev, 0);
1485-
retval = 1;
1486-
}
14871479

14881480
__pm_runtime_barrier(dev);
14891481

14901482
spin_unlock_irq(&dev->power.lock);
14911483
pm_runtime_put_noidle(dev);
1492-
1493-
return retval;
14941484
}
14951485
EXPORT_SYMBOL_GPL(pm_runtime_barrier);
14961486

include/linux/pm_runtime.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extern int pm_runtime_get_if_active(struct device *dev);
7676
extern int pm_runtime_get_if_in_use(struct device *dev);
7777
extern int pm_schedule_suspend(struct device *dev, unsigned int delay);
7878
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);
8080
extern bool pm_runtime_block_if_disabled(struct device *dev);
8181
extern void pm_runtime_unblock(struct device *dev);
8282
extern void pm_runtime_enable(struct device *dev);
@@ -284,7 +284,7 @@ static inline int pm_runtime_get_if_active(struct device *dev)
284284
}
285285
static inline int __pm_runtime_set_status(struct device *dev,
286286
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) {}
288288
static inline bool pm_runtime_block_if_disabled(struct device *dev) { return true; }
289289
static inline void pm_runtime_unblock(struct device *dev) {}
290290
static inline void pm_runtime_enable(struct device *dev) {}

scripts/coccinelle/api/pm_runtime.cocci

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ ret@p = \(pm_runtime_idle\|
3737
pm_runtime_put_sync_autosuspend\|
3838
pm_runtime_set_active\|
3939
pm_schedule_suspend\|
40-
pm_runtime_barrier\|
4140
pm_generic_runtime_suspend\|
4241
pm_generic_runtime_resume\)(...);
4342
...

0 commit comments

Comments
 (0)