diff mbox

drm/i915/gvt: Implement WaForceWakeRenderDuringMmioTLBInvalidate

Message ID 1476961051-26991-1-git-send-email-arkadiusz.hiler@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arkadiusz Hiler Oct. 20, 2016, 10:57 a.m. UTC
When invalidating RCS TLB the device can enter RC6 state interrupting
the process, therefore the need for render forcewake for the whole
procedure.

This WA is needed for all production SKL SKUs.

References: HSD#2136899, HSD#1404391274
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 drivers/gpu/drm/i915/gvt/render.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Arkadiusz Hiler Oct. 20, 2016, 11:52 a.m. UTC | #1
On Thu, Oct 20, 2016 at 11:17:09AM +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915/gvt: Implement WaForceWakeRenderDuringMmioTLBInvalidate
> URL   : https://patchwork.freedesktop.org/series/14097/
> State : warning
> 
> == Summary ==
> 
> Series 14097v1 drm/i915/gvt: Implement WaForceWakeRenderDuringMmioTLBInvalidate
> https://patchwork.freedesktop.org/api/1.0/series/14097/revisions/1/mbox/
> 
> Test drv_module_reload_basic:
>                 dmesg-warn -> PASS       (fi-skl-6700hq)
> Test gem_exec_suspend:
>         Subgroup basic-s3:
>                 pass       -> DMESG-WARN (fi-skl-6700hq)
> Test kms_pipe_crc_basic:
>         Subgroup suspend-read-crc-pipe-a:
>                 pass       -> DMESG-WARN (fi-skl-6700hq)
>         Subgroup suspend-read-crc-pipe-b:
>                 pass       -> DMESG-WARN (fi-skl-6700hq)
>         Subgroup suspend-read-crc-pipe-c:
>                 pass       -> DMESG-WARN (fi-skl-6700hq)

Seems to not be related to the change made.
Ville Syrjälä Oct. 20, 2016, 12:04 p.m. UTC | #2
On Thu, Oct 20, 2016 at 01:52:32PM +0200, Arkadiusz Hiler wrote:
> On Thu, Oct 20, 2016 at 11:17:09AM +0000, Patchwork wrote:
> > == Series Details ==
> > 
> > Series: drm/i915/gvt: Implement WaForceWakeRenderDuringMmioTLBInvalidate
> > URL   : https://patchwork.freedesktop.org/series/14097/
> > State : warning
> > 
> > == Summary ==
> > 
> > Series 14097v1 drm/i915/gvt: Implement WaForceWakeRenderDuringMmioTLBInvalidate
> > https://patchwork.freedesktop.org/api/1.0/series/14097/revisions/1/mbox/
> > 
> > Test drv_module_reload_basic:
> >                 dmesg-warn -> PASS       (fi-skl-6700hq)
> > Test gem_exec_suspend:
> >         Subgroup basic-s3:
> >                 pass       -> DMESG-WARN (fi-skl-6700hq)
> > Test kms_pipe_crc_basic:
> >         Subgroup suspend-read-crc-pipe-a:
> >                 pass       -> DMESG-WARN (fi-skl-6700hq)
> >         Subgroup suspend-read-crc-pipe-b:
> >                 pass       -> DMESG-WARN (fi-skl-6700hq)
> >         Subgroup suspend-read-crc-pipe-c:
> >                 pass       -> DMESG-WARN (fi-skl-6700hq)
> 
> Seems to not be related to the change made.

Please quote a bit of the error message(s) so that others might judge
that well, without having to open up the results themselves.
Arkadiusz Hiler Oct. 20, 2016, 12:55 p.m. UTC | #3
On Thu, Oct 20, 2016 at 03:04:44PM +0300, Ville Syrjälä wrote:
> On Thu, Oct 20, 2016 at 01:52:32PM +0200, Arkadiusz Hiler wrote:
> > On Thu, Oct 20, 2016 at 11:17:09AM +0000, Patchwork wrote:
> > > == Series Details ==
> > > 
> > > Series: drm/i915/gvt: Implement WaForceWakeRenderDuringMmioTLBInvalidate
> > > URL   : https://patchwork.freedesktop.org/series/14097/
> > > State : warning
> > > 
> > > == Summary ==
> > > 
> > > Series 14097v1 drm/i915/gvt: Implement WaForceWakeRenderDuringMmioTLBInvalidate
> > > https://patchwork.freedesktop.org/api/1.0/series/14097/revisions/1/mbox/
> > > 
> > > Test drv_module_reload_basic:
> > >                 dmesg-warn -> PASS       (fi-skl-6700hq)

[   36.853518] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon
[   36.853598] [drm:intel_ddi_init [i915]] *ERROR* LSPCON init failed on port B
[   36.884272] [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS
[   38.004158] Setting dangerous option inject_load_failure - tainting kernel
[   38.150495] Setting dangerous option inject_load_failure - tainting kernel
[   38.332735] Setting dangerous option inject_load_failure - tainting kernel
[   38.514716] Setting dangerous option inject_load_failure - tainting kernel
[   39.600354] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon
[   39.600434] [drm:intel_ddi_init [i915]] *ERROR* LSPCON init failed on port B
[   39.629926] [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS

> > > Test gem_exec_suspend:
> > >         Subgroup basic-s3:
> > >                 pass       -> DMESG-WARN (fi-skl-6700hq)


[  207.413322] done.
[  207.436017] Suspending console(s) (use no_console_suspend to debug)
[  207.440188] sd 2:0:0:0: [sda] Synchronizing SCSI cache
[  207.440837] sd 2:0:0:0: [sda] Stopping disk
[  209.114203] Broke affinity for irq 124
                {  snip, for different irqs }
[  209.163837]  cache: parent cpu1 should not be sleeping
                {  snip, for all CPUs }
[  209.248422] ACPI : button: The lid device is not compliant to SW_LID.
[  209.344047] sd 2:0:0:0: [sda] Starting disk
[  209.518719] [drm:drm_lspcon_get_mode] *ERROR* LSPCON read(0x80, 0x41) failed
[  209.518733] [drm:lspcon_change_mode.constprop.2 [i915]] *ERROR* Error reading LSPCON mode
[  209.518744] [drm:lspcon_resume [i915]] *ERROR* LSPCON resume failed
[  209.994495] done.

> > > Test kms_pipe_crc_basic:
> > >         Subgroup suspend-read-crc-pipe-a:
> > >                 pass       -> DMESG-WARN (fi-skl-6700hq)
> > >         Subgroup suspend-read-crc-pipe-b:
> > >                 pass       -> DMESG-WARN (fi-skl-6700hq)
> > >         Subgroup suspend-read-crc-pipe-c:
> > >                 pass       -> DMESG-WARN (fi-skl-6700hq)

all three had the exact same as the one lspcon-related above

> > 
> > Seems to not be related to the change made.
> 
> Please quote a bit of the error message(s) so that others might judge
> that well, without having to open up the results themselves.

I'll remember to do that from now on. Thanks.
Ville Syrjälä Oct. 20, 2016, 2:47 p.m. UTC | #4
On Thu, Oct 20, 2016 at 12:57:31PM +0200, Arkadiusz Hiler wrote:
> When invalidating RCS TLB the device can enter RC6 state interrupting
> the process, therefore the need for render forcewake for the whole
> procedure.
> 
> This WA is needed for all production SKL SKUs.
> 
> References: HSD#2136899, HSD#1404391274
> Cc: Mika Kuoppala <mika.kuoppala@intel.com>
> Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/render.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/render.c b/drivers/gpu/drm/i915/gvt/render.c
> index f54ab85..f5000ea 100644
> --- a/drivers/gpu/drm/i915/gvt/render.c
> +++ b/drivers/gpu/drm/i915/gvt/render.c
> @@ -134,11 +134,22 @@ static void handle_tlb_pending_event(struct intel_vgpu *vgpu, int ring_id)
>  
>  	reg = _MMIO(regs[ring_id]);

Random drive by comment:
You should add the registers to i915_reg.h properly so that we don't get
this ugly _MMIO() stuff sprinkled all over the place.

>  
> +	/* WaForceWakeRenderDuringMmioTLBInvalidate:skl
> +	 * we need to put a forcewake when invalidating RCS TLB caches,
> +	 * otherwise device can go to RC6 state and interrupt invalidation
> +	 * process */
> +	if (IS_SKYLAKE(dev_priv) && ring_id == RCS)
> +		intel_uncore_forcewake_get(dev_priv, FORCEWAKE_RENDER);
> +
>  	I915_WRITE(reg, 0x1);
>  
>  	if (wait_for_atomic((I915_READ(reg) == 0), 50))
>  		gvt_err("timeout in invalidate ring (%d) tlb\n", ring_id);
>  
> +	if (IS_SKYLAKE(dev_priv) && ring_id == RCS)
> +		intel_uncore_forcewake_put(dev_priv, FORCEWAKE_RENDER);
> +
> +
>  	gvt_dbg_core("invalidate TLB for ring %d\n", ring_id);
>  }
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/gvt/render.c b/drivers/gpu/drm/i915/gvt/render.c
index f54ab85..f5000ea 100644
--- a/drivers/gpu/drm/i915/gvt/render.c
+++ b/drivers/gpu/drm/i915/gvt/render.c
@@ -134,11 +134,22 @@  static void handle_tlb_pending_event(struct intel_vgpu *vgpu, int ring_id)
 
 	reg = _MMIO(regs[ring_id]);
 
+	/* WaForceWakeRenderDuringMmioTLBInvalidate:skl
+	 * we need to put a forcewake when invalidating RCS TLB caches,
+	 * otherwise device can go to RC6 state and interrupt invalidation
+	 * process */
+	if (IS_SKYLAKE(dev_priv) && ring_id == RCS)
+		intel_uncore_forcewake_get(dev_priv, FORCEWAKE_RENDER);
+
 	I915_WRITE(reg, 0x1);
 
 	if (wait_for_atomic((I915_READ(reg) == 0), 50))
 		gvt_err("timeout in invalidate ring (%d) tlb\n", ring_id);
 
+	if (IS_SKYLAKE(dev_priv) && ring_id == RCS)
+		intel_uncore_forcewake_put(dev_priv, FORCEWAKE_RENDER);
+
+
 	gvt_dbg_core("invalidate TLB for ring %d\n", ring_id);
 }