Hi Heinrich,

On 2026-10-12T14:00:39, Heinrich Schuchardt
<[email protected]> wrote:
> test: Probe RTC early in dm_test_host()
>
> The ext4 driver probes and reads the RTC which allocates memory.
>
> Ensure that the device is already probed and read once in dm_test_hook()

Typo: this should be dm_test_host()

Also, patch 5 adds the RTC read to ext4fs_write(), so dm_test_host()
fails from patch 5 until this one. Please can you move this patch
before patch 5 so the series stays bisectable? It is harmless on its
own.

> diff --git a/test/dm/host.c b/test/dm/host.c
> @@ -26,6 +27,18 @@ static int dm_test_host(struct unit_test_state *uts)
> +     if (CONFIG_IS_ENABLED(DM_RTC)) {
> +             struct rtc_time tm;
> +
> +             uclass_first_device(UCLASS_RTC, &dev);
> +             if (dev)
> +                     dm_rtc_get(dev, &tm);
> +     }

This test runs with UTF_SCAN_FDT, so the sandbox RTC from test.dts
should always be there. I suggest asserting rather than ignoring
errors:

    ut_assertok(uclass_first_device_err(UCLASS_RTC, &dev));
    ut_assertok(dm_rtc_get(dev, &tm));

Then a missing RTC or failed read shows up here, rather than as a
confusing memory-delta failure later. My understanding is that the
allocation on first read comes from sandbox_rtc probing the I2C
emulator lazily. It would help to say so in the comment, since it is
not obvious why reading would allocate memory.

> to avoid false positives.
>
> Signed-off-by: Heinrich Schuchardt <[email protected]>
>
> test/dm/host.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)

Regards,
Simon

Reply via email to