Re: [PATCH V3 09/11] accel/amdxdna: Add error handling

From: Jeffrey Hugo
Date: Fri Oct 04 2024 - 14:37:42 EST


On 9/11/2024 12:06 PM, Lizhi Hou wrote:
+/*
+ * Below enum, struct and lookup tables are porting from XAIE util header file.
+ *
+ * Below data is defined by AIE device and it is used for decode error message
+ * from the device.
+ */
+
+enum aie_module_type {
+ AIE_MEM_MOD = 0,
+ AIE_CORE_MOD,
+ AIE_PL_MOD,
+};
+
+enum aie_error_category {
+ AIE_ERROR_SATURATION = 0,
+ AIE_ERROR_FP,
+ AIE_ERROR_STREAM,
+ AIE_ERROR_ACCESS,
+ AIE_ERROR_BUS,
+ AIE_ERROR_INSTRUCTION,
+ AIE_ERROR_ECC,
+ AIE_ERROR_LOCK,
+ AIE_ERROR_DMA,
+ AIE_ERROR_MEM_PARITY,
+ /* Unknown is not from XAIE, added for better category */
+ AIE_ERROR_UNKNOWN,
+};
+
+/* Don't pack, unless XAIE side changed */
+struct aie_error {
+ u8 row;
+ u8 col;
+ enum aie_module_type mod_type;

As far as I am aware, the compiler will use multiple variable sizes to define an enum. This feels very fragile.

+ u8 event_id;
+};