drm/xe/pm: Capture errors and handle them
authorHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Fri, 12 Apr 2024 18:12:11 +0000 (23:42 +0530)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 18 Apr 2024 20:30:24 +0000 (13:30 -0700)
commitc086bfc6ff4db73a39e7c9cc106f1ba7f0051be6
tree4fa988f2b945f32d89bddfeed58f7d04305be952
parente3d0839aa50175d9af99f84f8c03523a4e42d8a7
drm/xe/pm: Capture errors and handle them

xe_pm_init may encounter failures for various reasons, such as a failure
in initializing drmm_mutex, or when dealing with a d3cold-capable device
for vram_threshold sysfs creation and setting default threshold.
Presently, all these potential failures are disregarded.

Move d3cold.lock initialization to xe_pm_init_early and cause driver
abort if mutex initialization has failed.

For xe_pm_init failures cleanup the driver and return error code

-v2
Make mutex init cleaner (Lucas)

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240412181211.1155732-8-himal.prasad.ghimiray@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_device_sysfs.c
drivers/gpu/drm/xe/xe_device_sysfs.h
drivers/gpu/drm/xe/xe_pci.c
drivers/gpu/drm/xe/xe_pm.c
drivers/gpu/drm/xe/xe_pm.h