Re: [PATCH v2 1/2] drm/drm_crtc: ensure dma_fence_ops remain valid during device unbind

From: André Draszik

Date: Mon Jul 20 2026 - 08:15:18 EST


Hi Philipp,

(sorry for the slow reply).

On Thu, 2026-07-09 at 16:40 +0200, Philipp Stanner wrote:
> On Thu, 2026-07-09 at 15:19 +0100, André Draszik wrote:
> > Hi Philipp,
> >
> > On Thu, 2026-07-09 at 14:32 +0200, Philipp Stanner wrote:
> > >
> > > On Wed, 2026-07-08 at 16:22 +0100, André Draszik wrote:
> > >
> >

[...]

> > >
> The issue here seems to be that
> a) the crtc is made invalid in drm_crtc_cleanup() (memset(0))
> b) the drm_dev can disappear after drm_crtc_cleanup()
>
> Both issues stem from the fact that the fence callbacks can keep
> running into the driver.
>
> It is true that the fence, being refcounted, can stay alive, but none
> of the callbacks be invoked anymore, and your grace period wait
> fullfill.
>
> It is a strict dma_fence requirement that a fence issuer / producer
> signals all its fences before unload.

OK, I missed that. In that case, the patch should indeed be fine as-is.
I'll just do the (minor) updates as you had requested.

Thanks Philipp