Re: [PATCH 1/2] drm/v3d: wait for all jobs to finish before unregistering

2023-10-30 Thread Maira Canal

Hi Iago,

On 10/30/23 09:20, Iago Toral wrote:

El mar, 24-10-2023 a las 07:05 -0300, Maira Canal escribió:

Hi Iago,

On 10/24/23 02:57, Iago Toral wrote:

El lun, 23-10-2023 a las 07:58 -0300, Maíra Canal escribió:

Currently, we are only warning the user if the BIN or RENDER jobs
don't
finish before we unregister V3D. We must wait for all jobs to
finish
before unregistering. Therefore, warn the user if TFU or CSD jobs
are not done by the time the driver is unregistered.

Signed-off-by: Maíra Canal 
---
   drivers/gpu/drm/v3d/v3d_gem.c | 2 ++
   1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c
b/drivers/gpu/drm/v3d/v3d_gem.c
index 2e94ce788c71..afa7d170d1ff 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -1072,6 +1072,8 @@ v3d_gem_destroy(struct drm_device *dev)
   */
  WARN_ON(v3d->bin_job);
  WARN_ON(v3d->render_job);
+   WARN_ON(v3d->tfu_job);
+   WARN_ON(v3d->csd_job);


I guess we should do this for cache clean jobs too, right?


As the cache clean jobs are synchronous, we don't keep track of the
current cache clean job. When I say that the cache clean jobs are
synchronous, it means that the end of the job is not determined by
an interruption. Therefore, there is no need to make sure that the
cache clean jobs are still running.


I see, thanks Maíra.

Reviewed-by: Iago Toral Quiroga 


Applied to drm-misc/drm-misc-next!

Thanks,
- Maíra





Best Regards,
- Maíra



Iago

   
  drm_mm_takedown(>mm);
   








Re: [PATCH 1/2] drm/v3d: wait for all jobs to finish before unregistering

2023-10-30 Thread Iago Toral
El mar, 24-10-2023 a las 07:05 -0300, Maira Canal escribió:
> Hi Iago,
> 
> On 10/24/23 02:57, Iago Toral wrote:
> > El lun, 23-10-2023 a las 07:58 -0300, Maíra Canal escribió:
> > > Currently, we are only warning the user if the BIN or RENDER jobs
> > > don't
> > > finish before we unregister V3D. We must wait for all jobs to
> > > finish
> > > before unregistering. Therefore, warn the user if TFU or CSD jobs
> > > are not done by the time the driver is unregistered.
> > > 
> > > Signed-off-by: Maíra Canal 
> > > ---
> > >   drivers/gpu/drm/v3d/v3d_gem.c | 2 ++
> > >   1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/drivers/gpu/drm/v3d/v3d_gem.c
> > > b/drivers/gpu/drm/v3d/v3d_gem.c
> > > index 2e94ce788c71..afa7d170d1ff 100644
> > > --- a/drivers/gpu/drm/v3d/v3d_gem.c
> > > +++ b/drivers/gpu/drm/v3d/v3d_gem.c
> > > @@ -1072,6 +1072,8 @@ v3d_gem_destroy(struct drm_device *dev)
> > >   */
> > >  WARN_ON(v3d->bin_job);
> > >  WARN_ON(v3d->render_job);
> > > +   WARN_ON(v3d->tfu_job);
> > > +   WARN_ON(v3d->csd_job);
> > 
> > I guess we should do this for cache clean jobs too, right?
> 
> As the cache clean jobs are synchronous, we don't keep track of the
> current cache clean job. When I say that the cache clean jobs are
> synchronous, it means that the end of the job is not determined by
> an interruption. Therefore, there is no need to make sure that the
> cache clean jobs are still running.

I see, thanks Maíra.

Reviewed-by: Iago Toral Quiroga 

> 
> Best Regards,
> - Maíra
> 
> > 
> > Iago
> > 
> > >   
> > >  drm_mm_takedown(>mm);
> > >   
> > 
> 



