OSDN Git Service

drm/i915: Split off pci_driver.remove() tail to drm_driver.release()
authorJanusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Thu, 30 May 2019 13:31:05 +0000 (15:31 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 31 May 2019 07:43:18 +0000 (08:43 +0100)
commit47bc28d7ee6d8378ba4451c43885cb3241302243
treea4f51c77c64a43b99fb5076df05ad3062e8f48a2
parent6501aa4e3a45075360e72784a48fcd5c32a4eb24
drm/i915: Split off pci_driver.remove() tail to drm_driver.release()

In order to support driver hot unbind, some cleanup operations, now
performed on PCI driver remove, must be called later, after all device
file descriptors are closed.

Split out those operations from the tail of pci_driver.remove()
callback and put them into drm_driver.release() which is called as soon
as all references to the driver are put.  As a result, those cleanups
will be now run on last drm_dev_put(), either still called from
pci_driver.remove() if all device file descriptors are already closed,
or on last drm_release() file operation.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190530133105.30467-1-janusz.krzysztofik@linux.intel.com
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c