diff mbox series

test: dm: restore /firmware nodes after testing

Message ID 20230608005559.39509-1-takahiro.akashi@linaro.org
State Accepted
Commit 230038f8ef0e2e7db8e40957a3b35109d8f7459f
Headers show
Series test: dm: restore /firmware nodes after testing | expand

Commit Message

AKASHI Takahiro June 8, 2023, 12:55 a.m. UTC
dm_test_restore() is called after dm unit test is run.
But this function does not scan any nodes under /firmware since
it calls dm_scan_fdt().

This causes an issue. For instance, scmi_sandbox_agent device
will disappear after running 'ut dm scmi_sandbox_agent'.

So call dm_extended_scan() instead. This change will be coherent
with what dm_scan() and test_pre_run() does.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
---
 test/test-main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass June 12, 2023, 9:17 p.m. UTC | #1
On Thu, 8 Jun 2023 at 01:56, AKASHI Takahiro <takahiro.akashi@linaro.org> wrote:
>
> dm_test_restore() is called after dm unit test is run.
> But this function does not scan any nodes under /firmware since
> it calls dm_scan_fdt().
>
> This causes an issue. For instance, scmi_sandbox_agent device
> will disappear after running 'ut dm scmi_sandbox_agent'.
>
> So call dm_extended_scan() instead. This change will be coherent
> with what dm_scan() and test_pre_run() does.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> ---
>  test/test-main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>


> diff --git a/test/test-main.c b/test/test-main.c
> index b3c30d929376..2a3b2ba364a8 100644
> --- a/test/test-main.c
> +++ b/test/test-main.c
> @@ -272,7 +272,7 @@ static int dm_test_restore(struct device_node *of_root)
>                 return ret;
>         dm_scan_plat(false);
>         if (!CONFIG_IS_ENABLED(OF_PLATDATA))
> -               dm_scan_fdt(false);
> +               dm_extended_scan(false);
>
>         return 0;
>  }
> --
> 2.41.0
>
Tom Rini June 21, 2023, 6:41 p.m. UTC | #2
On Thu, Jun 08, 2023 at 09:55:59AM +0900, AKASHI Takahiro wrote:

> dm_test_restore() is called after dm unit test is run.
> But this function does not scan any nodes under /firmware since
> it calls dm_scan_fdt().
> 
> This causes an issue. For instance, scmi_sandbox_agent device
> will disappear after running 'ut dm scmi_sandbox_agent'.
> 
> So call dm_extended_scan() instead. This change will be coherent
> with what dm_scan() and test_pre_run() does.
> 
> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> Reviewed-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/next, thanks!
diff mbox series

Patch

diff --git a/test/test-main.c b/test/test-main.c
index b3c30d929376..2a3b2ba364a8 100644
--- a/test/test-main.c
+++ b/test/test-main.c
@@ -272,7 +272,7 @@  static int dm_test_restore(struct device_node *of_root)
 		return ret;
 	dm_scan_plat(false);
 	if (!CONFIG_IS_ENABLED(OF_PLATDATA))
-		dm_scan_fdt(false);
+		dm_extended_scan(false);
 
 	return 0;
 }