Skip to content

Commit 3df2470

Browse files
computersforpeacerafaeljw
authored andcommitted
PM: runtime: Stop checking pm_runtime_barrier() return code
Apparently this test is the only code that checks the return code from pm_runtime_barrier(), and it turns out that's for good reason -- it's inherently racy, and a bad idea. We're going to make pm_runtime_barrier() return void, so prepare for that by dropping any return code checks. This resolves some test failures seen like the following: [ 34.559694] # pm_runtime_error_test: EXPECTATION FAILED at drivers/base/power/runtime-test.c:177 [ 34.559694] Expected 1 == pm_runtime_barrier(dev), but [ 34.559694] pm_runtime_barrier(dev) == 0 (0x0) [ 34.563604] # pm_runtime_error_test: pass:0 fail:1 skip:0 total:1 Reported-by: Guenter Roeck <linux@roeck-us.net> Closes: https://lore.kernel.org/lkml/93259f2b-7017-4096-a31b-cabbf6152e9b@roeck-us.net/ Signed-off-by: Brian Norris <briannorris@chromium.org> Tested-by: Guenter Roeck <linux@roeck-us.net> Link: https://patch.msgid.link/20251202193129.1411419-1-briannorris@chromium.org Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent d348c22 commit 3df2470

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

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. */

0 commit comments

Comments
 (0)