[igt-dev] [PATCH i-g-t 2/4] lib/igt_sysfs: Don't assert in igt_sysfs_dir_id_to_name

Dixit, Ashutosh ashutosh.dixit at intel.com
Tue Jun 6 01:27:17 UTC 2023


On Mon, 05 Jun 2023 18:21:48 -0700, Ashutosh Dixit wrote:
>
> Old platforms (BLB/ELK) don't have any freq attributes even in legacy
> per-device sysfs. Asserting for this platforms shows up as a CI
> regression.

This can be seen in CI results here:

https://patchwork.freedesktop.org/series/118809/#rev6
https://intel-gfx-ci.01.org/tree/drm-tip/TrybotIGT_769/fi-blb-e6850/igt@gem_ctx_freq@sysfs.html
https://intel-gfx-ci.01.org/tree/drm-tip/TrybotIGT_769/fi-elk-e7500/igt@gem_ctx_freq@sysfs.html

> So don't assert, just return the device level attribute and let file open
> on the non-existent attribute fail to preserve previous behavior.
>
> Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
> ---
>  lib/igt_sysfs.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
> index 8021ba9cbb2e..35a4faa9aab5 100644
> --- a/lib/igt_sysfs.c
> +++ b/lib/igt_sysfs.c
> @@ -115,10 +115,8 @@ const char *igt_sysfs_dir_id_to_name(int dir, enum i915_attr_id id)
>
>	if (igt_sysfs_has_attr(dir, i915_attr_name[RPS][id]))
>		return i915_attr_name[RPS][id];
> -	if (igt_sysfs_has_attr(dir, i915_attr_name[GT][id]))
> -		return i915_attr_name[GT][id];
>
> -	igt_assert_f(0, "attr_id not found %d\n", id);
> +	return i915_attr_name[GT][id];
>  }
>
>  /**
> --
> 2.38.0
>


More information about the igt-dev mailing list