[PATCH v2] tests/intel: Enhance the wedged_mode sysfs support
Kamil Konieczny
kamil.konieczny at linux.intel.com
Fri Jan 10 11:33:11 UTC 2025
Hi Pravalika,
On 2025-01-08 at 11:58:26 +0530, Pravalika Gurram wrote:
> 1. Added support to read the wedged_mode sysfs
> 2. Handle the -ETIMEDOUT return value during
> forcewake_all sysfs open
How is testing forcewake related to wedged? imho this should be
separate patch, see also below.
>
> Signed-off-by: Pravalika Gurram <pravalika.gurram at intel.com>
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt at intel.com>
> ---
> tests/intel/xe_debugfs.c | 2 +-
> tests/intel/xe_wedged.c | 12 ++++++++++++
> 2 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tests/intel/xe_debugfs.c b/tests/intel/xe_debugfs.c
> index bcbb5036a..3a83868ba 100644
> --- a/tests/intel/xe_debugfs.c
> +++ b/tests/intel/xe_debugfs.c
> @@ -268,7 +268,7 @@ test_forcewake(int fd)
> {
> int handle = igt_debugfs_open(fd, "forcewake_all", O_WRONLY);
>
> - igt_assert_neq(handle, -1);
> + igt_assert_lte(0, handle);
Please drop this change, that function return -1 in case of error,
if you have a report that it is not please send this in separate
patch.
> close(handle);
> }
>
> diff --git a/tests/intel/xe_wedged.c b/tests/intel/xe_wedged.c
> index 613d571b4..844ab2809 100644
> --- a/tests/intel/xe_wedged.c
> +++ b/tests/intel/xe_wedged.c
> @@ -203,11 +203,16 @@ simple_hang(int fd, struct drm_xe_sync *sync)
> * SUBTEST: wedged-mode-toggle
> * Description: Test wedged.mode=1 after testing wedged.mode=2
> */
> +/**
> + * SUBTEST: basic-wedged-read
> + * Description: Read wedged debugfs
> + */
> igt_main
> {
> struct drm_xe_engine_class_instance *hwe;
> int fd;
> char pci_slot[NAME_MAX];
> + char str[150];
>
> igt_fixture {
> fd = drm_open_driver(DRIVER_XE);
> @@ -279,6 +284,13 @@ igt_main
> igt_assert_eq(simple_ioctl(fd), 0);
> }
>
> + igt_subtest_f("basic-wedged-read") {
> + igt_require(igt_debugfs_exists(fd, "wedged_mode", O_RDONLY));
> +
> + igt_debugfs_read(fd, "wedged_mode", str);
> + igt_assert_f(str[0] != '\0', "Failed to read wedged_mode from debugfs!\n");
Is this correct? Why not using
ret = igt_debugfs_read(fd, "wedged_mode", str);
and assert on ret <= 0
Regards,
Kamil
> + }
> +
> igt_fixture {
> if (igt_debugfs_exists(fd, "fail_gt_reset/probability", O_RDWR)) {
> igt_debugfs_write(fd, "fail_gt_reset/probability", "0");
> --
> 2.34.1
>
More information about the igt-dev
mailing list