RTC time may be overwritten by remote time sync service during
the test. Add 5-retry loop and pass if at least 3 attempts succeed.
Signed-off-by: v-liuchenxu3 <v-liuchenxu3@xiaomi.com>
../../apps/testing/drivers/drivertest/drivertest_i2c_spi.c:119:13: error: implicit declaration of function 'read'; did you mean 'fread'? [-Werror=implicit-function-declaration]
119 | ret = read(fd, &data, sizeof(struct accel_gyro_st_s));
| ^~~~
| fread
../../apps/testing/drivers/drivertest/drivertest_i2c_spi.c: In function 'cmocka_driver_i2c_spi_main':
../../apps/testing/drivers/drivertest/drivertest_i2c_spi.c:148:16: error: implicit declaration of function 'getopt' [-Werror=implicit-function-declaration]
148 | while ((ch = getopt(argc, argv, "d:h")) != ERROR)
| ^~~~~~
../../apps/testing/drivers/drivertest/drivertest_i2c_spi.c:154:22: error: 'optarg' undeclared (first use in this function)
154 | optarg);
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
struct cpufreq_qos will be replace as qos_request_s, struct cpufreq_frequency_table will be replace as uint32_t *freq_table.
cpufreq framework has already implemented by devfreq, so replace to devfreq struct.
Signed-off-by: guanyi3 <guanyi3@xiaomi.com>
CID 278442: (#15 of 15): Operands do not affect result (CONSTANT_EXPRESSION_RESULT)
result_independent_of_operands: converted > 2147483647 is always false, regardless of the value of its operands. It is used as the second logical operand of "||".
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
On QEMU, if vcpus are preempted by other threads, the deviation of the
timer might be very large, causing assertion failure. This commit
addressed the problem.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
nand_sim_main.c:87:28: warning: implicit declaration of function 'kmm_zalloc'; did you mean 'lib_zalloc'? [-Wimplicit-function-declaration]
87 | g_nand_sim_mtd_wrapper = kmm_zalloc(sizeof(struct nand_wrapper_dev_s));
| ^~~~~~~~~~
| lib_zalloc
nand_sim_main.c:87:26: warning: assignment to 'struct mtd_dev_s *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
87 | g_nand_sim_mtd_wrapper = kmm_zalloc(sizeof(struct nand_wrapper_dev_s));
| ^
nand_sim_main.c: In function 'terminate':
nand_sim_main.c:122:3: warning: implicit declaration of function 'kmm_free' [-Wimplicit-function-declaration]
122 | kmm_free(g_nand_sim_mtd_under);
| ^~~~~~~~
nand_sim_main.c: In function 'nand_main':
nand_sim_main.c:144:9: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
144 | pid = fork();
| ^~~~
nand_sim_main.c:151:7: warning: implicit declaration of function 'daemon' [-Wimplicit-function-declaration]
151 | if (daemon(0, 1) == -1)
| ^~~~~~
nand_sim_main.c:165:18: warning: assignment to 'struct nand_raw_s *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
165 | g_nand_mtd_raw = kmm_zalloc(sizeof(struct nand_raw_s));
| ^
nand_sim_main.c:203:7: warning: implicit declaration of function 'sleep' [-Wimplicit-function-declaration]
203 | sleep(1);
| ^~~~~
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
testcase for feature "add priority for PM callbcak"
pm callback is called in sequence order when resume and in reverse order when suspend
1. in default priority
(i) register order: parent, child
(ii) suspend order: child, parent
(iii) resume order: parent, child
2. if child has higher priority
(i) register order: child, parent
(ii) suspend order: parent, child
(iii) resume order: child, parent
Signed-off-by: guanyi <guanyi@xiaomi.com>
When we support the watchdog interrupt on the Armv7-A platform with
the TEE enabled, the watchdog interrupt needs to be configured as
a FIQ to avoid the impact of interrupt disabling in the AP.
In this case, the drivertest_watchdog_api testcase cannot pass the
test in such a scenario.
This is because the drivertest_watchdog_api itself requires
calling a specified callback after the watchdog interrupt is
triggered, instead of directly dumping the AP's context and
then asserting the system.
Therefore, when both CONFIG_ARCH_ARMV7A and CONFIG_ARCH_HAVE_TRUSTZONE
are enabled, we need to skip the current drivertest_watchdog_api
testcase.
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
Remove enter/leave_critical_section, and use up_irq_save to clarify code logic and improve multi-core performance.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
Because the purpose of using enter_critical_section function in watchdog is to disable interrupts rather than to synchronize information between multiple cores, it is replaced by up_irq_save.
Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
In SMP, pm staycount of SYSTEM domain may be modified asynchronously by other cores during testcase, staycount sometimes is not equal to expectation.
BTW, the delay threshold of stability governor should be set carefully, too large or too small will affect the PM state and cause testcase to fail.
Signed-off-by: guanyi <guanyi@xiaomi.com>