mirror of
https://github.com/torvalds/linux.git
synced 2026-11-12 20:54:48 +01:00
drm/xe/ras: Check RAS and LOG component definitions
While not strictly required, we want to make sure that components definitions used by the RAS firmware are in the same fixed relation with HW components definitions used by the LOG infrastructure to allow code simplification. Add static asserts to enforce that. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Aravind Iddamsetty <aravind.iddamsetty@intel.com> Reviewed-by: Mallesh Koujalagi <mallesh.koujalagi@intel.com> Link: https://patch.msgid.link/20260814171801.13347-15-michal.wajdeczko@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
5fec1a2f4f
commit
eb732ef76b
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user