All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Knop, Ryszard" <ryszard.knop@intel.com>
To: "Latvala, Petri" <petri.latvala@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/i915_module_load: Add the "load" test
Date: Wed, 25 May 2022 14:40:52 +0000	[thread overview]
Message-ID: <390af309756eecfba100134069b73aca61c47973.camel@intel.com> (raw)
In-Reply-To: <Yo49OvAQnYEqMu1P@platvala-desk.ger.corp.intel.com>

On Wed, 2022-05-25 at 17:29 +0300, Petri Latvala wrote:
> On Wed, May 25, 2022 at 04:21:34PM +0200, Ryszard Knop wrote:
> > Add a fake test that:
> > - Asserts i915 and associated drivers are not yet loaded;
> > - Loads the i915 driver if that's not the case yet;
> > - Performs a small set of sanity tests to make sure the GPU is
> > there.
> > 
> > The reload test now also performs the same checks.
> > 
> > Signed-off-by: Ryszard Knop <ryszard.knop@intel.com>
> > ---
> >  tests/i915/i915_module_load.c | 52 +++++++++++++++++++++++++++++--
> > ----
> >  1 file changed, 43 insertions(+), 9 deletions(-)
> > 
> > diff --git a/tests/i915/i915_module_load.c
> > b/tests/i915/i915_module_load.c
> > index f5f98acc..46608aa8 100644
> > --- a/tests/i915/i915_module_load.c
> > +++ b/tests/i915/i915_module_load.c
> > @@ -30,6 +30,7 @@
> >  #include <sys/ioctl.h>
> >  #include <fcntl.h>
> >  
> > +#include "i915/gem.h"
> >  #include "i915/gem_create.h"
> >  #include "igt_debugfs.h"
> >  #include "igt_aux.h"
> > @@ -236,21 +237,54 @@ hda_dynamic_debug(bool enable)
> >         fclose(fp);
> >  }
> >  
> > +static void load_and_check_i915(void)
> > +{
> > +       int error;
> > +       int drm_fd;
> > +
> > +       hda_dynamic_debug(true);
> > +       error = igt_i915_driver_load(NULL);
> > +       hda_dynamic_debug(false);
> > +
> > +       igt_assert_eq(error, 0);
> > +
> > +       /* driver is ready, check if it's bound */
> > +       drm_fd = __drm_open_driver(DRIVER_INTEL);
> > +       igt_fail_on_f(drm_fd < 0, "Cannot open the i915 DRM driver
> > after modprobing i915.\n");
> > +
> > +       /* make sure the GPU is idle */
> > +       gem_quiescent_gpu(drm_fd);
> > +       close(drm_fd);
> > +
> > +       /* make sure we can do basic memory ops */
> > +       gem_sanitycheck();
> > +}
> > +
> >  igt_main
> >  {
> > +       igt_describe("Assert that i915 and friends are not yet
> > loaded, then load them.");
> > +       igt_subtest("load") {
> > +               const char * unwanted_drivers[] = {
> > +                       "i915",
> > +                       "intel-gtt",
> > +                       "snd_hda_intel",
> > +                       "snd_hdmi_lpe_audio",
> > +                       NULL
> > +               };
> > +
> > +               for (int i = 0; unwanted_drivers[i] != NULL; i++) {
> > +                       igt_abort_on_f(igt_kmod_is_loaded(unwanted_
> > drivers[i]),
> > +                                      "%s is already loaded!\n",
> > unwanted_drivers[i]);
> > +               }
> 
> Don't abort here, a skip is enough.

Tomi mentioned he would prefer this to be a hard failure if the module
is already loaded - @reload test does not fail if it's loaded already.
Should I swap it to a skip anyways?

Thanks, Ryszard

  reply	other threads:[~2022-05-25 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-25 14:21 [igt-dev] [PATCH i-g-t] tests/i915_module_load: Add the "load" test Ryszard Knop
2022-05-25 14:29 ` Petri Latvala
2022-05-25 14:40   ` Knop, Ryszard [this message]
2022-05-25 15:09     ` Petri Latvala
2022-05-25 19:02 ` [igt-dev] ✗ Fi.CI.BAT: failure for " 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=390af309756eecfba100134069b73aca61c47973.camel@intel.com \
    --to=ryszard.knop@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.