[2/6] drm/i915: move gt_cleanup_early out of gem_cleanup_early
diff mbox series

Message ID 20190729234727.28286-3-daniele.ceraolospurio@intel.com
State New
Headers show
Series
  • Call uC functions from GT ones
Related show

Commit Message

Daniele Ceraolo Spurio July 29, 2019, 11:47 p.m. UTC
We don't call the init_early function from within the gem code, so we
shouldn't do it for the cleanup either.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 2 ++
 drivers/gpu/drm/i915/i915_gem.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Tvrtko Ursulin July 30, 2019, 7:19 a.m. UTC | #1
On 30/07/2019 00:47, Daniele Ceraolo Spurio wrote:
> We don't call the init_early function from within the gem code, so we
> shouldn't do it for the cleanup either.
> 
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_drv.c | 2 ++
>   drivers/gpu/drm/i915/i915_gem.c | 2 --
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index f2d3d754af37..934e605e2466 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -951,6 +951,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
>   	intel_uc_cleanup_early(&dev_priv->gt.uc);
>   	i915_gem_cleanup_early(dev_priv);
>   err_workqueues:
> +	intel_gt_cleanup_early(&dev_priv->gt);
>   	i915_workqueues_cleanup(dev_priv);
>   	return ret;
>   }
> @@ -966,6 +967,7 @@ static void i915_driver_late_release(struct drm_i915_private *dev_priv)
>   	intel_power_domains_cleanup(dev_priv);
>   	intel_uc_cleanup_early(&dev_priv->gt.uc);
>   	i915_gem_cleanup_early(dev_priv);
> +	intel_gt_cleanup_early(&dev_priv->gt);
>   	i915_workqueues_cleanup(dev_priv);
>   
>   	pm_qos_remove_request(&dev_priv->sb_qos);
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index ae4e7cc3e3f9..2c7dc3404759 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1674,8 +1674,6 @@ void i915_gem_cleanup_early(struct drm_i915_private *dev_priv)
>   	GEM_BUG_ON(atomic_read(&dev_priv->mm.free_count));
>   	WARN_ON(dev_priv->mm.shrink_count);
>   
> -	intel_gt_cleanup_early(&dev_priv->gt);
> -
>   	i915_gemfs_fini(dev_priv);
>   }
>   
> 

I have a nagging feeling it was me who added this asymmetry.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
Chris Wilson July 30, 2019, 8:01 a.m. UTC | #2
Quoting Tvrtko Ursulin (2019-07-30 08:19:18)
> 
> On 30/07/2019 00:47, Daniele Ceraolo Spurio wrote:
> > We don't call the init_early function from within the gem code, so we
> > shouldn't do it for the cleanup either.
> > 
> > Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> > ---
> >   drivers/gpu/drm/i915/i915_drv.c | 2 ++
> >   drivers/gpu/drm/i915/i915_gem.c | 2 --
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index f2d3d754af37..934e605e2466 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -951,6 +951,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
> >       intel_uc_cleanup_early(&dev_priv->gt.uc);
> >       i915_gem_cleanup_early(dev_priv);
> >   err_workqueues:
> > +     intel_gt_cleanup_early(&dev_priv->gt);
> >       i915_workqueues_cleanup(dev_priv);
> >       return ret;
> >   }
> > @@ -966,6 +967,7 @@ static void i915_driver_late_release(struct drm_i915_private *dev_priv)
> >       intel_power_domains_cleanup(dev_priv);
> >       intel_uc_cleanup_early(&dev_priv->gt.uc);
> >       i915_gem_cleanup_early(dev_priv);
> > +     intel_gt_cleanup_early(&dev_priv->gt);

Note the change in naming convention, intel_gt_driver_late_release().
-Chris
Daniele Ceraolo Spurio July 30, 2019, 2:56 p.m. UTC | #3
On 7/30/19 1:01 AM, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2019-07-30 08:19:18)
>>
>> On 30/07/2019 00:47, Daniele Ceraolo Spurio wrote:
>>> We don't call the init_early function from within the gem code, so we
>>> shouldn't do it for the cleanup either.
>>>
>>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
>>> ---
>>>    drivers/gpu/drm/i915/i915_drv.c | 2 ++
>>>    drivers/gpu/drm/i915/i915_gem.c | 2 --
>>>    2 files changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>>> index f2d3d754af37..934e605e2466 100644
>>> --- a/drivers/gpu/drm/i915/i915_drv.c
>>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>>> @@ -951,6 +951,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
>>>        intel_uc_cleanup_early(&dev_priv->gt.uc);
>>>        i915_gem_cleanup_early(dev_priv);
>>>    err_workqueues:
>>> +     intel_gt_cleanup_early(&dev_priv->gt);
>>>        i915_workqueues_cleanup(dev_priv);
>>>        return ret;
>>>    }
>>> @@ -966,6 +967,7 @@ static void i915_driver_late_release(struct drm_i915_private *dev_priv)
>>>        intel_power_domains_cleanup(dev_priv);
>>>        intel_uc_cleanup_early(&dev_priv->gt.uc);
>>>        i915_gem_cleanup_early(dev_priv);
>>> +     intel_gt_cleanup_early(&dev_priv->gt);
> 
> Note the change in naming convention, intel_gt_driver_late_release().
> -Chris
> 

