From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Vlad 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 Message-ID: <20161030105301.ax4gs5cwz2tsvtr5@mcvlad-wk.rb.intel.com> References: <20161028093129.13275-1-marius.c.vlad@intel.com> <20161028093129.13275-4-marius.c.vlad@intel.com> <20161028094833.GB29769@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0725703829==" Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE4F76E057 for ; Sun, 30 Oct 2016 10:46:50 +0000 (UTC) In-Reply-To: <20161028094833.GB29769@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , intel-gfx@lists.freedesktop.org, petri.latvala@intel.com, jani.nikula@linux.intel.com, daniel@ffwll.ch List-Id: intel-gfx@lists.freedesktop.org --===============0725703829== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dxerdhoffwqxz6fj" Content-Disposition: inline --dxerdhoffwqxz6fj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 =3D __drm_open_driver(DRIVER_INTEL); > > + > > + igt_subtest_group { > > + igt_subtest("basic-gem-info") > > + if ((err =3D gem_info(fd))) > > + igt_fail(err); > > + igt_subtest_group > > + if ((err =3D gem_exec_store(fd))) > > + igt_fail(err); >=20 > 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? >=20 > One more thing about gem_info(), to be used in process it needs to be > something like: >=20 > /* 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 =3D {}; > int fd, err; >=20 > fd =3D __drm_driver_open(DRIVER_INTEL); > igt_set_timeout(1, "module reload failed"); >=20 > err =3D 0; > if (ioctl(fd, SET_CACHEING, &arg)) > err =3D -errno; >=20 > igt_set_timeout(0, NULL); > close(fd); >=20 > igt_assert_eq(err, -ENOENT); >=20 > } Alright will do. > -Chris >=20 > --=20 > Chris Wilson, Intel Open Source Technology Centre --dxerdhoffwqxz6fj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAABCAAGBQJYFdENAAoJELmLWIAQzyE+B8gH/iJ7TXbawzLLwtq7jqCm2/S/ 0s0YVg6AcRb74KZCBhRN2aIKLkQmWLsyEHkt3S49mEMoEmr2j5alM48BeBroZfH+ AD+yNHB5McBRrKQxBBlXQcLc1mr6iIHTA353jaDGqti0fe6i/fFz8eIHrnZd+mdH NNbxOqknLw8fg6rzfQv6pISVk81DYOUZ0eZJiqWEcF7KI9PijBpm5DIUBSAaGADE m5bDOiCY5hTXumNhUW2/gSidk3kfivimV+wxxHeJ3lxFmsn4eXs37TDNX/mX4vCX /ENUF+0gy8894MbMion0yH5s5Z0AKkTBNVUmz/HxpdXpTx5LikDuc09peU1Xl2E= =hozV -----END PGP SIGNATURE----- --dxerdhoffwqxz6fj-- --===============0725703829== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============0725703829==--