Re: [RFC PATCH 5/8] drivers: base: test: Add KUnit suite for staged sysfs registration

From: Andy Shevchenko

Date: Sat Sep 12 2026 - 09:23:53 EST


On Fri, Sep 11, 2026 at 07:43:37PM +0200, Pavol Sakac wrote:
> Add a staged_device KUnit suite under its own
> CONFIG_STAGED_DEVICE_KUNIT_TEST symbol exercising the staged mechanism.
> kobject_add() on a kobject with ->sd_staged builds the directory staged
> but does not publish it, since only device_add() does, so the tests
> drive the window directly: stage, then populate and observe, then
> sysfs_publish_dir(). The cases cover publication of plain, named-group
> and merged-group content, the failure modes of publication itself, abort
> without publication, foreign-thread access, concurrent windows including
> two that share one hashed staged mutex, glue-directory sharing, and
> bus-klist membership by the time device_add() returns. The suite also
> covers the KERNFS_STAGED_TOP/KERNFS_HAS_MMAP aliasing on a staged
> mmap-capable bin file.
>
> The publication-misuse cases intentionally trigger the publication
> guards' WARN backtraces, and the duplicate-name cases trigger
> sysfs_warn_dup() splats: those backtraces are expected output of a
> passing run, not failures. The suite is therefore unsuitable for
> runners that set panic_on_warn, which turns the first intentional splat
> into a panic, and does not follow KUNIT_ALL_TESTS: it runs only when its
> symbol is enabled explicitly.

...

> drivers/base/test/.kunitconfig | 1 +

Same question, why is this file got modified?

...

> +++ b/drivers/base/test/.kunitconfig
> @@ -1,3 +1,4 @@
> CONFIG_KUNIT=y
> CONFIG_DM_KUNIT_TEST=y
> CONFIG_GLUE_DIR_KUNIT_TEST=y
> +CONFIG_STAGED_DEVICE_KUNIT_TEST=y

It seems this series is based on some other series?

--
With Best Regards,
Andy Shevchenko