Does it make sense to flip only the gt function? it'd look terribly out 
of place close to all those other cleanup_early() calls. I can follow up 
with a patch to flip them all at the same time if that works for you.

Daniele
Chris Wilson July 30, 2019, 3:12 p.m. UTC | #4
Quoting Daniele Ceraolo Spurio (2019-07-30 15:56:57)
> 
> 
> On 7/30/19 1:01 AM, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2019-07-30 08:19:18)
> >>
> >> On 30/07/2019 00:47, Daniele Ceraolo Spurio wrote:
> >>> We don't call the init_early function from within the gem code, so we
> >>> shouldn't do it for the cleanup either.
> >>>
> >>> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> >>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> >>> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> >>> ---
> >>>    drivers/gpu/drm/i915/i915_drv.c | 2 ++
> >>>    drivers/gpu/drm/i915/i915_gem.c | 2 --
> >>>    2 files changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> >>> index f2d3d754af37..934e605e2466 100644
> >>> --- a/drivers/gpu/drm/i915/i915_drv.c
> >>> +++ b/drivers/gpu/drm/i915/i915_drv.c
> >>> @@ -951,6 +951,7 @@ static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
> >>>        intel_uc_cleanup_early(&dev_priv->gt.uc);
> >>>        i915_gem_cleanup_early(dev_priv);
> >>>    err_workqueues:
> >>> +     intel_gt_cleanup_early(&dev_priv->gt);
> >>>        i915_workqueues_cleanup(dev_priv);
> >>>        return ret;
> >>>    }
> >>> @@ -966,6 +967,7 @@ static void i915_driver_late_release(struct drm_i915_private *dev_priv)
> >>>        intel_power_domains_cleanup(dev_priv);
> >>>        intel_uc_cleanup_early(&dev_priv->gt.uc);
> >>>        i915_gem_cleanup_early(dev_priv);
> >>> +     intel_gt_cleanup_early(&dev_priv->gt);
> > 
> > Note the change in naming convention, intel_gt_driver_late_release().
> > -Chris
> > 
> 
> Does it make sense to flip only the gt function? it'd look terribly out 
> of place close to all those other cleanup_early() calls. I can follow up 
> with a patch to flip them all at the same time if that works for you.

Baby steps, the consistency is in the function callgraphs -- it looks
out of place to have late_release call cleanup_early :)
-Chris

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index f2d3d754af37..934e605e2466 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -951,6 +951,7 @@  static int i915_driver_early_probe(struct drm_i915_private *dev_priv)
 	intel_uc_cleanup_early(&dev_priv->gt.uc);
 	i915_gem_cleanup_early(dev_priv);
 err_workqueues:
+	intel_gt_cleanup_early(&dev_priv->gt);
 	i915_workqueues_cleanup(dev_priv);
 	return ret;
 }
@@ -966,6 +967,7 @@  static void i915_driver_late_release(struct drm_i915_private *dev_priv)
 	intel_power_domains_cleanup(dev_priv);
 	intel_uc_cleanup_early(&dev_priv->gt.uc);
 	i915_gem_cleanup_early(dev_priv);
+	intel_gt_cleanup_early(&dev_priv->gt);
 	i915_workqueues_cleanup(dev_priv);
 
 	pm_qos_remove_request(&dev_priv->sb_qos);
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index ae4e7cc3e3f9..2c7dc3404759 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1674,8 +1674,6 @@  void i915_gem_cleanup_early(struct drm_i915_private *dev_priv)
 	GEM_BUG_ON(atomic_read(&dev_priv->mm.free_count));
 	WARN_ON(dev_priv->mm.shrink_count);
 
-	intel_gt_cleanup_early(&dev_priv->gt);
-
 	i915_gemfs_fini(dev_priv);
 }