[Intel-gfx] [PATCH v3 3/5] drm/i915/guc: Simplify GuC doorbell logic

Chris Wilson chris at chris-wilson.co.uk
Thu Sep 14 10:37:17 UTC 2017


Quoting MichaƂ Winiarski (2017-09-14 09:32:14)
> +       /* we're not expecting the doorbell cookie to change behind our back */
> +       cookie = READ_ONCE(db->cookie);
> +       if (cmpxchg(&db->cookie, cookie, cookie + 1) != cookie)
> +               BUG();

Or just
WARN_ON_ONCE(xchg(&db->cookie, cookie + 1) != cookie);
-Chris


More information about the Intel-gfx mailing list