drm/v3d: wait for all jobs to finish before unregistering
Subsystems (3)
Maíra Canal
maintainerPATCH 1/2 drm/v3d: wait for all jobs to finish before unregistering
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.
--- drivers/gpu/drm/v3d/v3d_gem.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/v3d/v3d_gem.c +2 -0
@@ -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 (&v3d->mm);
Signature · 1 line
2.41.0
Maíra Canal
maintainerPATCH 2/2 drm/v3d: assure that the job is NULL after being freed
After the job is finished and freed, we need to make sure that the job is NULL. Otherwise, we would get a warning when unloading the driver, as it would look like the job still exists. Therefore, after freeing the job, let's assign it to NULL in order to indicate that the job has finished.
--- drivers/gpu/drm/v3d/v3d_gem.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/v3d/v3d_gem.c +1 -0
@@ -333,6 +333,7 @@ v3d_job_free(struct kref *ref)v3d_perfmon_put (job->perfmon);kfree (job); + job =NULL ; } static void
--
2.41.0
Quoted 17 lines · 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 <[email protected]>---
drivers/gpu/drm/v3d/v3d_gem.c | 2 ++1 file changed, 2 insertions(+)drivers/gpu/drm/v3d/v3d_gem.c +0
-0
drivers/gpu/drm/v3d/v3d_gem.c v3d_gem_destroy(struct drm_device *dev) · line 1076
Quoted 5 lines
drivers/gpu/drm/v3d/v3d_gem.c +2
-0@@ -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
Quoted 3 lines
drm_mm_takedown(&v3d->mm);
Maira Canal
maintainerHi Iago,
Quoted 12 lines · Iago Toral
Quoted 11 lines · 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 <[email protected]>--- drivers/gpu/drm/v3d/v3d_gem.c | 2 ++ 1 file changed, 2 insertions(+)
Quoted 13 lines
drivers/gpu/drm/v3d/v3d_gem.c v3d_gem_destroy(struct drm_device *dev) · line 1076
Quoted 11 lines
drivers/gpu/drm/v3d/v3d_gem.c +2
-0@@ -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
Quoted 7 lines
Iago
Quoted 3 lines
drivers/gpu/drm/v3d/v3d_gem.c +0
-0drm_mm_takedown(&v3d->mm);
Iago Toral
Reviewed-byQuoted 30 lines · Maira Canal
Hi Iago,
Quoted 13 lines · Iago Toral
Quoted 12 lines · 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 <[email protected]>---
drivers/gpu/drm/v3d/v3d_gem.c | 2 ++1 file changed, 2 insertions(+)Quoted 13 lines
drivers/gpu/drm/v3d/v3d_gem.c v3d_gem_destroy(struct drm_device *dev) · line 1076
Quoted 11 lines
drivers/gpu/drm/v3d/v3d_gem.c +2
-0@@ -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?
Quoted 5 lines
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.
Quoted 12 lines
Best Regards,
- MaíraQuoted 7 lines
Iago
Quoted 3 lines
drm_mm_takedown(&v3d->mm);
Hi Iago,
Quoted 37 lines · Iago Toral
Quoted 30 lines · Maira Canal
Hi Iago,
Quoted 13 lines · Iago Toral
Quoted 12 lines · 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 <[email protected]>--- drivers/gpu/drm/v3d/v3d_gem.c | 2 ++ 1 file changed, 2 insertions(+)Quoted 13 lines
drivers/gpu/drm/v3d/v3d_gem.c v3d_gem_destroy(struct drm_device *dev) · line 1076
Quoted 11 lines
drivers/gpu/drm/v3d/v3d_gem.c +2
-0@@ -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?
Quoted 5 lines
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.
Quoted 3 lines
I see, thanks Maíra.
Reviewed-by Iago Toral Quiroga <[email protected]>
Applied to drm-misc/drm-misc-next!
Thanks,
- Maíra
Quoted 14 lines
Quoted 13 lines
Best Regards,
- MaíraQuoted 7 lines
Iago
Quoted 3 lines
drivers/gpu/drm/v3d/v3d_gem.c +0
-0drm_mm_takedown(&v3d->mm);