History

drm/xe/xe_drm_ras: Add support for XE DRM RAS

Allocate correctable, uncorrectable nodes for every xe device. Each node contains error component, counters and respective query counter functions. Add basic functionality to create and register drm nodes. Below operations can be performed using Generic netlink DRM RAS interface: 1) List Nodes: $ sudo ynl --family drm_ras --dump list-nodes [{'device-name': '0000:03:00.0', 'node-id': 0, 'node-name': 'correctable-errors', 'node-type': 'error-counter'}, {'device-name': '0000:03:00.0', 'node-id': 1, 'node-name': 'uncorrectable-errors', 'node-type': 'error-counter'}] 2) Get Error counters: $ sudo ynl --family drm_ras --dump get-error-counter --json '{"node-id":0}' [{'error-id': 1, 'error-name': 'core-compute', 'error-value': 0}, {'error-id': 2, 'error-name': 'soc-internal', 'error-value': 0}] 3) Get specific Error counter: $ sudo ynl --family drm_ras --do get-error-counter --json '{"node-id":0, "error-id":1}' {'error-id': 1, 'error-name': 'core-compute', 'error-value': 0}

Riana Tauro committed 8 months ago

Commit b40db121 parent c36218d6 files · +325 −0Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/drm/xe_drm.h+79−0
@@ -2357,6 +2357,85 @@ struct drm_xe_exec_queue_set_property { · 2356 unmodified lines
23572357 __u64 reserved[2];
23582358 };
23592359
2360+/**
2361+ * DOC: Xe DRM RAS
2362+ *
2363+ * The enums and strings defined below map to the attributes of the DRM RAS Netlink Interface.
2364+ * Refer to Documentation/netlink/specs/drm_ras.yaml for complete interface specification.
2365+ *
2366+ * Node Registration
2367+ * =================
2368+ *
2369+ * The driver registers DRM RAS nodes for each error severity level.
2370+ * enum drm_xe_ras_error_severity defines the node-id, while DRM_XE_RAS_ERROR_SEVERITY_NAMES maps
2371+ * node-id to node-name.
2372+ *
2373+ * Error Classification
2374+ * ====================
2375+ *
2376+ * Each node contains a list of error counters. Each error is identified by a error-id and
2377+ * an error-name. enum drm_xe_ras_error_component defines the error-id, while
2378+ * DRM_XE_RAS_ERROR_COMPONENT_NAMES maps error-id to error-name.
2379+ *
2380+ * User Interface
2381+ * ==============
2382+ *
2383+ * To retrieve error values of a error counter, userspace applications should
2384+ * follow the below steps:
2385+ *
2386+ * 1. Use command LIST_NODES to enumerate all available nodes
2387+ * 2. Select node by node-id or node-name
2388+ * 3. Use command GET_ERROR_COUNTERS to list errors of specific node
2389+ * 4. Query specific error values using either error-id or error-name
2390+ *
2391+ * .. code-block:: C
2392+ *
2393+ * // Lookup tables for ID-to-name resolution
2394+ * static const char *nodes[] = DRM_XE_RAS_ERROR_SEVERITY_NAMES;
2395+ * static const char *errors[] = DRM_XE_RAS_ERROR_COMPONENT_NAMES;
2396+ *
2397+ */
2398+
2399+/**
2400+ * enum drm_xe_ras_error_severity - DRM RAS error severity.
2401+ */
2402+enum drm_xe_ras_error_severity {
2403+ /** @DRM_XE_RAS_ERR_SEV_CORRECTABLE: Correctable Error */
2404+ DRM_XE_RAS_ERR_SEV_CORRECTABLE = 0,
2405+ /** @DRM_XE_RAS_ERR_SEV_UNCORRECTABLE: Uncorrectable Error */
2406+ DRM_XE_RAS_ERR_SEV_UNCORRECTABLE,
2407+ /** @DRM_XE_RAS_ERR_SEV_MAX: Max severity */
2408+ DRM_XE_RAS_ERR_SEV_MAX /* non-ABI */
2409+};
2410+
2411+/**
2412+ * enum drm_xe_ras_error_component - DRM RAS error component.
2413+ */
2414+enum drm_xe_ras_error_component {
2415+ /** @DRM_XE_RAS_ERR_COMP_CORE_COMPUTE: Core Compute Error */
2416+ DRM_XE_RAS_ERR_COMP_CORE_COMPUTE = 1,
2417+ /** @DRM_XE_RAS_ERR_COMP_SOC_INTERNAL: SoC Internal Error */
2418+ DRM_XE_RAS_ERR_COMP_SOC_INTERNAL,
2419+ /** @DRM_XE_RAS_ERR_COMP_MAX: Max Error */
2420+ DRM_XE_RAS_ERR_COMP_MAX /* non-ABI */
2421+};
2422+
2423+/*
2424+ * Error severity to name mapping.
2425+ */
2426+#define DRM_XE_RAS_ERROR_SEVERITY_NAMES { \
2427+ [DRM_XE_RAS_ERR_SEV_CORRECTABLE] = "correctable-errors", \
2428+ [DRM_XE_RAS_ERR_SEV_UNCORRECTABLE] = "uncorrectable-errors", \
2429+}
2430+
2431+/*
2432+ * Error component to name mapping.
2433+ */
2434+#define DRM_XE_RAS_ERROR_COMPONENT_NAMES { \
2435+ [DRM_XE_RAS_ERR_COMP_CORE_COMPUTE] = "core-compute", \
2436+ [DRM_XE_RAS_ERR_COMP_SOC_INTERNAL] = "soc-internal" \
2437+}
2438+
23602439 #if defined(__cplusplus)
23612440 }
23622441 #endif