All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tim Michals" <tcmichals@gmail.com>
Cc: linux-sunxi@lists.linux.dev, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v3 7/7] remoteproc: sunxi: Add KUnit tests
Date: Sun, 01 Nov 2026 19:13:03 +0000	[thread overview]
Message-ID: <sashiko-outbox-192578@kernel.org> (raw)
In-Reply-To: <20261101185735.762559-8-tcmichals@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] remoteproc: sunxi: missing CONFIG_PM dependency in KUnit test
- [Low] remoteproc: sunxi: missing __force on __iomem casts in use_mmio_mocks()
--

commit 9db9877d3095c9678cf19b6cc5cf48fbc1c0e95d
Author: Tim Michals <tcmichals@gmail.com>

remoteproc: sunxi: Add KUnit tests

This commit adds 26 KUnit tests for the Allwinner sunxi remoteproc driver,
covering address translation, lifecycle callbacks, crash handling, firmware
parsing, and mailbox notifications using KUnit static stubs and mock
providers.

> diff --git a/drivers/remoteproc/Kconfig b/drivers/remoteproc/Kconfig
> index d2929a3290c3f..6516e272689e4 100644
> --- a/drivers/remoteproc/Kconfig
> +++ b/drivers/remoteproc/Kconfig
> @@ -348,6 +348,21 @@ config SUNXI_REMOTEPROC
>  	  To compile this driver as a module, choose M here: the module will
>  	  be called sunxi_rproc.
>  
> +config SUNXI_REMOTEPROC_KUNIT_TEST
> +	tristate "KUnit tests for Allwinner sunxi remoteproc" if !KUNIT_ALL_TESTS
> +	depends on SUNXI_REMOTEPROC && KUNIT && COMMON_CLK && RESET_CONTROLLER
> +	default KUNIT_ALL_TESTS

[Severity: Medium]
Should SUNXI_REMOTEPROC_KUNIT_TEST also depend on PM?

In include/linux/pm.h, the usage_count member of struct dev_pm_info is only
defined when CONFIG_PM is enabled:

    #ifdef CONFIG_PM
        ...
        atomic_t        usage_count;

When CONFIG_PM is disabled, expect_powered_off(),
test_prepare_unprepare_order(), and test_prepare_power_up_failure() in
drivers/remoteproc/sunxi_rproc_kunit.c fail to compile because they read
dev->power.usage_count unconditionally.

In addition, test_prepare_power_up_failure() relies on dev_pm_domain_set()
and pm_runtime_enable() so that sunxi_rproc_prepare() ->
pm_runtime_resume_and_get() invokes mock_failing_pm_domain.ops.runtime_resume
and returns -EIO. When CONFIG_PM is disabled, those helpers are no-op stubs
and pm_runtime_resume_and_get() returns 0 instead of -EIO.

[ ... ]

> diff --git a/drivers/remoteproc/sunxi_rproc_kunit.c b/drivers/remoteproc/sunxi_rproc_kunit.c
> new file mode 100644
> index 0000000000000..0931564dc22bb
> --- /dev/null
> +++ b/drivers/remoteproc/sunxi_rproc_kunit.c

[ ... ]

> +static void use_mmio_mocks(struct test_context *ctx)
> +{
> +	ctx->priv.cfg_va = (void __iomem *)ctx->mock_cfg_regs;
> +	ctx->priv.remap_va = (void __iomem *)&ctx->mock_remap_reg;
> +	ctx->priv.sram0_va = (void __iomem *)ctx->mock_sram_buf;
> +	ctx->priv.sram0_size = sizeof(ctx->mock_sram_buf);
> +	ctx->priv.sram1_va = (void __iomem *)ctx->mock_sram1_buf;
> +	ctx->priv.sram1_size = sizeof(ctx->mock_sram1_buf);
> +}

[Severity: Low]
Unlike FAKE_SRAM_VA and FAKE_SRAM1_VA, which use (void __force __iomem *),
the casts in use_mmio_mocks() omit __force when casting normal kernel
memory buffers to __iomem pointers. Should these casts use
(void __force __iomem *) to avoid Sparse address-space warnings when
building with C=1?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261101185735.762559-1-tcmichals@gmail.com?part=7

      reply	other threads:[~2026-11-01 19:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-01 18:57 [PATCH v3 0/7] Add Allwinner A523 message box and XuanTie E906 remoteproc support Tim Michals
2026-11-01 18:57 ` [PATCH v3 1/7] dt-bindings: mailbox: Add Allwinner A523 message box Tim Michals
2026-11-01 19:06   ` sashiko-bot
2026-11-02 10:17   ` Krzysztof Kozlowski
2026-11-01 18:57 ` [PATCH v3 2/7] mailbox: sun55i: Add Allwinner A523 message box driver Tim Michals
2026-11-01 19:17   ` sashiko-bot
2026-11-01 18:57 ` [PATCH v3 3/7] dt-bindings: remoteproc: Add Allwinner A523 RISC-V remote processor Tim Michals
2026-11-02 10:19   ` Krzysztof Kozlowski
2026-11-01 18:57 ` [PATCH v3 4/7] remoteproc: sunxi: Add Allwinner A523 XuanTie E906 driver Tim Michals
2026-11-01 19:24   ` sashiko-bot
2026-11-01 18:57 ` [PATCH v3 5/7] arm64: dts: allwinner: a523: Add message box and remoteproc nodes Tim Michals
2026-11-01 18:57 ` [PATCH v3 6/7] mailbox: sun55i: Add KUnit tests Tim Michals
2026-11-01 18:57 ` [PATCH v3 7/7] remoteproc: sunxi: " Tim Michals
2026-11-01 19:13   ` sashiko-bot [this message]

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=sashiko-outbox-192578@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=tcmichals@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.