[PATCH i-g-t] tests/intel/xe_mmap: Acquire rpm reference for pci-membarrier-paraller test
Matthew Auld
matthew.auld at intel.com
Fri May 16 08:39:07 UTC 2025
On 16/05/2025 06:24, Kolanupaka Naveena wrote:
> During the test, the device is entering into runtime suspend, which is
> leading the device to d3hot or d3cold mode. Hence the read is giving
> a special value 0xffffffff.
>
> To avoid this issue acquired an rpm ref to keep the device awake
> during the access.
>
> Suggested-by: Matthew Auld <matthew.auld at intel.com>
> Signed-off-by: Kolanupaka Naveena <kolanupaka.naveena at intel.com>
> ---
> tests/intel/xe_mmap.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tests/intel/xe_mmap.c b/tests/intel/xe_mmap.c
> index 5fd641075..51c27586f 100644
> --- a/tests/intel/xe_mmap.c
> +++ b/tests/intel/xe_mmap.c
> @@ -11,6 +11,8 @@
> * Functionality: mmap
> */
>
> +#include <fcntl.h>
> +
> #include "igt.h"
>
> #include "xe_drm.h"
> @@ -428,16 +430,20 @@ igt_main
> int xe;
> unsigned int i;
> uint32_t *ptr;
> + int fw_handle = -1;
>
> igt_require(is_pci_membarrier_supported(fd));
> xe = drm_open_driver(DRIVER_XE);
> srand(time(0));
> i = rand() % (PAGE_SIZE / sizeof(*ptr));
> + fw_handle = igt_debugfs_open(fd, "forcewake_all", O_RDONLY);
Probably this needs to be done for all membarrier related tests? It
might just be in the timing that we have only seen it here.
> + igt_assert_lte(0, fw_handle);
> igt_fork(child, 1)
> test_pci_membarrier_parallel(xe, child, i);
> test_pci_membarrier_parallel(fd, -1, i);
> igt_waitchildren();
>
> + close(fw_handle);
> close(xe);
> }
>
More information about the igt-dev
mailing list