drm/i915: Use ktime on wait_for
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Mon, 23 Apr 2018 11:37:53 +0000 (14:37 +0300)
committerMika Kuoppala <mika.kuoppala@linux.intel.com>
Tue, 24 Apr 2018 12:46:26 +0000 (15:46 +0300)
commit3085982c6b45d7d22f76e3aa018affbc143a7370
tree052105559b6a4a95c0c5305ea3397102971a0db5
parent672e314b21dc614894e69bb56a2b55cc7d256810
drm/i915: Use ktime on wait_for

We use jiffies to determine when wait expires. However
Imre did find out that jiffies can and will do a >1
increments on certain situations [1]. When this happens
in a wait_for loop, we return timeout errorneously
much earlier than what the real wallclock would say.

We can't afford our waits to timeout prematurely.
Discard jiffies and change to ktime to detect timeouts.

v2: added bugzilla entry (Imre), added stable (Chris)

Reported-by: Imre Deak <imre.deak@intel.com>
References: https://lkml.org/lkml/2018/4/18/798 [1]
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105771
Cc: Imre Deak <imre.deak@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180423113754.28424-1-mika.kuoppala@linux.intel.com
drivers/gpu/drm/i915/intel_drv.h