Message ID | 20200309211057.38575-1-umesh.nerlige.ramappa@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915/perf: Invalidate OA TLB on when closing perf stream | expand |
Quoting Umesh Nerlige Ramappa (2020-03-09 21:10:57) > On running several back to back perf capture sessions involving closing > and opening the perf stream, invalid OA reports are seen in the > beginning of the OA buffer in some sessions. Fix this by invalidating OA > TLB when the perf stream is closed or disabled on gen12. > > Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Testcase? -Chris
On Mon, Mar 09, 2020 at 10:45:47PM +0000, Chris Wilson wrote: >Quoting Umesh Nerlige Ramappa (2020-03-09 21:10:57) >> On running several back to back perf capture sessions involving closing >> and opening the perf stream, invalid OA reports are seen in the >> beginning of the OA buffer in some sessions. Fix this by invalidating OA >> TLB when the perf stream is closed or disabled on gen12. >> >> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> > >Testcase? Issue occurs if all perf tests are run on TGL, but I guess a single subtest should do it too. Here it is - https://patchwork.freedesktop.org/patch/356973/ Thanks, Umesh >-Chris
On 09/03/2020 23:10, Umesh Nerlige Ramappa wrote: > On running several back to back perf capture sessions involving closing > and opening the perf stream, invalid OA reports are seen in the > beginning of the OA buffer in some sessions. Fix this by invalidating OA > TLB when the perf stream is closed or disabled on gen12. > > Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> > --- > drivers/gpu/drm/i915/i915_perf.c | 8 ++++++++ > drivers/gpu/drm/i915/i915_reg.h | 2 ++ > 2 files changed, 10 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c > index 1b074bb4a7fe..551be589d6f4 100644 > --- a/drivers/gpu/drm/i915/i915_perf.c > +++ b/drivers/gpu/drm/i915/i915_perf.c > @@ -2700,6 +2700,14 @@ static void gen12_oa_disable(struct i915_perf_stream *stream) > 50)) > drm_err(&stream->perf->i915->drm, > "wait for OA to be disabled timed out\n"); > + > + intel_uncore_write(uncore, GEN12_OA_TLB_INV_CR, 1); > + if (intel_wait_for_register(uncore, > + GEN12_OA_TLB_INV_CR, > + 1, 0, > + 50)) > + drm_err(&stream->perf->i915->drm, > + "wait for OA tlb invalidate timed out\n"); > } > > /** > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h > index 79ae9654dac9..95725e61d9f1 100644 > --- a/drivers/gpu/drm/i915/i915_reg.h > +++ b/drivers/gpu/drm/i915/i915_reg.h > @@ -693,6 +693,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) > #define OABUFFER_SIZE_8M (6 << 3) > #define OABUFFER_SIZE_16M (7 << 3) > > +#define GEN12_OA_TLB_INV_CR _MMIO(0xceec) > + > /* Gen12 OAR unit */ > #define GEN12_OAR_OACONTROL _MMIO(0x2960) > #define GEN12_OAR_OACONTROL_COUNTER_FORMAT_SHIFT 1
On 10/03/2020 11:03, Lionel Landwerlin wrote: > On 09/03/2020 23:10, Umesh Nerlige Ramappa wrote: >> On running several back to back perf capture sessions involving closing >> and opening the perf stream, invalid OA reports are seen in the >> beginning of the OA buffer in some sessions. Fix this by invalidating OA >> TLB when the perf stream is closed or disabled on gen12. >> >> Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> > Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> We want this to be with the tag : Fixes: 00a7f0d7155c ("drm/i915/tgl: Add perf support on TGL") -Lionel >> --- >> drivers/gpu/drm/i915/i915_perf.c | 8 ++++++++ >> drivers/gpu/drm/i915/i915_reg.h | 2 ++ >> 2 files changed, 10 insertions(+) >> >> diff --git a/drivers/gpu/drm/i915/i915_perf.c >> b/drivers/gpu/drm/i915/i915_perf.c >> index 1b074bb4a7fe..551be589d6f4 100644 >> --- a/drivers/gpu/drm/i915/i915_perf.c >> +++ b/drivers/gpu/drm/i915/i915_perf.c >> @@ -2700,6 +2700,14 @@ static void gen12_oa_disable(struct >> i915_perf_stream *stream) >> 50)) >> drm_err(&stream->perf->i915->drm, >> "wait for OA to be disabled timed out\n"); >> + >> + intel_uncore_write(uncore, GEN12_OA_TLB_INV_CR, 1); >> + if (intel_wait_for_register(uncore, >> + GEN12_OA_TLB_INV_CR, >> + 1, 0, >> + 50)) >> + drm_err(&stream->perf->i915->drm, >> + "wait for OA tlb invalidate timed out\n"); >> } >> /** >> diff --git a/drivers/gpu/drm/i915/i915_reg.h >> b/drivers/gpu/drm/i915/i915_reg.h >> index 79ae9654dac9..95725e61d9f1 100644 >> --- a/drivers/gpu/drm/i915/i915_reg.h >> +++ b/drivers/gpu/drm/i915/i915_reg.h >> @@ -693,6 +693,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t >> reg) >> #define OABUFFER_SIZE_8M (6 << 3) >> #define OABUFFER_SIZE_16M (7 << 3) >> +#define GEN12_OA_TLB_INV_CR _MMIO(0xceec) >> + >> /* Gen12 OAR unit */ >> #define GEN12_OAR_OACONTROL _MMIO(0x2960) >> #define GEN12_OAR_OACONTROL_COUNTER_FORMAT_SHIFT 1 > > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 1b074bb4a7fe..551be589d6f4 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -2700,6 +2700,14 @@ static void gen12_oa_disable(struct i915_perf_stream *stream) 50)) drm_err(&stream->perf->i915->drm, "wait for OA to be disabled timed out\n"); + + intel_uncore_write(uncore, GEN12_OA_TLB_INV_CR, 1); + if (intel_wait_for_register(uncore, + GEN12_OA_TLB_INV_CR, + 1, 0, + 50)) + drm_err(&stream->perf->i915->drm, + "wait for OA tlb invalidate timed out\n"); } /** diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 79ae9654dac9..95725e61d9f1 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h @@ -693,6 +693,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) #define OABUFFER_SIZE_8M (6 << 3) #define OABUFFER_SIZE_16M (7 << 3) +#define GEN12_OA_TLB_INV_CR _MMIO(0xceec) + /* Gen12 OAR unit */ #define GEN12_OAR_OACONTROL _MMIO(0x2960) #define GEN12_OAR_OACONTROL_COUNTER_FORMAT_SHIFT 1
On running several back to back perf capture sessions involving closing and opening the perf stream, invalid OA reports are seen in the beginning of the OA buffer in some sessions. Fix this by invalidating OA TLB when the perf stream is closed or disabled on gen12. Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com> --- drivers/gpu/drm/i915/i915_perf.c | 8 ++++++++ drivers/gpu/drm/i915/i915_reg.h | 2 ++ 2 files changed, 10 insertions(+)