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 12:02:03PM +0100, Noralf Trønnes wrote:
> 
> Den 21.01.2017 11:58, skrev Chris Wilson:
> >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
> >
> >Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> >Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> >Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
> >---
> >  drivers/gpu/drm/drm_drv.c | 56 +++++++++++++++++++++++++++++++++--------------
> >  include/drm/drm_drv.h     | 11 ++++++++++
> >  2 files changed, 50 insertions(+), 17 deletions(-)
> >
> >diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> >index 1b11ab628da7..517718e4f6e4 100644
> >--- a/drivers/gpu/drm/drm_drv.c
> >+++ b/drivers/gpu/drm/drm_drv.c
> >@@ -553,6 +553,39 @@ int drm_dev_init(struct drm_device *dev,
> >  EXPORT_SYMBOL(drm_dev_init);
> >  /**
> >+ * drm_dev_fini - Finalize a dead DRM device
> >+ * @dev: DRM device
> >+ *
> >+ * Finalize a dead DRM device. This is the converse to drm_dev_init() and
> >+ * frees up all state allocated by it. All driver state should be finalized
> >+ * first. Note that this function does not free the @dev, that is left to the
> >+ * caller. drm_dev_fini() should only
> 
> Looks like the end of the sentence is missing.

Ah, started then moved it to the note about ref-count.
-Chris

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux