drm/xe: Add callback support for driver remove
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 13 Feb 2025 19:28:57 +0000 (11:28 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 14 Feb 2025 19:39:29 +0000 (11:39 -0800)
commit776e3b502b6e49b1a72507d1a01a9b49d67fd843
tree173b189d51b46d40288df602bb8c5a223fcb1c5a
parent6884d2051011f4db9e2f0b85709c79a8ced13bd6
drm/xe: Add callback support for driver remove

xe device probe uses devm cleanup in most places. However there are a
few cases where this is not possible: when the driver interacts with
component add/del. In that case, the resource group would be cleanup
while the entire device resources are in the process of cleanup.  One
example is the xe_gsc_proxy and display using that to interact with mei
and audio.

Add a callback-based remove so the exception doesn't make the probe
use multiple error handling styles.

v2: Change internal API to mimic the devm API. This will make it easier
    to migrate in future when devm can be used.

Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250213192909.996148-1-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_device.h
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_pci.c