Re: [PATCH 1/2] drm/v3d: wait for all jobs to finish before unregistering

2023-10-24 Thread Maira Canal

Hi Iago,

On 10/24/23 02:57, Iago Toral wrote:

El lun, 23-10-2023 a las 07:58 -0300, Maíra Canal escribió:

Currently, we are only warning the user if the BIN or RENDER jobs
don't
finish before we unregister V3D. We must wait for all jobs to finish
before unregistering. Therefore, warn the user if TFU or CSD jobs
are not done by the time the driver is unregistered.

Signed-off-by: Maíra Canal 
---
  drivers/gpu/drm/v3d/v3d_gem.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c
b/drivers/gpu/drm/v3d/v3d_gem.c
index 2e94ce788c71..afa7d170d1ff 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -1072,6 +1072,8 @@ v3d_gem_destroy(struct drm_device *dev)
  */
 WARN_ON(v3d->bin_job);
 WARN_ON(v3d->render_job);
+   WARN_ON(v3d->tfu_job);
+   WARN_ON(v3d->csd_job);


I guess we should do this for cache clean jobs too, right?


As the cache clean jobs are synchronous, we don't keep track of the
current cache clean job. When I say that the cache clean jobs are
synchronous, it means that the end of the job is not determined by
an interruption. Therefore, there is no need to make sure that the
cache clean jobs are still running.

Best Regards,
- Maíra



Iago

  
 drm_mm_takedown(>mm);
  




Re: [PATCH 1/2] drm/v3d: wait for all jobs to finish before unregistering

2023-10-23 Thread Iago Toral
El lun, 23-10-2023 a las 07:58 -0300, Maíra Canal escribió:
> Currently, we are only warning the user if the BIN or RENDER jobs
> don't
> finish before we unregister V3D. We must wait for all jobs to finish
> before unregistering. Therefore, warn the user if TFU or CSD jobs
> are not done by the time the driver is unregistered.
> 
> Signed-off-by: Maíra Canal 
> ---
>  drivers/gpu/drm/v3d/v3d_gem.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_gem.c
> b/drivers/gpu/drm/v3d/v3d_gem.c
> index 2e94ce788c71..afa7d170d1ff 100644
> --- a/drivers/gpu/drm/v3d/v3d_gem.c
> +++ b/drivers/gpu/drm/v3d/v3d_gem.c
> @@ -1072,6 +1072,8 @@ v3d_gem_destroy(struct drm_device *dev)
>  */
> WARN_ON(v3d->bin_job);
> WARN_ON(v3d->render_job);
> +   WARN_ON(v3d->tfu_job);
> +   WARN_ON(v3d->csd_job);

I guess we should do this for cache clean jobs too, right?

Iago

>  
> drm_mm_takedown(>mm);
>  



[PATCH 1/2] drm/v3d: wait for all jobs to finish before unregistering

2023-10-23 Thread Maíra Canal
Currently, we are only warning the user if the BIN or RENDER jobs don't
finish before we unregister V3D. We must wait for all jobs to finish
before unregistering. Therefore, warn the user if TFU or CSD jobs
are not done by the time the driver is unregistered.

Signed-off-by: Maíra Canal 
---
 drivers/gpu/drm/v3d/v3d_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
index 2e94ce788c71..afa7d170d1ff 100644
--- a/drivers/gpu/drm/v3d/v3d_gem.c
+++ b/drivers/gpu/drm/v3d/v3d_gem.c
@@ -1072,6 +1072,8 @@ v3d_gem_destroy(struct drm_device *dev)
 */
WARN_ON(v3d->bin_job);
WARN_ON(v3d->render_job);
+   WARN_ON(v3d->tfu_job);
+   WARN_ON(v3d->csd_job);
 
drm_mm_takedown(>mm);
 
-- 
2.41.0