diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c index 004599c35aee..d25d25f77531 100644 --- a/drivers/gpu/drm/xe/xe_ras.c +++ b/drivers/gpu/drm/xe/xe_ras.c @@ -6,6 +6,7 @@ #include "xe_debugfs.h" #include "xe_device.h" #include "xe_drm_ras.h" +#include "xe_log.h" #include "xe_pm.h" #include "xe_printk.h" #include "xe_ras.h" @@ -46,6 +47,16 @@ enum xe_ras_component { XE_RAS_COMP_MAX }; +#define CHECK_COMPONENT(RAS_COMP, LOG_COMP) \ + static_assert(MAKE_XE_LOG_COMPONENT(HARDWARE, (RAS_COMP)) == (LOG_COMP)) + /* make sure components definitions maintain stable relation */ + CHECK_COMPONENT(XE_RAS_COMP_DEVICE_MEMORY, XE_LOG_COMPONENT_DEVICE_MEMORY); + CHECK_COMPONENT(XE_RAS_COMP_CORE_COMPUTE, XE_LOG_COMPONENT_CORE_COMPUTE); + CHECK_COMPONENT(XE_RAS_COMP_PCIE, XE_LOG_COMPONENT_PCIE); + CHECK_COMPONENT(XE_RAS_COMP_FABRIC, XE_LOG_COMPONENT_FABRIC); + CHECK_COMPONENT(XE_RAS_COMP_SOC_INTERNAL, XE_LOG_COMPONENT_SOC_INTERNAL); +#undef CHECK_COMPONENT + /* RAS response status codes */ enum xe_ras_response_status { XE_RAS_STATUS_SUCCESS = 0,