drm/xe: Do not take any action if our device was removed.
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 16 May 2023 14:54:07 +0000 (10:54 -0400)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:33:51 +0000 (18:33 -0500)
commit656d29506ca89b4af1d2380ff4cab15f40ae9e19
tree5fce3f82f03ddb6549e1e1a35aa7dd047f71a5bc
parente799485044cb3c0019a226ff3a92a532ca2a4e7e
drm/xe: Do not take any action if our device was removed.

Unfortunately devcoredump infrastructure does not provide and
interface for us to force the device removal upon the pci_remove
time of our device.

The devcoredump is linked at the device level, so when in use
it will prevent the module removal, but it doesn't prevent the
call of the pci_remove callback. This callback cannot fail
anyway and we end up clearing and freeing the entire pci device.

Hence, after we removed the pci device, we shouldn't allow any
read or free operations to avoid segmentation fault.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
drivers/gpu/drm/xe/xe_devcoredump.c