[PATCH igt 2/9] drm/recovery: add iova-fault-stress test

Kamil Konieczny kamil.konieczny at linux.intel.com
Tue Jul 1 16:09:11 UTC 2025


Hi Rob,
On 2025-06-30 at 11:08:56 -0700, Rob Clark wrote:
> From: Rob Clark <robdclark at chromium.org>

This 'From: ' do no match your s-o-b below, please fix it.

Please run checkpatch.pl from Linux kernel on your patches.
Few helpfull options could be found in CONTRIBUTING.md

Also improve subject to:
[PATCH igt 2/9] tests/msm/msm_recovery: add iova-fault-stress test

> 
> Add a test which triggers many faults to test robustness.
> 
> Signed-off-by: Rob Clark <rob.clark at oss.qualcomm.com>
> ---
>  tests/msm/msm_recovery.c | 31 +++++++++++++++++++++++--------
>  1 file changed, 23 insertions(+), 8 deletions(-)
> 
> diff --git a/tests/msm/msm_recovery.c b/tests/msm/msm_recovery.c
> index 433392079bd4..8a83a6f24c41 100644
> --- a/tests/msm/msm_recovery.c
> +++ b/tests/msm/msm_recovery.c
> @@ -195,6 +195,23 @@ do_parallel_test(struct msm_pipe *pipe, int child)
>  	igt_msm_cmd_free(cmd);
>  }
>  
> +static void
> +do_fault_test(struct msm_pipe *pipe, bool stress)
> +{
> +	struct msm_cmd *cmd =
> +		igt_msm_cmd_new(pipe, 0x10000);

Why not in one line? Imho this is better:

	struct msm_cmd *cmd = igt_msm_cmd_new(pipe, 0x10000);

> +	unsigned cnt = stress ? 0x10000/16 : 1;

Use 'unsigned int' here, also

Place space around '/', also make 0x10000 a const or define it.

For example:
	const unsigned int f_cnt = 0x10000;
	struct msm_cmd *cmd = igt_msm_cmd_new(pipe, f_cnt);
	unsigned int cnt = stress ? f_cnt / 16 : 1;

> +
> +	for (unsigned i = 0; i < cnt; i++) {

Use 'unsigned int' here:

	for (unsigned int i = 0; i < cnt; i++) {

Regards,
Kamil

> +		msm_cmd_pkt7(cmd, CP_MEM_WRITE, 3);
> +		msm_cmd_emit(cmd, 0xdeaddead);           /* ADDR_LO */
> +		msm_cmd_emit(cmd, 0x1);                  /* ADDR_HI */
> +		msm_cmd_emit(cmd, 0x123);                /* VAL */
> +	}
> +
> +	igt_wait_and_close(igt_msm_cmd_submit(cmd));
> +}
> +
>  /*
>   * Tests for drm/msm hangcheck, recovery, and fault handling
>   */
> @@ -242,18 +259,16 @@ igt_main
>  
>  	igt_describe("Test iova fault handling");
>  	igt_subtest("iova-fault") {
> -		struct msm_cmd *cmd;
> -
>  		igt_require(dev->gen >= 6);
>  
> -		cmd = igt_msm_cmd_new(pipe, 0x1000);
> +		do_fault_test(pipe, false);
> +	}
>  
> -		msm_cmd_pkt7(cmd, CP_MEM_WRITE, 3);
> -		msm_cmd_emit(cmd, 0xdeaddead);           /* ADDR_LO */
> -		msm_cmd_emit(cmd, 0x1);                  /* ADDR_HI */
> -		msm_cmd_emit(cmd, 0x123);                /* VAL */
> +	igt_describe("Test iova fault handling (stress)");
> +	igt_subtest("iova-fault-stress") {
> +		igt_require(dev->gen >= 6);
>  
> -		igt_wait_and_close(igt_msm_cmd_submit(cmd));
> +		do_fault_test(pipe, true);
>  	}
>  
>  	igt_fixture {
> -- 
> 2.50.0
> 


More information about the igt-dev mailing list