From: Matt Roper <matthew.d.roper@intel.com>
To: <janga.rahul.kumar@intel.com>
Cc: <igt-dev@lists.freedesktop.org>, <ramadevi.gandi@intel.com>
Subject: Re: [PATCH i-g-t 2/2] tests/intel/xe_pm: Add mocs suspend resume test
Date: Fri, 22 Mar 2024 14:25:18 -0700 [thread overview]
Message-ID: <20240322212518.GV718896@mdroper-desk1.amr.corp.intel.com> (raw)
In-Reply-To: <20240321151637.3320911-3-janga.rahul.kumar@intel.com>
On Thu, Mar 21, 2024 at 08:46:37PM +0530, janga.rahul.kumar@intel.com wrote:
> From: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
>
> Add test to check mocs values are retained over suspend/resume.
>
> Cc: Matt Roper <matthew.d.roper@intel.com>
> Signed-off-by: Janga Rahul Kumar <janga.rahul.kumar@intel.com>
> ---
> tests/intel/xe_pm.c | 43 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/tests/intel/xe_pm.c b/tests/intel/xe_pm.c
> index fcbed6249..0761d59c4 100644
> --- a/tests/intel/xe_pm.c
> +++ b/tests/intel/xe_pm.c
> @@ -560,6 +560,45 @@ static void test_mmap(device_t device, uint32_t placement, uint32_t flags)
> close(fw_handle);
> }
>
> +/**
> + * SUBTEST: mocs_suspend_resume
> + * Description:
> + * Validate mocs register contents over suspend resume
> + *
> + * Functionality: mocs
> + * Run type: FULL
> + */
> +static void test_mocs_suspend_resume(device_t device)
> +{
> + int gt;
> +
> + xe_for_each_gt(device.fd_xe, gt) {
> + char path[256];
> +
> + // Mocs debugfs contents before and after suspend-resume
> + char mocs_content_pre[4096], mocs_contents_post[4096];
> +
> + sprintf(path, "gt%d/mocs", gt);
> + igt_assert(igt_debugfs_exists(device.fd_xe, path, O_RDONLY));
> + igt_debugfs_dump(device.fd_xe, path);
> + igt_debugfs_read(device.fd_xe, path, mocs_content_pre);
> +
> + fw_handle = igt_debugfs_open(device.fd_xe, "forcewake_all", O_RDONLY);
> + igt_assert(fw_handle >= 0);
> + igt_assert(igt_get_runtime_pm_status() == IGT_RUNTIME_PM_STATUS_ACTIVE);
> +
> + /* Runtime suspend */
> + close(fw_handle);
> + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
> +
> + igt_assert(igt_debugfs_exists(device.fd_xe, path, O_RDONLY));
> + igt_debugfs_dump(device.fd_xe, path);
> + igt_debugfs_read(device.fd_xe, path, mocs_contents_post);
> +
> + igt_assert(strcmp(mocs_content_pre, mocs_contents_post) == 0);
> + }
> +}
Assuming xe_pm has already ensured that anything else that might have
blocked runtime PM is out of the way, looks good to me. But should we
also test S3 and S4 as well rather than just runtime suspend? Those
follow different driver flows, and it's possible a driver bug could
cause of to fail to reprogram MOCS on an S3/S4 resume, even though
runtime PM resume works okay.
It would also be good to extend this same pattern to other kinds of
non-PM MOCS tests as well. E.g., for reset IGTs it would be valuable to
have subtests like:
a = capture
trigger engine hang & reset
b = capture
fail if a != b
and
a = capture
trigger full GT reset
b = capture
fail if a != b
Matt
> +
> igt_main
> {
> struct drm_xe_engine_class_instance *hwe;
> @@ -701,6 +740,10 @@ igt_main
> dpms_on_off(device, DRM_MODE_DPMS_ON);
> igt_pm_set_autosuspend_delay(device.pci_xe, delay_ms);
> }
> +
> + igt_subtest("mocs_suspend_resume")
> + test_mocs_suspend_resume(device);
> +
> }
>
> igt_fixture {
> --
> 2.25.1
>
--
Matt Roper
Graphics Software Engineer
Linux GPU Platform Enablement
Intel Corporation
next prev parent reply other threads:[~2024-03-22 21:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 15:16 [PATCH i-g-t 0/2] Add mocs tests janga.rahul.kumar
2024-03-21 15:16 ` [PATCH i-g-t 1/2] tests/intel/xe_debugfs: Extend gt test to check mocs entry janga.rahul.kumar
2024-03-22 21:18 ` Matt Roper
2024-04-24 20:19 ` Kumar, Janga Rahul
2024-03-21 15:16 ` [PATCH i-g-t 2/2] tests/intel/xe_pm: Add mocs suspend resume test janga.rahul.kumar
2024-03-22 21:25 ` Matt Roper [this message]
2024-04-24 20:21 ` Kumar, Janga Rahul
2024-03-21 17:12 ` ✓ Fi.CI.BAT: success for Add mocs tests Patchwork
2024-03-21 17:22 ` ✗ CI.xeBAT: failure " Patchwork
2024-03-22 8:42 ` ✗ Fi.CI.IGT: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240322212518.GV718896@mdroper-desk1.amr.corp.intel.com \
--to=matthew.d.roper@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=janga.rahul.kumar@intel.com \
--cc=ramadevi.gandi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox