[PATCH igt 6/9] msm/mapping: Wait for devcore to become available
Kamil Konieczny
kamil.konieczny at linux.intel.com
Tue Jul 1 16:20:14 UTC 2025
Hi Rob,
On 2025-06-30 at 11:09:00 -0700, Rob Clark wrote:
> From: Rob Clark <rob.clark at oss.qualcomm.com>
Is this the same as 1/9 patch?
One more nit just spotted, it is useally 'i-g-t' after PATCH:
[PATCH i-g-t 6/9] tests/msm/msm_mapping: Wait for devcore to become available
Regards,
Kamil
>
> The devcore could take some time to show up, so add a igt_wait() with
> timeout so we don't fail the test if the devcore is not immediately
> available.
>
> This addresses a source of flakeyness.
>
> Signed-off-by: Rob Clark <rob.clark at oss.qualcomm.com>
> ---
> tests/msm/msm_mapping.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/tests/msm/msm_mapping.c b/tests/msm/msm_mapping.c
> index 846385bb5206..03a9e814c931 100644
> --- a/tests/msm/msm_mapping.c
> +++ b/tests/msm/msm_mapping.c
> @@ -42,14 +42,18 @@
> */
>
> static char *
> -get_and_clear_devcore(void)
> +get_and_clear_devcore(int timeout_ms)
> {
> glob_t glob_buf = {0};
> char *buf = NULL;
> - int ret, fd;
> + int fd;
>
> - ret = glob("/sys/class/devcoredump/devcd*/data", GLOB_NOSORT, NULL, &glob_buf);
> - if ((ret == GLOB_NOMATCH) || !glob_buf.gl_pathc)
> + /* The devcore shows up asynchronously, so it might not be
> + * immediately available:
> + */
> + if (!igt_wait(glob("/sys/class/devcoredump/devcd*/data",
> + GLOB_NOSORT, NULL, &glob_buf) != GLOB_NOMATCH,
> + timeout_ms, 100))
> return NULL;
>
> fd = open(glob_buf.gl_pathv[0], O_RDWR);
> @@ -175,7 +179,7 @@ do_mapping_test(struct msm_pipe *pipe, const char *buffername, bool write)
> int fence_fd, ret;
>
> /* Clear any existing devcore's: */
> - while ((devcore = get_and_clear_devcore())) {
> + while ((devcore = get_and_clear_devcore(0))) {
> free(devcore);
> }
>
> @@ -208,7 +212,7 @@ do_mapping_test(struct msm_pipe *pipe, const char *buffername, bool write)
> /* And now we should have gotten a devcore from the iova fault
> * triggered by the read or write:
> */
> - devcore = get_and_clear_devcore();
> + devcore = get_and_clear_devcore(1000);
> igt_fail_on(!devcore);
>
> /* Make sure the devcore is from iova fault: */
> --
> 2.50.0
>
More information about the igt-dev
mailing list