DRM RAS NODE MANAGEMENT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… DRM RAS NODE MANAGEMENT πŸ’…

okay so this is from the Kernel API Manual, section 9 β€” and bestie, it's literally all about managing RAS nodes for DRM drivers. RAS = Reliability, Availability, and Serviceability, iykyk. let's get into it 🫢


✨ DRM RAS NODE MANAGEMENT ✨

This module hands you the whole infrastructure to manage RAS (Reliability, Availability, and Serviceability) nodes for DRM drivers. fr fr, that's the whole vibe. Every DRM driver can register one or more RAS nodes, and each node is like a little logical component that's capable of reporting error counters and other reliability metrics. main character energy per node πŸ’…

The nodes live in a global xarray called drm_ras_xa so lookups by ID are fast and cute. and yes, nodes can be registered or unregistered dynamically at runtime β€” no restart needed, we love that for us ✨

So there's this Generic Netlink family called drm_ras that exposes the below operations to userspace:

  1. LIST_NODES: Dump all currently registered RAS nodes. the user gets back an array of node IDs, names, and types. basically the whole roster πŸŽ€
  2. GET_ERROR_COUNTER: Get error counters of a given node. userspace must provide Node ID, and Error ID (Optional for specific counter). it returns all counters of a node if only Node ID is provided, or specific error counters if you asked for one. slay, flexible πŸ’–
  3. CLEAR_ERROR_COUNTER: Clear error counter of a given node. userspace must provide Node ID and Error ID. it clears a specific error counter of a node if supported β€” key detail, don't forget the "if supported" πŸ™ˆ

🌸 Node registration 🌸

  • drm_ras_node_register β€” registers a new node and assigns it a unique ID in the xarray. iconic.
  • drm_ras_node_unregister β€” removes a previously registered node from the xarray. bye bestie πŸ‘‹

πŸ¦‹ Node type πŸ¦‹

  • ERROR_COUNTER:
    • Currently, only error counters are supported.
    • The driver must implement the query_error_counter callback to provide the name and the value of the error counter.
    • The driver must provide a error_counter_range.last value informing the last valid error ID.
    • The driver can provide a error_counter_range.first value informing the first valid error ID.
    • The error counters in the driver doesn't need to be contiguous, but the driver must return -ENOENT to the query_error_counter as an indication that the ID should be skipped and not listed in the netlink API. so like, -ENOENT = "not me, skip me" πŸ’€

  • drm_ras_nl_list_nodes_dumpit β€” implements the LIST_NODES operation, iterating over the xarray. it's giving tour guide through the node list 🌈
  • drm_ras_nl_get_error_counter_dumpit β€” implements the GET_ERROR_COUNTER dumpit operation, fetching all counters from a specific node.
  • drm_ras_nl_get_error_counter_doit β€” implements the GET_ERROR_COUNTER doit operation, fetching a counter value from a specific node.
  • drm_ras_nl_clear_error_counter_doit β€” implements the CLEAR_ERROR_COUNTER doit operation, clearing a counter value from a specific node. poof, gone ✨

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./drivers/gpu/drm/drm_ras.c, plus these absolute legends:


okay that's the whole page, no cap πŸ’œ this came out of ./drivers/gpu/drm in October 2026 β€” drink water, read your xarrays, and go slay some error counters for me πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from