From 1847b882a2ce6ecd413e23c649ca0c156e88c010 Mon Sep 17 00:00:00 2001 From: Hake Huang Date: Wed, 19 Mar 2025 16:40:54 +0800 Subject: [PATCH] tests: ztest: enable ztest_no_yield for all in PM if CONFIG_PM=y, board will enter low power, which will cause problem for debugger. So for ztest cases, we need enable this to avoid problem. This used to apply to soc/platform level, now remove them. Signed-off-by: Hake Huang --- boards/nxp/rd_rw612_bga/Kconfig.defconfig | 3 --- soc/nxp/imxrt/Kconfig.defconfig | 4 ---- soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig | 3 --- soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig | 3 --- soc/nxp/mcx/mcxn/Kconfig.defconfig | 3 --- subsys/testsuite/ztest/Kconfig | 1 + 6 files changed, 1 insertion(+), 16 deletions(-) diff --git a/boards/nxp/rd_rw612_bga/Kconfig.defconfig b/boards/nxp/rd_rw612_bga/Kconfig.defconfig index 8c67e5d41d5..a0a6022de03 100644 --- a/boards/nxp/rd_rw612_bga/Kconfig.defconfig +++ b/boards/nxp/rd_rw612_bga/Kconfig.defconfig @@ -37,7 +37,4 @@ config NET_L2_ETHERNET endif # DT_HAS_NXP_ENET_MAC_ENABLED && NETWORKING -config ZTEST_NO_YIELD - default y if (ZTEST && PM) - endif # BOARD_RD_RW612_BGA diff --git a/soc/nxp/imxrt/Kconfig.defconfig b/soc/nxp/imxrt/Kconfig.defconfig index 0ab3d3a1249..78469d24fee 100644 --- a/soc/nxp/imxrt/Kconfig.defconfig +++ b/soc/nxp/imxrt/Kconfig.defconfig @@ -35,10 +35,6 @@ config PM_MCUX_GPC default y if HAS_MCUX_GPC depends on SOC_SERIES_IMXRT11XX && PM -# Don't allow SOC to sleep after tests complete when PM is enabled -config ZTEST_NO_YIELD - default y if (ZTEST && PM) - if SOC_SERIES_IMXRT10XX && PM config CODE_DATA_RELOCATION diff --git a/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig index 0f91836ca52..63af825bacf 100644 --- a/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt5xx/Kconfig.defconfig @@ -17,9 +17,6 @@ config ROM_START_OFFSET config NUM_IRQS default 76 -config ZTEST_NO_YIELD - default y if (PM && ZTEST) - if MBEDTLS # # MBEDTLS CTR_DRBG code path needs extra stack space for initialization than diff --git a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig index b36ea66ad62..097c5c49cf1 100644 --- a/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig +++ b/soc/nxp/imxrt/imxrt6xx/Kconfig.defconfig @@ -35,9 +35,6 @@ config ROM_START_OFFSET config NUM_IRQS default 60 -config ZTEST_NO_YIELD - default y if (ZTEST && PM) - if MBEDTLS # # MBEDTLS CTR_DRBG code path needs extra stack space for initialization than diff --git a/soc/nxp/mcx/mcxn/Kconfig.defconfig b/soc/nxp/mcx/mcxn/Kconfig.defconfig index ff26cb05e0c..24ba2e4a2ec 100644 --- a/soc/nxp/mcx/mcxn/Kconfig.defconfig +++ b/soc/nxp/mcx/mcxn/Kconfig.defconfig @@ -15,9 +15,6 @@ config NUM_IRQS config ROM_START_OFFSET default 0x400 if BOOTLOADER_MCUBOOT -config ZTEST_NO_YIELD - default y if (PM && ZTEST) - config MCUX_LPTMR_TIMER default n if (DT_HAS_NXP_OS_TIMER_ENABLED || DT_HAS_ARM_ARMV8M_SYSTICK_ENABLED) diff --git a/subsys/testsuite/ztest/Kconfig b/subsys/testsuite/ztest/Kconfig index 02eb742dcf1..7bb723cb071 100644 --- a/subsys/testsuite/ztest/Kconfig +++ b/subsys/testsuite/ztest/Kconfig @@ -101,6 +101,7 @@ config ZTEST_ASSERT_HOOK config ZTEST_NO_YIELD bool "Do not yield to the idle thread after tests complete" + default y if PM help When the tests complete, do not yield to the idle thread and instead spin in a loop. This is useful for low power mode tests, where