[Intel-xe] [PATCH v3 0/1] Prevent flooding the kernel log with XE_IOCTL_ERR

Francois Dugast francois.dugast at intel.com
Tue Jul 11 10:16:32 UTC 2023


Following earlier discussion and proposals, a first attempt for v2 was made by
replacing XE_IOCTL_ERR with this new macro:

    #define XE_IOCTL_CHECK(xe__, expected_cond__, retcode__)                    \
        if (unlikely(!(expected_cond__))) {                                     \
                drm_dbg(&(xe__)->drm, "Ioctl argument check failed: %s",        \
                        #expected_cond__);                                      \
        return retcode__;                                                       \
    }

A message is logged by XE_IOCTL_ERR if the condition is true, whereas a message
is logged by XE_IOCTL_CHECK if the condition is false (expected condition), so
the condition has to be inversed. This was done easily with coccinelle for the
vast majority of uses of this macro, but this also showed more than 60 uses of
XE_IOCTL_ERR different from just a return statement. Fixing this would require
more refactoring but the priority of this patch is to address potential
flooding of the kernel log, so sending a new version without the new macro but
fixing the name to prevent the inconsistency with error and debug.

Francois Dugast (1):
  drm/xe: Prevent flooding the kernel log with XE_IOCTL_ERR

 drivers/gpu/drm/i915/display/intel_fb.c |   2 +-
 drivers/gpu/drm/xe/xe_bo.c              |  26 ++---
 drivers/gpu/drm/xe/xe_engine.c          | 114 +++++++++----------
 drivers/gpu/drm/xe/xe_exec.c            |  14 +--
 drivers/gpu/drm/xe/xe_macros.h          |   8 +-
 drivers/gpu/drm/xe/xe_mmio.c            |  14 +--
 drivers/gpu/drm/xe/xe_query.c           |  30 ++---
 drivers/gpu/drm/xe/xe_sync.c            |  32 +++---
 drivers/gpu/drm/xe/xe_vm.c              | 144 ++++++++++++------------
 drivers/gpu/drm/xe/xe_vm_madvise.c      |  40 +++----
 drivers/gpu/drm/xe/xe_wait_user_fence.c |  30 ++---
 11 files changed, 227 insertions(+), 227 deletions(-)

-- 
2.34.1



More information about the Intel-xe mailing list