Re: [PATCH 2/2] drm/i915: sanitize RPS resetting during GPU reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2014-11-20 19:01 GMT-02:00 Imre Deak <imre.deak@xxxxxxxxx>:
> Atm, we don't disable RPS interrupts and related work items before
> resetting the GPU. This may interfere with the following GPU
> initialization and cause RPS interrupts to show up in PM_IIR too early
> before calling gen6_enable_rps_interrupts() (triggering a WARN there).
>
> Solve this by disabling RPS interrupts and flushing any related work
> items before resetting the GPU.
>
> Reported-by: He, Shuang <shuang.he@xxxxxxxxx>
> Testcase: igt/gem_reset_stats/ban-render
> Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_drv.c |  5 ++++-
>  drivers/gpu/drm/i915/intel_pm.c | 14 +++++++++++++-
>  2 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 1df4079..93f3df8 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -810,6 +810,9 @@ int i915_reset(struct drm_device *dev)
>         if (!i915.reset)
>                 return 0;
>
> +       if (drm_core_check_feature(dev, DRIVER_MODESET))
> +               intel_reset_gt_powersave(dev);
> +
>         mutex_lock(&dev->struct_mutex);
>
>         i915_gem_reset(dev);
> @@ -879,7 +882,7 @@ int i915_reset(struct drm_device *dev)
>                  * of re-init after reset.
>                  */
>                 if (INTEL_INFO(dev)->gen > 5)
> -                       intel_reset_gt_powersave(dev);
> +                       intel_enable_gt_powersave(dev);
>         } else {
>                 mutex_unlock(&dev->struct_mutex);
>         }
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index e361014..9417f8f 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -6316,8 +6316,20 @@ void intel_reset_gt_powersave(struct drm_device *dev)
>  {
>         struct drm_i915_private *dev_priv = dev->dev_private;
>
> +       if (INTEL_INFO(dev)->gen < 6)
> +               return;
> +
> +       flush_delayed_work(&dev_priv->rps.delayed_resume_work);
> +
> +       /*
> +        * TODO: disable RPS interrupts on GEN9+ too once RPS support
> +        * is added for it.
> +        */
> +       if (INTEL_INFO(dev)->gen < 9)
> +               gen6_disable_rps_interrupts(dev);
> +
>         dev_priv->rps.enabled = false;
> -       intel_enable_gt_powersave(dev);

In the review of patch 1/2 you mentioned a problem on this patch, so I
guess you'll send a new version, but I just wanted to point that this
function is now very similar to intel_suspend_gt_powersave(), so maybe
there's some magic we could do to avoid the duplication. It's just an
idea, not a requirement.


> +
>  }
>
>  static void ibx_init_clock_gating(struct drm_device *dev)
> --
> 1.8.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Paulo Zanoni
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux