[igt-dev] [PATCH] [i-g-t] tests/amdgpu/amd_hotplug: add delay after igt_system_suspend_autoresume

Wu, Hersen hersenxs.wu at amd.com
Mon Apr 24 19:02:04 UTC 2023


[AMD Official Use Only - General]

After igt_system_suspend_autoresume is executed, Linux kernel should be out of sleep mode.
By adding read power_state from /sys/class/drm/card0/device# cat power_state. Value is D0.
This is already checked by reading amdgpu adev->in_suspend, value is false.

Some other components may not finish process for resume.

When batch run test case below,

igt at amdgpu/amd_hotplug at basic-suspend
igt at amdgpu/amd_link_settings at link-training-configs
igt at amdgpu/amd_mem_leak at connector-suspend-resume


igt at amdgpu/amd_hotplug at basic-suspend is executed, but the rest two test case are skipped.

I do not find method to check if all SW components are out of resume processing. The delay 30 seconds is safe value based on experiments.
AMD IGT test list are executed 15 loops.

With delay 15 seconds, intermittent failure could still be captured.

Thanks!
Hersen







-----Original Message-----
From: Siqueira, Rodrigo <Rodrigo.Siqueira at amd.com> 
Sent: Monday, April 24, 2023 12:50 PM
To: Wu, Hersen <hersenxs.wu at amd.com>; igt-dev at lists.freedesktop.org; Pillai, Aurabindo <Aurabindo.Pillai at amd.com>; Hung, Alex <Alex.Hung at amd.com>; Mahfooz, Hamza <Hamza.Mahfooz at amd.com>
Subject: Re: [PATCH] [i-g-t] tests/amdgpu/amd_hotplug: add delay after igt_system_suspend_autoresume



On 4/24/23 07:48, Hersen Wu wrote:
> at call back of igt_system_suspend_autoresume, linux kernel resume 
> finish and in d0 state. but user mode components may not be fully out 
> of sleep mode. add delay wait for system stable before issuing 
> debugfs_hotplug_trigger.
> 
> Signed-off-by: Hersen Wu <hersenxs.wu at amd.com>
> ---
>   tests/amdgpu/amd_hotplug.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/tests/amdgpu/amd_hotplug.c b/tests/amdgpu/amd_hotplug.c 
> index 736040a2..1c946ff8 100644
> --- a/tests/amdgpu/amd_hotplug.c
> +++ b/tests/amdgpu/amd_hotplug.c
> @@ -133,6 +133,7 @@ static void test_hotplug_basic(data_t *data, bool suspend)
>   	if (suspend) {
>   		igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
>   					      SUSPEND_TEST_NONE);
> +		sleep(30);

Do we need to wait all of this time? If so, why?

>   	}
>   
>   	/* Trigger hotplug and confirm reference image is the same. */


More information about the igt-dev mailing list