From: Matthew Brost <matthew.brost@intel.com>
To: "Bernatowicz, Marcin" <marcin.bernatowicz@linux.intel.com>
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
<igt-dev@lists.freedesktop.org>,
Kamil Konieczny <kamil.konieczny@linux.intel.com>,
Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Subject: Re: [i-g-t V2 1/2] lib/drmtest: Ensure the XE driver is idle before starting a test
Date: Thu, 25 Jul 2024 16:35:16 +0000 [thread overview]
Message-ID: <ZqJ+xAgnWBCp0JLE@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <75f51358-3cba-41c3-92f2-dadf8eb33604@linux.intel.com>
On Thu, Jul 25, 2024 at 03:45:19PM +0200, Bernatowicz, Marcin wrote:
>
>
> On 7/25/2024 6:18 AM, Bhanuprakash Modem wrote:
> > Re-use the existing i915's exit handler to make sure that the
> > XE driver is idle before starting the subtest.
> >
> > V2:
> > - Add some delay after attempting the gt reset
> > - Cover drm render device path too
> >
> > Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/294
> > Cc: Matthew Brost <matthew.brost@intel.com>
> > Cc: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> > Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> > Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
> > ---
> > lib/drmtest.c | 24 +++++++++++++++---------
> > 1 file changed, 15 insertions(+), 9 deletions(-)
> >
> > diff --git a/lib/drmtest.c b/lib/drmtest.c
> > index f8810da43..90885ec36 100644
> > --- a/lib/drmtest.c
> > +++ b/lib/drmtest.c
> > @@ -64,6 +64,7 @@
> > #include "intel_reg.h"
> > #include "ioctl_wrappers.h"
> > #include "igt_dummyload.h"
> > +#include "xe/xe_gt.h"
> > #include "xe/xe_query.h"
> > /**
> > @@ -663,12 +664,17 @@ static void __cancel_work_at_exit(int fd)
> > {
> > igt_terminate_spins(); /* for older kernels */
> > - igt_params_set(fd, "reset", "%u", -1u /* any method */);
> > - igt_drop_caches_set(fd,
> > - /* cancel everything */
> > - DROP_RESET_ACTIVE | DROP_RESET_SEQNO |
> > - /* cleanup */
> > - DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED);
> > + if (is_xe_device(fd)) {
> > + xe_force_gt_reset_all(fd);
>
> It looks quite invasive, we will loose the guc log ?
>
> > + sleep(1);
>
> How the 1 is selected? Is it reliable enough ?
>
Definitely don't do this. Forcing a reset is not a great idea, sleeping
is a horrible idea as all tests are going to run way slower. I depend on
tests running fast to be able to quickly test my code.
The question is also way is required. A driver is built around process
isolation so if the GPU not being idle before the test causing issues it
means one of two things.
1. We have bug in the KMD
2. The test is very poorly written
Idling the GPU will simply paper over the above issues.
It is quite troubling that their are RBs on this too.
Matt
> > + } else {
> > + igt_params_set(fd, "reset", "%u", -1u /* any method */);
> > + igt_drop_caches_set(fd,
> > + /* cancel everything */
> > + DROP_RESET_ACTIVE | DROP_RESET_SEQNO |
> > + /* cleanup */
> > + DROP_ACTIVE | DROP_RETIRE | DROP_IDLE | DROP_FREED);
> > + }
> > }
> > static void cancel_work_at_exit(int sig)
> > @@ -716,11 +722,11 @@ int drm_open_driver(int chipset)
> > igt_skip_on_f(fd<0, "No known gpu found for chipset flags 0x%u (%s)\n",
> > chipset, chipset_to_str(chipset));
> > - /* For i915, at least, we ensure that the driver is idle before
> > + /* For i915 & xe, at least, we ensure that the driver is idle before
> > * starting a test and we install an exit handler to wait until
> > * idle before quitting.
> > */
> > - if (is_i915_device(fd)) {
> > + if (is_intel_device(fd)) {
> > if (__sync_fetch_and_add(&open_count, 1) == 0) {
> > __cancel_work_at_exit(fd);
> > at_exit_drm_fd = drm_reopen_driver(fd);
> > @@ -836,7 +842,7 @@ int drm_open_driver_render(int chipset)
> > return fd;
> > at_exit_drm_render_fd = drm_reopen_driver(fd);
> > - if (chipset & DRIVER_INTEL) {
> > + if (chipset & (DRIVER_INTEL | DRIVER_XE)) {
> > __cancel_work_at_exit(fd);
> > igt_install_exit_handler(cancel_work_at_exit_render);
> > }
next prev parent reply other threads:[~2024-07-25 16:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 7:05 [i-g-t 1/2] lib/drmtest: Ensure the XE driver is idle before starting a test Bhanuprakash Modem
2024-07-24 7:05 ` [i-g-t 2/2] HAX: Test rmfb tests in BAT Bhanuprakash Modem
2024-07-24 9:04 ` ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib/drmtest: Ensure the XE driver is idle before starting a test Patchwork
2024-07-24 9:10 ` ✗ CI.xeBAT: failure " Patchwork
2024-07-24 9:13 ` [i-g-t 1/2] " Kamil Konieczny
2024-07-24 10:21 ` ✗ CI.xeFULL: failure for series starting with [i-g-t,1/2] " Patchwork
2024-07-24 11:18 ` ✗ Fi.CI.IGT: " Patchwork
2024-07-25 4:18 ` [i-g-t V2 1/2] " Bhanuprakash Modem
2024-07-25 13:45 ` Bernatowicz, Marcin
2024-07-25 16:35 ` Matthew Brost [this message]
2024-07-25 15:57 ` Kamil Konieczny
2024-07-25 6:23 ` ✗ Fi.CI.BAT: failure for series starting with [i-g-t,V2,1/2] lib/drmtest: Ensure the XE driver is idle before starting a test (rev2) Patchwork
2024-07-25 6:36 ` ✗ CI.xeBAT: " Patchwork
2024-07-25 8:51 ` ✗ CI.xeBAT: failure for series starting with [i-g-t,V2,1/2] lib/drmtest: Ensure the XE driver is idle before starting a test (rev3) Patchwork
2024-07-25 8:52 ` ✓ Fi.CI.BAT: success " Patchwork
2024-07-25 9:07 ` ✗ CI.xeFULL: failure for series starting with [i-g-t,V2,1/2] lib/drmtest: Ensure the XE driver is idle before starting a test (rev2) Patchwork
2024-07-25 12:04 ` ✗ CI.xeFULL: failure for series starting with [i-g-t,V2,1/2] lib/drmtest: Ensure the XE driver is idle before starting a test (rev3) Patchwork
2024-07-25 23:15 ` ✗ 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=ZqJ+xAgnWBCp0JLE@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=bhanuprakash.modem@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=juhapekka.heikkila@gmail.com \
--cc=kamil.konieczny@linux.intel.com \
--cc=marcin.bernatowicz@linux.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