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: Replace lockless_dereference(bool) with READ_ONCE()
Date: Tue, 05 Jul 2016 12:54:50 +0300 [thread overview]
Message-ID: <87poqsv28l.fsf@intel.com> (raw)
In-Reply-To: <1467705276-707-1-git-send-email-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> 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 331b6d8c7afc
> ("locking/barriers: Validate lockless_dereference() is used on a pointer
> type")
>
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Fixes: 67d97da34917 ("drm/i915: Only start retire worker when idle")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem.c | 2 +-
> drivers/gpu/drm/i915/i915_irq.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index a7852dd0a3d4..20123c09bc18 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -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 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,
> &dev_priv->gt.retire_work,
> round_jiffies_up_relative(HZ));
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index f6de8dd567a2..2f01b0b959a1 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -3095,7 +3095,7 @@ static void i915_hangcheck_elapsed(struct work_struct *work)
> if (!i915.enable_hangcheck)
> return;
>
> - if (!lockless_dereference(dev_priv->gt.awake))
> + if (!READ_ONCE(dev_priv->gt.awake))
> return;
>
> /* As enabling the GPU requires fairly extensive mmio access,
> --
> 2.8.1
>
> _______________________________________________
> 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:[~2016-07-05 9:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 7:54 [PATCH] drm/i915: Replace lockless_dereference(bool) with READ_ONCE() Chris Wilson
2016-07-05 8:31 ` ✓ Ro.CI.BAT: success for " Patchwork
2016-07-05 9:54 ` Mika Kuoppala [this message]
2016-07-05 9:59 ` [PATCH] " 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=87poqsv28l.fsf@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.