Re: [PATCH v3] drm: Provide a driver hook for drm_dev_release()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jan 21, 2017 at 11:21:28PM +0200, Laurent Pinchart wrote:
> Hi Chris,
> 
> Thank you for the patch.
> 
> On Saturday 21 Jan 2017 10:58:25 Chris Wilson wrote:
> > Some state is coupled into the device lifetime outside of the
> > load/unload timeframe and requires teardown during final unreference
> > from drm_dev_release(). For example, dmabufs hold both a device and
> > module reference and may live longer than expected (i.e. the current
> > pattern of the driver tearing down its state and then releasing a
> > reference to the drm device) and yet touch driver private state when
> > destroyed.
> > 
> > v2: Export drm_dev_fini() and move the responsible for finalizing the
> > drm_device and freeing it to the release callback. (If no callback is
> > provided, the core will call drm_dev_fini() and kfree(dev) as before.)
> > v3: Remember to add drm_dev_fini() to drm_drv.h
> 
> This takes my comments into account, thank you for that. Do you have a patch 
> that shows usage of the release callback in a driver ?

I haven't yet dared start to split i915 between pci-device teardown and
system teardown, but
https://cgit.freedesktop.org/~ickle/linux-2.6/commit/?h=prescheduler&id=00a6ab3689ad09a0f2ea1df8e4a03a38721d2328
shows a use of driver->release to avoid the memory corruption with
dmabuf versus the virtual device. vgem should also provide a useful
example.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux