Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> writes: > On Tue, May 16, 2017 at 04:38:01PM +0300, Mika Kuoppala wrote: >> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes: >> >> > Ville found a reference to WaMediaResetBeforeFullReset which we presume >> > means that we should simply do the media reset first. >> >> Yesterday I reordered the resets but I recall it didnt help. >> I will retry but regardless yeah resetting media first makes >> sense. >> >> > >> > References: https://bugs.freedesktop.org/show_bug.cgi?id=100942 >> > Suggested-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> >> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> >> > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> >> > Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> >> > --- >> > drivers/gpu/drm/i915/intel_uncore.c | 12 ++++++------ >> > 1 file changed, 6 insertions(+), 6 deletions(-) >> > >> > diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c >> > index fc3da0a6fdbb..c3d0d81b50e4 100644 >> > --- a/drivers/gpu/drm/i915/intel_uncore.c >> > +++ b/drivers/gpu/drm/i915/intel_uncore.c >> > @@ -1504,12 +1504,6 @@ static int g4x_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask) >> > struct pci_dev *pdev = dev_priv->drm.pdev; >> > int ret; >> > >> > - pci_write_config_byte(pdev, I915_GDRST, >> > - GRDOM_RENDER | GRDOM_RESET_ENABLE); >> > - ret = wait_for(g4x_reset_complete(pdev), 500); >> > - if (ret) >> > - goto out; >> > - >> > /* WaVcpClkGateDisableForMediaReset:ctg,elk */ >> > I915_WRITE(VDECCLK_GATE_D, I915_READ(VDECCLK_GATE_D) | VCP_UNIT_CLOCK_GATE_DISABLE); >> > POSTING_READ(VDECCLK_GATE_D); >> > @@ -1517,11 +1511,17 @@ static int g4x_do_reset(struct drm_i915_private *dev_priv, unsigned engine_mask) >> > pci_write_config_byte(pdev, I915_GDRST, >> > GRDOM_MEDIA | GRDOM_RESET_ENABLE); >> > ret = wait_for(g4x_reset_complete(pdev), 500); >> > + if (ret) >> > + goto out; >> > >> >> We should restore the WaVcp... state if we fail. Not that it >> was right to begin with. > > I had it that way so that one could figure out which part of the reset > failed by examining the registers afterwards. If we change that then > we should add more debug/error prints to let us know exactly what failed. > Well with that explanation, Reviewed-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxx> Sadly, the reset can still fail even with this applied. -Mika >> >> -Mika >> >> > /* WaVcpClkGateDisableForMediaReset:ctg,elk */ >> > I915_WRITE(VDECCLK_GATE_D, I915_READ(VDECCLK_GATE_D) & ~VCP_UNIT_CLOCK_GATE_DISABLE); >> > POSTING_READ(VDECCLK_GATE_D); >> > >> > + pci_write_config_byte(pdev, I915_GDRST, >> > + GRDOM_RENDER | GRDOM_RESET_ENABLE); >> > + ret = wait_for(g4x_reset_complete(pdev), 500); >> > + >> > out: >> > pci_write_config_byte(pdev, I915_GDRST, 0); >> > return ret; >> > -- >> > 2.11.0 > > -- > Ville Syrjälä > Intel OTC _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx