public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: Linux 6.18
Date: Mon, 1 Dec 2025 20:50:17 -0800	[thread overview]
Message-ID: <aS5wCcwpgkS9n67u@google.com> (raw)
In-Reply-To: <93259f2b-7017-4096-a31b-cabbf6152e9b@roeck-us.net>

On Mon, Dec 01, 2025 at 06:39:49PM -0800, Guenter Roeck wrote:
> On Sun, Nov 30, 2025 at 03:59:17PM -0800, Linus Torvalds wrote:
> ...
> > Anyway, *today* the important kernel is the newly minted 6.18 release.
> > Please do keep testing,
> > 
> 
> Build results:
> 	total: 158 pass: 158 fail: 0
> Qemu test results:
> 	total: 610 pass: 610 fail: 0
> Unit test results:
> 	pass: 666778 fail: 113
> 
> In terms of testing, that is worse that it sounds. I enabled
> CONFIG_PM_RUNTIME_KUNIT_TEST last week, and it results in widespread
> test failures. Picking one (from x86_64):
> 
> [   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
> 
> Looks like that fails pretty much on every architecture/platform where
> it is enabled. Copying the author (Brian) for feedback.

I wonder how you manage to be the one who hits all these problems,
because none of the configurations and environments generated by
./tools/testing/kunit/kunit.py seem to hit it naturally. (I tested
hundreds of cycles in various configurations with no failures
previously, and I still didn't reproduce it today.) Do you make special
effort to direct cosmic rays into your test setups while holding an
unlucky charm? :)

But since you pointed out the failure, I *can* induce the failure by
forcing some scheduling delay.

--- a/drivers/base/power/runtime-test.c
+++ b/drivers/base/power/runtime-test.c
@@ -3,6 +3,7 @@
  * Copyright 2025 Google, Inc.
  */
 
+#include <linux/delay.h>
 #include <linux/cleanup.h>
 #include <linux/pm_runtime.h>
 #include <kunit/device.h>
@@ -174,6 +175,7 @@ static void pm_runtime_error_test(struct kunit *test)
 	KUNIT_EXPECT_TRUE(test, pm_runtime_suspended(dev));
 
 	KUNIT_EXPECT_EQ(test, 0, pm_runtime_get(dev));
+	msleep(1000);
 	KUNIT_EXPECT_EQ(test, 1, pm_runtime_barrier(dev)); /* resume was pending */
 	pm_runtime_put(dev);
 	pm_runtime_suspend(dev); /* flush the put(), to suspend */

Looking closer at this part of the API, I think checking the return code
of pm_runtime_barrier() is a bad idea, since it's inherently racy, and
there's really no way to control that race. On the plus side, this test
is the only one that does it. So I can probably just go ahead and make
pm_runtime_barrier() a void function, and stop pretending it's part of
the API surface. One fewer weird part of the runtime PM API to think
about...

Maybe I can get around to that tomorrow.

Also CC Rafael while I'm at it.

Thanks for reporting,
Brian

  reply	other threads:[~2025-12-02  4:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-30 23:59 Linux 6.18 Linus Torvalds
2025-12-02  2:39 ` Guenter Roeck
2025-12-02  4:50   ` Brian Norris [this message]
2025-12-02  6:01     ` Guenter Roeck
2025-12-02 20:38       ` Brian Norris
2025-12-02 14:37     ` Wysocki, Rafael J
2025-12-02 19:36       ` Brian Norris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aS5wCcwpgkS9n67u@google.com \
    --to=briannorris@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=rafael.j.wysocki@intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox