Skip to contentSkip to conversation

drm/scheduler: fix drm_sched_job_add_implicit_dependencies

PATCH In review Christian König 3 participants 5 messages Oct 19, 2021

Subsystems (3)
lore
Share & tools
lore

Christian König

author reviewer
#0 lore raw

PATCH 1/1 drm/scheduler: fix drm_sched_job_add_implicit_dependencies

Trivial fix since we now need to grab a reference to the fence we have added. Previously the dma_resv function where doing that for us.

Fixes 9c2ba265352a drm/scheduler: ("use new iterator in drm_sched_job_add_implicit_dependencies v2")
---
 drivers/gpu/drm/scheduler/sched_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/scheduler/sched_main.c +3 -0
index 5bc5f775abe1..94fe51b3caa2 100644
@@ -707,6 +707,9 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
 		ret = drm_sched_job_add_dependency(job, fence);
 		if (ret)
 			return ret;
+
+		/* Make sure to grab an additional ref on the added fence */
+		dma_fence_get(fence);
 	}
 	return 0;
 }
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Christian König

Trivial fix since we now need to grab a reference to the fence we have added. Previously the dma_resv function where doing that for us.

Fixes 9c2ba265352a drm/scheduler: ("use new iterator in drm_sched_job_add_implicit_dependencies v2")

Uh I completely missed checking for that. Did you review all other conversions you've pushed for this kind of bug?

Also

References: https://lore.kernel.org/dri-devel/2023306.UmlnhvANQh@archbook/

It's important to credit bug reporters! Also upgrade to t-b if Nicolas gets around to testing quickly.

Cheers, Daniel

Quoted 21 lines
---
 drivers/gpu/drm/scheduler/sched_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/scheduler/sched_main.c +3 -0
index 5bc5f775abe1..94fe51b3caa2 100644
@@ -707,6 +707,9 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
 		ret = drm_sched_job_add_dependency(job, fence);
 		if (ret)
 			return ret;
+
+		/* Make sure to grab an additional ref on the added fence */
+		dma_fence_get(fence);
 	}
 	return 0;
 }
Signature · 1 line
2.25.1
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
author reviewer
#2 lore raw

Am 19.10.21 um 14:35 schrieb Daniel Vetter:

Quoted 8 lines · Christian König
Quoted 5 lines

Trivial fix since we now need to grab a reference to the fence we have added. Previously the dma_resv function where doing that for us.

Fixes 9c2ba265352a drm/scheduler: ("use new iterator in drm_sched_job_add_implicit_dependencies v2")

Uh I completely missed checking for that. Did you review all other conversions you've pushed for this kind of bug?

Yeah, currently double checking that.

Quoted 9 lines

Also

References: https://lore.kernel.org/dri-devel/2023306.UmlnhvANQh@archbook/

It's important to credit bug reporters! Also upgrade to t-b if Nicolas gets around to testing quickly.

Yeah, the credit part is certainly correct. I just usually ask people before adding their mail address to kernel commits because of the spam you get :)

Cheers,
Christian.

Quoted 24 lines

Cheers, Daniel

Quoted 21 lines
---
  drivers/gpu/drm/scheduler/sched_main.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/scheduler/sched_main.c +3 -0
index 5bc5f775abe1..94fe51b3caa2 100644
@@ -707,6 +707,9 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
  		ret = drm_sched_job_add_dependency(job, fence);
  		if (ret)
  			return ret;
+
+		/* Make sure to grab an additional ref on the added fence */
+		dma_fence_get(fence);
  	}
  	return 0;
  }
Signature · 1 line
2.25.1
#3 lore raw
Quoted 23 lines · On Dienstag, 19. Oktober 2021 15:06:31 CEST Christian König wrote:

Am 19.10.21 um 14:35 schrieb Daniel Vetter:

Quoted 8 lines · Christian König
Quoted 5 lines

Trivial fix since we now need to grab a reference to the fence we have added. Previously the dma_resv function where doing that for us.

Fixes 9c2ba265352a drm/scheduler: ("use new iterator in drm_sched_job_add_implicit_dependencies v2")

Uh I completely missed checking for that. Did you review all other conversions you've pushed for this kind of bug?

Yeah, currently double checking that.

Quoted 9 lines

Also

References: https://lore.kernel.org/dri-devel/2023306.UmlnhvANQh@archbook/

It's important to credit bug reporters! Also upgrade to t-b if Nicolas gets around to testing quickly.

Quoted 6 lines

Yeah, the credit part is certainly correct. I just usually ask people before adding their mail address to kernel commits because of the spam you get :)

Cheers,
Christian.

No worries, I made this e-mail address specifically for kernel work due to this. I wouldn't even dare posting on public mailing lists with my regular e-mail address.

Regards,
Nicolas Frattaroli

Quoted 25 lines
Quoted 23 lines

Cheers, Daniel

Quoted 19 lines
---
  drivers/gpu/drm/scheduler/sched_main.c | 3 +++
  1 file changed, 3 insertions(+)
drivers/gpu/drm/scheduler/sched_main.c +3 -0
index 5bc5f775abe1..94fe51b3caa2 100644
@@ -707,6 +707,9 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
  		ret = drm_sched_job_add_dependency(job, fence);
  		if (ret)
  			return ret;
+
+		/* Make sure to grab an additional ref on the added fence */
+		dma_fence_get(fence);
  	}
  	return 0;
  }
Tested-by on v1 1/1
#4 lore raw
In reply to Christian König
Quoted 15 lines · On Dienstag, 19. Oktober 2021 13:27:06 CEST Christian König wrote:

Trivial fix since we now need to grab a reference to the fence we have added. Previously the dma_resv function where doing that for us.

Fixes 9c2ba265352a drm/scheduler: ("use new iterator in drm_sched_job_add_implicit_dependencies v2")
---
 drivers/gpu/drm/scheduler/sched_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/scheduler/sched_main.c +0 -0
index 5bc5f775abe1..94fe51b3caa2 100644

drivers/gpu/drm/scheduler/sched_main.c int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job, · line 715

Quoted 9 lines
drivers/gpu/drm/scheduler/sched_main.c +3 -0
@@ -707,6 +707,9 @@ int drm_sched_job_add_implicit_dependencies(struct drm_sched_job *job,
 		ret = drm_sched_job_add_dependency(job, fence);
 		if (ret)
 			return ret;
+
+		/* Make sure to grab an additional ref on the added fence */
+		dma_fence_get(fence);
 	}
 	return 0;
 }

Fixes it, thank you!