Re: [PATCH 2/4] drm/i915/guc: Move GuC workqueue allocations outside of the mutex

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

 



Quoting Michał Winiarski (2017-12-11 15:12:54)
> @@ -1256,20 +1214,20 @@ int intel_guc_submission_init(struct intel_guc *guc)
>         if (ret < 0)
>                 goto err_stage_desc_pool;
>  
> -       ret = guc_preempt_work_create(guc);
> -       if (ret)
> -               goto err_log;
> -       GEM_BUG_ON(!guc->preempt_wq);
> -
>         ret = guc_ads_create(guc);
>         if (ret < 0)
> -               goto err_wq;
> +               goto err_log;
>         GEM_BUG_ON(!guc->ads_vma);
>  
> +       if (HAS_LOGICAL_RING_PREEMPTION(dev_priv)) {
> +               for_each_engine(engine, dev_priv, id) {
> +                       guc->preempt_work[id].engine = engine;
> +                       INIT_WORK(&guc->preempt_work[id].work, inject_preempt_context);
> +               }
> +       }
> +
>         return 0;
>  
> -err_wq:
> -       guc_preempt_work_destroy(guc);
>  err_log:
>         intel_guc_log_destroy(guc);
>  err_stage_desc_pool:
> @@ -1279,8 +1237,14 @@ int intel_guc_submission_init(struct intel_guc *guc)
>  
>  void intel_guc_submission_fini(struct intel_guc *guc)
>  {
> +       struct drm_i915_private *dev_priv = guc_to_i915(guc);
> +       struct intel_engine_cs *engine;
> +       enum intel_engine_id id;
> +
> +       for_each_engine(engine, dev_priv, id)
> +               cancel_work_sync(&guc->preempt_work[id].work);
> +

You should then unconditionally initialise the preempt_work[id].work as
well. Which isn't a problem as it is just pure initialisation and no
allocation.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://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