[PATCH i-g-t] tests/intel/xe_pm_residency: Skip on igt_power_open failure
Riana Tauro
riana.tauro at intel.com
Fri Oct 4 06:28:43 UTC 2024
Hi Jonathan
Do not skip the entire test, check the condition before assert or
for the power check.
Thanks,
Riana Tauro
On 10/1/2024 4:57 AM, Jonathan-Cavitt wrote:
> The xe_pm_residency at toggle-gt-c6 test fails when
> gt_c6_power >= gt_c0_power. These values are reported by
> igt_power_get_mW, which will always report 0 in the case that
> igt_power_open fails to open either the hwmon_fd or rapl.fd. Since the
> expected result will always be a failure in this case, skip the test to
> end execution early.
>
> Signed-off-by: Jonathan-Cavitt <jonathan.cavitt at intel.com>
> ---
> tests/intel/xe_pm_residency.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tests/intel/xe_pm_residency.c b/tests/intel/xe_pm_residency.c
> index 0e687558b1..36ed46cfc5 100644
> --- a/tests/intel/xe_pm_residency.c
> +++ b/tests/intel/xe_pm_residency.c
> @@ -276,7 +276,11 @@ static void toggle_gt_c6(int fd, int n)
> int gt;
> struct igt_power gpu;
>
> - igt_power_open(fd, &gpu, "gpu");
> + /*
> + * igt_power_get_mW will always return 0 if igt_power_open fails,
> + * so skip the test in this case.
> + */
> + igt_skip_on(igt_power_open(fd, &gpu, "gpu"));
>
> do {
> fw_handle = igt_debugfs_open(fd, "forcewake_all", O_RDONLY);
More information about the igt-dev
mailing list