]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/perf: workaround register corruption in OATAILPTR
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 17 Nov 2020 13:01:24 +0000 (15:01 +0200)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 24 Nov 2020 17:17:41 +0000 (09:17 -0800)
commit22e477a04bfa532141d55c6876dee5c3ff7ddc1f
treed2d6b4c268e339d48301a36e70574f0feee5b7df
parent40553dea78f7e9ff35aa9c37540f0b960193749a
drm/i915/perf: workaround register corruption in OATAILPTR

After having written the entire OA buffer with reports, the HW will
write again at the beginning of the OA buffer. It'll indicate it by
setting the WRAP bits in the OASTATUS register.

When a wrap happens and that at the end of the read vfunc we write the
OASTATUS register back to clear the REPORT_LOST bit, we sometimes see
that the OATAILPTR register is reset to a previous position on Gen8/9
(apparently not the case on Gen11+). This leads the next call to the
read vfunc to process reports we've already read. Because we've marked
those as read by clearing the reason & timestamp dwords, they're
discarded and a "Skipping spurious, invalid OA report" message is
emitted.

The workaround to avoid this OATAILPTR value reset seems to be to set
the wrap bits when writing back OASTATUS.

This change has no impact on userspace, it only avoids a bunch of
DRM_NOTE("Skipping spurious, invalid OA report\n") messages.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 85faa4d90530d5 ("drm/i915/perf: Add OA unit support for Gen 8+")
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201117130124.829979-1-lionel.g.landwerlin@intel.com
(cherry picked from commit 059a0beb486344a577ff476acce75e69eab704be)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/i915/i915_perf.c
drivers/gpu/drm/i915/i915_reg.h