All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marius Vlad <marius.c.vlad@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	intel-gfx@lists.freedesktop.org, petri.latvala@intel.com,
	jani.nikula@linux.intel.com, daniel@ffwll.ch
Subject: Re: [PATCH i-g-t 3/4 v4] tests/drv_module_reload: Convert sh script to C version.
Date: Sun, 30 Oct 2016 12:53:02 +0200	[thread overview]
Message-ID: <20161030105301.ax4gs5cwz2tsvtr5@mcvlad-wk.rb.intel.com> (raw)
In-Reply-To: <20161028094833.GB29769@nuc-i3427.alporthouse.com>


[-- Attachment #1.1: Type: text/plain, Size: 2224 bytes --]

On Fri, Oct 28, 2016 at 10:48:33AM +0100, Chris Wilson wrote:
> On Fri, Oct 28, 2016 at 12:31:28PM +0300, Marius Vlad wrote:
> > +	igt_subtest_group {
> > +		int fd;
> > +
> > +		igt_fixture
> > +			fd = __drm_open_driver(DRIVER_INTEL);
> > +
> > +		igt_subtest_group {
> > +			igt_subtest("basic-gem-info")
> > +				if ((err = gem_info(fd)))
> > +					igt_fail(err);
> > +			igt_subtest_group
> > +				if ((err = gem_exec_store(fd)))
> > +					igt_fail(err);
> 
> This is a misinterpretation of the existing test. These are not
> subtests, but a sanity check that reload() works. A call to
> gem_exec_store() can just whither away, it doesn't reveal much about the
> general sanity of the driver, but a quick call to an ioctl such as
> gem_info() is enough to be sure the driver is there (i.e. the module load
> worked as adverticed) and not hung upon load.
Indeed, that's exactly what they are: sanity check that reloading of the
driver works, just that grouping them as subtests/subgroups made
embedding them easier and I thought that worked better given igt is
centered around tests/subtests (gem_exec_store has a igt_skip_on_f()
thus the subgroup)

I guess that I can call them directly in "basic-reload" subtest. If
either gem_info and gem_exec_store failed than reloading failed. Is that a
reasonable approach and it is OK with you?

> 
> One more thing about gem_info(), to be used in process it needs to be
> something like:
> 
> /* Check the driver load completed by seeing if it responds to an ioctl
>  * correctly. We pick an ioctl that calls i915_mutex_interruptible()
>  * first (before failing on the invalid arg) so that we can inspect its
>  * driver error detection (-EIO if already wedged, or -EINTR if stuck).
>  */
> void i915_gem_sanitycheck(void)
> {
> 	struct set_cacheing arg = {};
> 	int fd, err;
> 
> 	fd = __drm_driver_open(DRIVER_INTEL);
> 	igt_set_timeout(1, "module reload failed");
> 
> 	err = 0;
> 	if (ioctl(fd, SET_CACHEING, &arg))
> 		err = -errno;
> 
> 	igt_set_timeout(0, NULL);
> 	close(fd);
> 
> 	igt_assert_eq(err, -ENOENT);
> 
> }
Alright will do.
> -Chris
> 
> -- 
> Chris Wilson, Intel Open Source Technology Centre

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-10-30 10:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28  9:31 [PATCH i-g-t 0/4 v4] Convert sh scripts to C variants Marius Vlad
2016-10-28  9:31 ` [PATCH i-g-t 1/4 v4] lib/{igt_sysfs, igt_aux}: Make available to other users kick_fbcon() (unbind_fbcon()), and added helpers to lib/igt_aux, lib/igt_kmod Marius Vlad
2016-11-26 15:31   ` Chris Wilson
2016-10-28  9:31 ` [PATCH i-g-t 2/4 v4] lib/igt_gvt: Make use of libkmod helpers and fix reading gvt parameter Marius Vlad
2016-10-28 10:08   ` Chris Wilson
2016-10-30 12:47     ` Marius Vlad
2016-10-30 12:59       ` Chris Wilson
2016-10-28  9:31 ` [PATCH i-g-t 3/4 v4] tests/drv_module_reload: Convert sh script to C version Marius Vlad
2016-10-28  9:48   ` Chris Wilson
2016-10-30 10:53     ` Marius Vlad [this message]
2016-10-28  9:31 ` [PATCH i-g-t 4/4 v4] tests/kms_sysfs_edid_timing: Convert sh " Marius Vlad
2016-10-28 10:03   ` Chris Wilson
2016-10-30 11:41     ` Marius Vlad

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=20161030105301.ax4gs5cwz2tsvtr5@mcvlad-wk.rb.intel.com \
    --to=marius.c.vlad@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --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.