From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/selftests: Fix error checking for wait_var_timeout
Date: Wed, 18 Apr 2018 13:36:10 +0300 [thread overview]
Message-ID: <87k1t4244l.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180417170638.20550-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> The old wait_on_atomic_t used a custom callback to perform the
> schedule(), which used my return semantics of reporting an error code on
> timeout. wait_var_event_timeout() uses the schedule() return semantics
> of reporting the remaining jiffies (1 if it timed out with 0 jiffies
> remaining!) and 0 on failure. This semantic mismatch lead to us falsely
> claiming a time out occurred.
I might have gone too far into the rabbit hole on this one.
The more I abseiled, the more there was macro trickery and
shadowing return values. Anxiety started to creep in.
I am back but will need to recuperate.
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106085
> Fixes: d224985a5e31 ("sched/wait, drivers/drm: Convert wait_on_atomic_t() usage to the new wait_var_event() API")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> index 46580026c7fc..d6926e7820e5 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_breadcrumbs.c
> @@ -412,10 +412,11 @@ static int igt_wakeup(void *arg)
> * that they are ready for the next test. We wait until all
> * threads are complete and waiting for us (i.e. not a seqno).
> */
> - err = wait_var_event_timeout(&done, !atomic_read(&done), 10 * HZ);
> - if (err) {
> + if (!wait_var_event_timeout(&done,
> + !atomic_read(&done), 10 * HZ)) {
> pr_err("Timed out waiting for %d remaining waiters\n",
> atomic_read(&done));
> + err = -ETIMEDOUT;
> break;
> }
>
> --
> 2.17.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2018-04-18 10:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-17 17:06 [PATCH] drm/i915/selftests: Fix error checking for wait_var_timeout Chris Wilson
2018-04-17 17:31 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-04-17 17:47 ` ✓ Fi.CI.IGT: " Patchwork
2018-04-18 9:10 ` [PATCH] " Joonas Lahtinen
2018-04-18 9:14 ` Chris Wilson
2018-04-18 10:11 ` Joonas Lahtinen
2018-04-18 10:18 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-04-18 10:36 ` Mika Kuoppala [this message]
2018-04-18 11:45 ` Patchwork
2018-04-18 12:22 ` ✓ Fi.CI.IGT: " Patchwork
2018-04-18 13:38 ` Patchwork
2018-05-02 10:20 ` Chris Wilson
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=87k1t4244l.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
/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.