From: <gregkh@linuxfoundation.org>
To: chris@chris-wilson.co.uk, drm-intel-fixes@lists.freedesktop.org,
gregkh@linuxfoundation.org, jani.nikula@intel.com,
joonas.lahtinen@linux.intel.com, matthew.william.auld@gmail.com
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "drm/i915: Squelch any ktime/jiffie rounding errors for wait-ioctl" has been added to the 4.10-stable tree
Date: Wed, 12 Apr 2017 14:49:54 +0200 [thread overview]
Message-ID: <149200139413236@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
drm/i915: Squelch any ktime/jiffie rounding errors for wait-ioctl
to the 4.10-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
drm-i915-squelch-any-ktime-jiffie-rounding-errors-for-wait-ioctl.patch
and it can be found in the queue-4.10 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 89cf83d4e065ff9fbd2ddc674489c8058eeca758 Mon Sep 17 00:00:00 2001
From: Chris Wilson <chris@chris-wilson.co.uk>
Date: Thu, 16 Feb 2017 12:54:41 +0000
Subject: drm/i915: Squelch any ktime/jiffie rounding errors for wait-ioctl
From: Chris Wilson <chris@chris-wilson.co.uk>
commit 89cf83d4e065ff9fbd2ddc674489c8058eeca758 upstream.
We wait upon jiffies, but report the time elapsed using a
high-resolution timer. This discrepancy can lead to us timing out the
wait prior to us reporting the elapsed time as complete.
This restores the squelching lost in commit e95433c73a11 ("drm/i915:
Rearrange i915_wait_request() accounting with callers").
Fixes: e95433c73a11 ("drm/i915: Rearrange i915_wait_request() accounting with callers")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
Link: http://patchwork.freedesktop.org/patch/msgid/20170216125441.30923-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
(cherry picked from commit c1d2061b28c2aa25ec39b60d9c248e6beebd7315)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/i915/i915_gem.c | 10 ++++++++++
1 file changed, 10 insertions(+)
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3003,6 +3003,16 @@ i915_gem_wait_ioctl(struct drm_device *d
args->timeout_ns -= ktime_to_ns(ktime_sub(ktime_get(), start));
if (args->timeout_ns < 0)
args->timeout_ns = 0;
+
+ /*
+ * Apparently ktime isn't accurate enough and occasionally has a
+ * bit of mismatch in the jiffies<->nsecs<->ktime loop. So patch
+ * things up to make the test happy. We allow up to 1 jiffy.
+ *
+ * This is a regression from the timespec->ktime conversion.
+ */
+ if (ret == -ETIME && !nsecs_to_jiffies(args->timeout_ns))
+ args->timeout_ns = 0;
}
i915_gem_object_put(obj);
Patches currently in stable-queue which might be from chris@chris-wilson.co.uk are
queue-4.10/drm-i915-squelch-any-ktime-jiffie-rounding-errors-for-wait-ioctl.patch
queue-4.10/drm-i915-fbdev-stop-repeating-tile-configuration-on-stagnation.patch
queue-4.10/drm-i915-store-a-permanent-error-in-obj-mm.pages.patch
queue-4.10/drm-i915-gen9-increase-pcode-request-timeout-to-50ms.patch
queue-4.10/drm-i915-avoid-tweaking-evaluation-thresholds-on-baytrail-v3.patch
queue-4.10/drm-i915-fix-forcewake-active-domain-tracking.patch
reply other threads:[~2017-04-12 12:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=149200139413236@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=chris@chris-wilson.co.uk \
--cc=drm-intel-fixes@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=matthew.william.auld@gmail.com \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).