drm/i915/guc: Ensure H2G buffer updates visible before tail update
authorMatthew Brost <matthew.brost@intel.com>
Thu, 3 Jun 2021 05:16:25 +0000 (22:16 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 4 Jun 2021 08:39:04 +0000 (10:39 +0200)
commitd35ca600873eebceb071af81bdc279fb6ec538db
treeaef250b9cccb4afd6ac049ca5e8d9926dff6c3bc
parent7c567bbf6f267c7379ddbba7afba7608d6e8e39f
drm/i915/guc: Ensure H2G buffer updates visible before tail update

Ensure H2G buffer updates are visible before descriptor tail updates by
inserting a barrier between the H2G buffer update and the tail. The
barrier is simple wmb() for SMEM and is register write for LMEM. This is
needed if more than 1 H2G can be inflight at once.

If this barrier is not inserted it is possible the descriptor tail
update is scene by the GuC before H2G buffer update which results in the
GuC reading a corrupt H2G value. This can bring down the H2G channel
among other bad things.

Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210603051630.2635-16-matthew.brost@intel.com
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c