[PATCH 0/4] Cleanup and fixes in drmm_add_action_or_reset usage

Himal Prasad Ghimiray himal.prasad.ghimiray at intel.com
Fri Apr 12 08:02:38 UTC 2024


drmm_add_action_or_reset automatically triggers the corresponding action
if there's a failure. However, certain functions were previously relying
on return codes to trigger cleanup, leading to redundant calls. Removed
these functions to prevent multiple invocations.

In case of a failure, drmm_add_action_or_reset automatically triggers a
warning message, such as 'failed to add action "action_name" for
"drm_device".' Despite this, the driver was redundantly issuing similar
warning messages upon failure, offering no additional value. Remove these 
redundant warnings calls.

When encountering failures in sysfs creations or
drmm_add_action_or_reset, errors were previously suppressed. Now,
escalate these errors up the call chain, ensuring they are appropriately
handled in the caller.

Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Tejas Upadhyay <tejas.upadhyay at intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>
Cc: Niranjana Vishwanathapura <niranjana.vishwanathapura at intel.com>
Himal Prasad Ghimiray (4):
  drm/xe: Simplify function return using drmm_add_action_or_reset()
  drm/xe: Incase of action add failure, remove sysfs only once.
  drm/xe: Incase of action add failure, free_gsc_pkt only once.
  drm/xe: Return NULL incase of drmm_add_action_or_reset failure
  drm/xe/gt: Abort driver load for sysfs creation failure
  drm/xe/tile: Abort driver load for sysfs creation failure
  drm/xe/pm: Capture errors and handle them

 drivers/gpu/drm/xe/display/xe_display.c       |  8 +----
 drivers/gpu/drm/xe/xe_device.c                |  6 +---
 drivers/gpu/drm/xe/xe_device_sysfs.c          | 12 +++----
 drivers/gpu/drm/xe/xe_device_sysfs.h          |  2 +-
 drivers/gpu/drm/xe/xe_gsc_proxy.c             |  7 +---
 drivers/gpu/drm/xe/xe_gt.c                    | 27 ++++++++-------
 drivers/gpu/drm/xe/xe_gt_ccs_mode.c           | 17 ++++------
 drivers/gpu/drm/xe/xe_gt_ccs_mode.h           |  2 +-
 drivers/gpu/drm/xe/xe_gt_freq.c               | 29 ++++++++--------
 drivers/gpu/drm/xe/xe_gt_freq.h               |  2 +-
 drivers/gpu/drm/xe/xe_gt_idle.c               | 17 ++++------
 drivers/gpu/drm/xe/xe_gt_idle.h               |  2 +-
 drivers/gpu/drm/xe/xe_gt_sysfs.c              | 15 +++-----
 drivers/gpu/drm/xe/xe_gt_sysfs.h              |  2 +-
 drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c     | 11 +++---
 drivers/gpu/drm/xe/xe_gt_throttle_sysfs.h     |  2 +-
 drivers/gpu/drm/xe/xe_guc_pc.c                |  6 +---
 drivers/gpu/drm/xe/xe_huc.c                   |  9 +----
 drivers/gpu/drm/xe/xe_hw_engine.c             |  6 +---
 drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 28 +++++----------
 drivers/gpu/drm/xe/xe_pm.c                    | 34 +++++++++++++++----
 drivers/gpu/drm/xe/xe_pm.h                    |  2 +-
 drivers/gpu/drm/xe/xe_tile.c                  |  2 +-
 drivers/gpu/drm/xe/xe_tile_sysfs.c            | 17 +++++-----
 drivers/gpu/drm/xe/xe_tile_sysfs.h            |  2 +-
 drivers/gpu/drm/xe/xe_vram_freq.c             | 21 +++++-------
 drivers/gpu/drm/xe/xe_vram_freq.h             |  2 +-
 27 files changed, 125 insertions(+), 165 deletions(-)

-- 
2.25.1



More information about the Intel-xe mailing list