From: Petri Latvala <petri.latvala@intel.com>
To: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: igt-dev@lists.freedesktop.org, Jani Nikula <jani.nikula@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 7/7] tests/gem_eio: switch to using igt_params_set()
Date: Tue, 5 May 2020 10:41:25 +0300 [thread overview]
Message-ID: <20200505074125.GO9497@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <20200428202255.31309-8-juhapekka.heikkila@gmail.com>
On Tue, Apr 28, 2020 at 11:22:55PM +0300, Juha-Pekka Heikkila wrote:
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
> ---
> tests/i915/gem_eio.c | 57 +++++++++++++++++++-------------------------
> 1 file changed, 24 insertions(+), 33 deletions(-)
>
> diff --git a/tests/i915/gem_eio.c b/tests/i915/gem_eio.c
> index 1ec60941..ad59f83a 100644
> --- a/tests/i915/gem_eio.c
> +++ b/tests/i915/gem_eio.c
> @@ -52,20 +52,11 @@
>
> IGT_TEST_DESCRIPTION("Test that specific ioctls report a wedged GPU (EIO).");
>
> -static bool i915_reset_control(bool enable)
> +static bool i915_reset_control(int fd, bool enable)
> {
> - const char *path = "/sys/module/i915/parameters/reset";
> - int fd, ret;
> -
> igt_debug("%s GPU reset\n", enable ? "Enabling" : "Disabling");
>
> - fd = open(path, O_RDWR);
> - igt_require(fd >= 0);
> -
> - ret = write(fd, &"01"[enable], 1) == 1;
> - close(fd);
> -
> - return ret;
> + return igt_params_set(fd, "reset", "%d", enable);
> }
>
> static void trigger_reset(int fd)
> @@ -106,9 +97,9 @@ static void wedge_gpu(int fd)
> /* First idle the GPU then disable GPU resets before injecting a hang */
> gem_quiescent_gpu(fd);
>
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
> manual_hang(fd);
> - igt_assert(i915_reset_control(true));
> + igt_assert(i915_reset_control(fd, true));
> }
>
> static int __gem_throttle(int fd)
> @@ -346,7 +337,7 @@ static void __test_banned(int fd)
> gem_write(fd, obj.handle, 0, &bbe, sizeof(bbe));
>
> gem_quiescent_gpu(fd);
> - igt_require(i915_reset_control(true));
> + igt_require(i915_reset_control(fd, true));
>
> igt_until_timeout(5) {
> igt_spin_t *hang;
> @@ -404,9 +395,9 @@ static void test_wait(int fd, unsigned int flags, unsigned int wait)
> */
>
> if (flags & TEST_WEDGE)
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
> else
> - igt_require(i915_reset_control(true));
> + igt_require(i915_reset_control(fd, true));
>
> hang = spin_sync(fd, 0, I915_EXEC_DEFAULT);
>
> @@ -415,7 +406,7 @@ static void test_wait(int fd, unsigned int flags, unsigned int wait)
>
> igt_spin_free(fd, hang);
>
> - igt_require(i915_reset_control(true));
> + igt_require(i915_reset_control(fd, true));
>
> trigger_reset(fd);
> close(fd);
> @@ -430,12 +421,12 @@ static void test_suspend(int fd, int state)
> igt_system_suspend_autoresume(state, SUSPEND_TEST_DEVICES);
>
> /* Check we can suspend when the driver is already wedged */
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
> manual_hang(fd);
>
> igt_system_suspend_autoresume(state, SUSPEND_TEST_DEVICES);
>
> - igt_require(i915_reset_control(true));
> + igt_require(i915_reset_control(fd, true));
> trigger_reset(fd);
> close(fd);
> }
> @@ -470,7 +461,7 @@ static void test_inflight(int fd, unsigned int wait)
>
> gem_quiescent_gpu(fd);
> igt_debug("Starting %s on engine '%s'\n", __func__, e->name);
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
>
> hang = spin_sync(fd, 0, eb_ring(e));
> obj[0].handle = hang->handle;
> @@ -495,7 +486,7 @@ static void test_inflight(int fd, unsigned int wait)
> }
> igt_spin_free(fd, hang);
>
> - igt_assert(i915_reset_control(true));
> + igt_assert(i915_reset_control(fd, true));
> trigger_reset(fd);
>
> gem_close(fd, obj[1].handle);
> @@ -520,7 +511,7 @@ static void test_inflight_suspend(int fd)
> fd = gem_reopen_driver(fd);
> igt_require_gem(fd);
> igt_require(gem_has_exec_fence(fd));
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
>
> memset(obj, 0, sizeof(obj));
> obj[0].flags = EXEC_OBJECT_WRITE;
> @@ -553,7 +544,7 @@ static void test_inflight_suspend(int fd)
> }
> igt_spin_free(fd, hang);
>
> - igt_assert(i915_reset_control(true));
> + igt_assert(i915_reset_control(fd, true));
> trigger_reset(fd);
> close(fd);
> }
> @@ -601,7 +592,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)
> gem_quiescent_gpu(fd);
>
> igt_debug("Starting %s on engine '%s'\n", __func__, e->name);
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
>
> memset(obj, 0, sizeof(obj));
> obj[0].flags = EXEC_OBJECT_WRITE;
> @@ -636,7 +627,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)
> igt_spin_free(fd, hang);
> gem_close(fd, obj[1].handle);
>
> - igt_assert(i915_reset_control(true));
> + igt_assert(i915_reset_control(fd, true));
> trigger_reset(fd);
>
> for (unsigned int n = 0; n < ARRAY_SIZE(ctx); n++)
> @@ -663,7 +654,7 @@ static void test_inflight_external(int fd)
>
> fence = igt_cork_plug(&cork, fd);
>
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
> hang = __spin_poll(fd, 0, 0);
>
> memset(&obj, 0, sizeof(obj));
> @@ -695,7 +686,7 @@ static void test_inflight_external(int fd)
> close(fence);
>
> igt_spin_free(fd, hang);
> - igt_assert(i915_reset_control(true));
> + igt_assert(i915_reset_control(fd, true));
> trigger_reset(fd);
> close(fd);
> }
> @@ -714,7 +705,7 @@ static void test_inflight_internal(int fd, unsigned int wait)
> fd = gem_reopen_driver(fd);
> igt_require_gem(fd);
>
> - igt_require(i915_reset_control(false));
> + igt_require(i915_reset_control(fd, false));
> hang = spin_sync(fd, 0, 0);
>
> memset(obj, 0, sizeof(obj));
> @@ -745,7 +736,7 @@ static void test_inflight_internal(int fd, unsigned int wait)
> }
> igt_spin_free(fd, hang);
>
> - igt_assert(i915_reset_control(true));
> + igt_assert(i915_reset_control(fd, true));
> trigger_reset(fd);
> close(fd);
> }
> @@ -781,7 +772,7 @@ static void reset_stress(int fd, uint32_t ctx0,
>
> gem_quiescent_gpu(fd);
>
> - igt_require(i915_reset_control(flags & TEST_WEDGE ?
> + igt_require(i915_reset_control(fd, flags & TEST_WEDGE ?
> false : true));
>
> /*
> @@ -803,7 +794,7 @@ static void reset_stress(int fd, uint32_t ctx0,
> igt_assert_eq(sync_fence_status(hang->out_fence), -EIO);
>
> /* Unwedge by forcing a reset. */
> - igt_assert(i915_reset_control(true));
> + igt_assert(i915_reset_control(fd, true));
> trigger_reset(fd);
>
> gem_quiescent_gpu(fd);
> @@ -918,7 +909,7 @@ static int fd = -1;
> static void
> exit_handler(int sig)
> {
> - i915_reset_control(true);
> + i915_reset_control(fd, true);
> igt_force_gpu_reset(fd);
> }
>
> @@ -933,7 +924,7 @@ igt_main
>
> igt_allow_hang(fd, 0, 0);
>
> - igt_require(i915_reset_control(true));
> + igt_require(i915_reset_control(fd, true));
> igt_force_gpu_reset(fd);
> igt_install_exit_handler(exit_handler);
> }
> --
> 2.26.0
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-05-05 7:41 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-28 20:22 [igt-dev] [PATCH i-g-t 0/7] Use device dependant module parameters Juha-Pekka Heikkila
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 1/7] lib/params: add igt_params.c for module parameter access Juha-Pekka Heikkila
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 2/7] lib/params: start renaming functions igt_params_* Juha-Pekka Heikkila
2020-05-05 14:04 ` Arkadiusz Hiler
2020-05-05 18:43 ` Juha-Pekka Heikkila
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 3/7] lib/params: overhaul param saving Juha-Pekka Heikkila
2020-05-05 7:05 ` Petri Latvala
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 4/7] lib/params: add igt_params_open() which will return path Juha-Pekka Heikkila
2020-05-05 7:07 ` Petri Latvala
2020-05-05 18:44 ` Juha-Pekka Heikkila
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 5/7] igt/params: add generic saving module parameter set Juha-Pekka Heikkila
2020-05-05 7:16 ` Petri Latvala
2020-05-05 18:44 ` Juha-Pekka Heikkila
2020-05-05 14:09 ` Arkadiusz Hiler
2020-05-05 18:46 ` Juha-Pekka Heikkila
2020-05-05 20:00 ` Juha-Pekka Heikkila
2020-05-06 9:05 ` Arkadiusz Hiler
2020-05-06 9:54 ` Juha-Pekka Heikkila
2020-05-06 10:09 ` Petri Latvala
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 6/7] igt/params: use igt_params_set_save for igt_set_module_param* Juha-Pekka Heikkila
2020-05-05 7:20 ` Petri Latvala
2020-05-05 14:22 ` Arkadiusz Hiler
2020-05-06 7:34 ` Petri Latvala
2020-04-28 20:22 ` [igt-dev] [PATCH i-g-t 7/7] tests/gem_eio: switch to using igt_params_set() Juha-Pekka Heikkila
2020-05-05 7:41 ` Petri Latvala [this message]
2020-04-28 21:16 ` [igt-dev] ✓ Fi.CI.BAT: success for Use device dependant module parameters (rev5) Patchwork
2020-04-29 1:42 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2020-05-07 19:09 [igt-dev] [PATCH i-g-t 0/7] Use device dependant module parameters Juha-Pekka Heikkila
2020-05-07 19:09 ` [igt-dev] [PATCH i-g-t 7/7] tests/gem_eio: switch to using igt_params_set() Juha-Pekka Heikkila
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=20200505074125.GO9497@platvala-desk.ger.corp.intel.com \
--to=petri.latvala@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=juhapekka.heikkila@gmail.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