Commit b1379d49 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Replace lockless_dereference(bool) with READ_ONCE()

After Joonas complained about using READ_ONCE() on the only use of the
variable in the function, where the intent was to simply document that
the read was intentionally racy and unlocked, I switched the READ_ONCE()
over to lockless_dereference(). However, in linux-next that has a
stronger type-check to only allow pointers and is no longer
interchangeable with READ_ONCE(), see commit 331b6d8c
("locking/barriers: Validate lockless_dereference() is used on a pointer
type")
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Fixes: 67d97da3 ("drm/i915: Only start retire worker when idle")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1467705276-707-1-git-send-email-chris@chris-wilson.co.ukReviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
parent af1346a0
...@@ -3290,7 +3290,7 @@ i915_gem_retire_work_handler(struct work_struct *work) ...@@ -3290,7 +3290,7 @@ i915_gem_retire_work_handler(struct work_struct *work)
* We do not need to do this test under locking as in the worst-case * We do not need to do this test under locking as in the worst-case
* we queue the retire worker once too often. * we queue the retire worker once too often.
*/ */
if (lockless_dereference(dev_priv->gt.awake)) if (READ_ONCE(dev_priv->gt.awake))
queue_delayed_work(dev_priv->wq, queue_delayed_work(dev_priv->wq,
&dev_priv->gt.retire_work, &dev_priv->gt.retire_work,
round_jiffies_up_relative(HZ)); round_jiffies_up_relative(HZ));
......
...@@ -3095,7 +3095,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work) ...@@ -3095,7 +3095,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
if (!i915.enable_hangcheck) if (!i915.enable_hangcheck)
return; return;
if (!lockless_dereference(dev_priv->gt.awake)) if (!READ_ONCE(dev_priv->gt.awake))
return; return;
/* As enabling the GPU requires fairly extensive mmio access, /* As enabling the GPU requires fairly extensive mmio access,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment