Re: [LTP] [PATCH 1/1] doc/ground_rules: Add Kernel features check rules

Petr Vorel
2026-01-28T20:51:14Z

> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Based on a discussion various discussions:
> https://lore.kernel.org/ltp/20260123122545.GA122331@pevik/
> https://lore.kernel.org/ltp/20260128072445.GB13495@pevik/

> Kind regards,
> Petr

> doc/developers/ground_rules.rst | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)

> diff --git a/doc/developers/ground_rules.rst b/doc/developers/ground_rules.rst
> index 05e473cad5..90fe7a64ee 100644
> --- a/doc/developers/ground_rules.rst
> +++ b/doc/developers/ground_rules.rst
> @@ -174,3 +174,20 @@ These patches should also add a [STAGING] keyword into the patch subject, e.g.
> In a case that a test for unreleased kernel is really needed to be merged we do
> not add it to the list of test executed by default and keep it in
> :master:`runtest/staging` file until the kernel code is finalized.
> +
> +Kernel features check
> +---------------------
> +
> +We prefer to use :c:type:`.needs_kconfigs <tst_test>` (kernel kconfig check).
> +But do *not* use it when there is another way to detect the functionality (e.g.
> +via detecting functionality via ``/proc|sys``) *and* any of these rules applies:
> +
> +- Kernel allows to disable functionality via `kernel’s command-line parameter
> + <https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html>`_
> + (it can be disabled in runtime).
> +- It's a check for a functionality which can be compiled as module
> + (`tristate
> + <https://docs.kernel.org/kbuild/kconfig-language.html#menu-attributes>`_,
> + modul might not be available).
> +- New kernel functionality which is unlikely to be backported (use
> + :c:type:`.min_kver <tst_test>` instead).

I wonder how about .needs_kconfigs vs. needs_drivers. Do we prefer any of these?
I suppose the rule could be .needs_drivers when nothing specific from module is
needed, .needs_kconfigs otherwise.