[PATCH v4 0/7] Cleanup and fixes in drmm_add_action_or_reset usage

Himal Prasad Ghimiray himal.prasad.ghimiray at intel.com
Fri Apr 12 18:12:04 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 (7):
  drm/xe: Simplify function return using drmm_add_action_or_reset()
  drm/xe: Remove sysfs only once on action add failure
  drm/xe: call free_gsc_pkt only once on action add failure
  drm/xe: Return NULL in case 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                    | 26 +++++++-------
 drivers/gpu/drm/xe/xe_gt_ccs_mode.c           | 19 ++++------
 drivers/gpu/drm/xe/xe_gt_ccs_mode.h           |  2 +-
 drivers/gpu/drm/xe/xe_gt_freq.c               | 25 ++++++-------
 drivers/gpu/drm/xe/xe_gt_freq.h               |  2 +-
 drivers/gpu/drm/xe/xe_gt_idle.c               | 16 +++------
 drivers/gpu/drm/xe/xe_gt_idle.h               |  2 +-
 drivers/gpu/drm/xe/xe_gt_sysfs.c              | 14 +++-----
 drivers/gpu/drm/xe/xe_gt_sysfs.h              |  2 +-
 drivers/gpu/drm/xe/xe_gt_throttle_sysfs.c     | 13 +++----
 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_pci.c                   | 12 +++++--
 drivers/gpu/drm/xe/xe_pm.c                    | 36 ++++++++++++++-----
 drivers/gpu/drm/xe/xe_pm.h                    |  4 +--
 drivers/gpu/drm/xe/xe_tile.c                  |  2 +-
 drivers/gpu/drm/xe/xe_tile_sysfs.c            | 16 ++++-----
 drivers/gpu/drm/xe/xe_tile_sysfs.h            |  2 +-
 drivers/gpu/drm/xe/xe_vram_freq.c             | 20 +++++------
 drivers/gpu/drm/xe/xe_vram_freq.h             |  2 +-
 28 files changed, 124 insertions(+), 177 deletions(-)

-- 
2.25.1



More information about the Intel-xe mailing list