diff options
| author | Brian Norris <briannorris@chromium.org> | 2026-08-31 18:23:23 -0700 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-09-11 16:39:38 +0200 |
| commit | e7572e381d049daabc236f5a12c67adcaa117791 (patch) | |
| tree | 9391c453a034811a5edcd67d9d00311505bb2c21 /include/linux | |
| parent | be5755f023e7e02ec90bbd1d4ca63a0abe594733 (diff) | |
| download | linux-next-e7572e381d049daabc236f5a12c67adcaa117791.tar.gz linux-next-e7572e381d049daabc236f5a12c67adcaa117791.zip | |
PM: runtime: Add kunit test for supplier idle/suspend
Add a unit test that covers the bugfix/optimization in the previous
patch, "PM: runtime: Only queue an idle check for RPM-linked suppliers".
This test ensures:
1) device links with DL_FLAG_PM_RUNTIME can RPM-resume/suspend properly;
and
2) device links without DL_FLAG_PM_RUNTIME are not accidentally
resumed/suspended along with the consumer.
Notably, without patch 1 ("PM: runtime: Only queue an idle check for
RPM-linked suppliers"), the no-RPM supplier will fail 2 of its last 3
test expectations:
$ tools/testing/kunit/kunit.py run --kconfig_add CONFIG_PM=y 'pm_runtime*'
...
## Fails because rpm_suspend_suppliers() suspended the wrong links
[17:01:44] # pm_runtime_supplier_suspend_test: EXPECTATION FAILED at drivers/base/power/runtime-test.c:279
[17:01:44] Expected pm_runtime_active(norpm_supplier) to be true, but is false
## Fails because the no-RPM supplier is already suspended unexpectedly
[17:01:44] # pm_runtime_supplier_suspend_test: EXPECTATION FAILED at drivers/base/power/runtime-test.c:282
[17:01:44] Expected 0 == pm_runtime_suspend(norpm_supplier), but
[17:01:44] pm_runtime_suspend(norpm_supplier) == 1 (0x1)
...
Signed-off-by: Brian Norris <briannorris@chromium.org>
Link: https://patch.msgid.link/20260901013341.1417232-2-briannorris@chromium.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
