Skip to content

Commit e260522

Browse files
jasonbuxiaoxiang781216
authored andcommitted
testing/pm_smp: delay_yield ticks 1->2, avoid idle canot run one cycle
Signed-off-by: buxiasen <buxiasen@xiaomi.com>
1 parent 93a431d commit e260522

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testing/drivertest/drivertest_pm_smp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,16 @@ static void test_pm_callback_notify(FAR struct pm_callback_s *cb,
176176

177177
static void test_pm_smp_yield(void)
178178
{
179-
usleep(USEC_PER_TICK);
179+
/* two ticks to avoid very quick jump out and idle cannot run one cycle */
180+
181+
usleep(USEC_PER_TICK * 2);
180182
}
181183
#endif
182184

183185
static void test_pm_smp_naps(void)
184186
{
185187
int r = random() % (TEST_SNAP_TICK_MAX * USEC_PER_TICK);
186-
usleep(r + USEC_PER_TICK);
188+
usleep(r + USEC_PER_TICK * 2);
187189
}
188190

189191
static void *test_pm_smp_thread_entry(void *arg)

0 commit comments

Comments
 (0)