Extend drm_ras for qaic telemetry
Subsystems (8)
v5 cover Extend drm_ras for qaic telemetry
This patch series extends the drm_ras netlink interface to include a new node type for telemetry nodes. Telemetry nodes support three operations:
getting, setting (optional), and listing telemetry fields. Drivers may specify an optional predoit function to validate get and set operations.
Telemetry get operations take the drm_ras node id and telemetry field to be read and return the field's value and any status reported by the driver. Telemetry set operations take the node id, telemetry field, and value, and return only the status reported by the driver.
Before adding telemetry nodes, a new patch is introduced to add refcounts to drm_ras nodes stored in the xarray. This protects the nodes, which are owned by the device, from being unregistered and freed in the middle of a netlink doit such as getting an error counter.
This extension also removes the admin requirement on the list-nodes operation. This allows drm_ras nodes to be discovered by userspace programs for drivers that do not necessarily require admin privileges, like qaic.
The new drm_ras telemetry interface is implemented by the qaic driver, which exposes the telemetry fields to userspace and enforces filesystem- esque permission checks on telemetry operations in its telemetry_pre callback.
Claude Opus 5.5 was used to assist in the development of these patches and to address Sashiko feedback.
Changes in v5:
- Address Sashiko comments:
- Convert mode from u8 to uint in drm_ras netlink spec.
- Add check for qdev->dev_state != QAIC_ONLINE in telemetry_request().
- Flush the tele_wq workqueue after mhi_unprepare_from_transfer in qaic_telemetry_mhi_remove.
- Small formatting fixes.
Link to v4: https://lore.kernel.org/all/[email protected]/
Changes in v4:
- Add refcounts to track drm_ras node lifetimes.
- Address Sashiko comments:
- Fix status field population when HW returns an error.
- Add refcounts for telemetry nodes.
- Update outdated commit messages.
- Add static to private functions in qaic_telemetry.c, and remove them from qaic_telemetry.h.
- Stop returning remaining jiffies when device status is nonzero in telemetry_request().
- Add mhi_unprepare_from_transfer if drm_ras node registration fails in qaic_telemetry_mhi_probe().
- Consolidate get/set dumpits into a single dump operation.
- Pin telemetry node to context in pre-doit and unpin in post-doit. This ensures the same node is used between pre-doit and doit calls.
- Change field attribute to uint and status to sint.
- Added NL_SET_BAD_ATTR calls to telemetry netlink functions.
- Reject non-telemetry nodes in telemetry get/set/list-fields.
- Updated qaic Kconfig to depend on DRM_RAS.
Link to v3: https://lore.kernel.org/all/[email protected]/#t
Changes in v3:
- Address Sashiko comments:
- Properly return status when telemetry request is successful but a hardware error occurs.
- Validate telemetry fields against their gettable/settable fields lists when invoking the predoit.
- Update documentation in include/drm/drm_ras.h.
- Moved calls to qaic_drm_ras_register/unregister to mhi_probe/remove instead of pci_probe/remove.
- Added srcu read locks around calls to telemetry_request() in get and set callbacks in qaic_telemetry.c.
- Added a tele_ch check to telemetry_request().
- Properly handle a -ERESTARTSYS return from wait_for_completion_interrputable in telemetry_request().
- Ensure field can be truncated to a u8 in qaic's telemetry get and set callbacks.
- Minor code cleanups (typos, header ordering, etc).
Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Address Sashiko comments:
- Initialize certain stack variables in drm_ras.c.
- Added attribute guards (GENL_REQ_ATTR_CHECK) in telemetry doits.
- Added a valid node check in drm_ras_nl_pre_telemetry.
- Fixed improper node callback in telemetry_set.
- Now registering drm_ras node after MHI initialization.
- Now removing drm_ras node before freeing MHI controller.
- Added scoped_with_init_fs guard to qaic_telemetry_pre's inode check.
- Fixed improper kfree in qaic_drm_ras_register_node.
- Changed telemetry value attribute to sint and dropped padding attribute.
- Updated documentation in drm_ras.yaml.
- Renamed telemetry read/write to get/set.
- Added dumpit for gettable and settable telemetry values.
- Made telemetry_set optional and added admin-perm for it.
- Specified ynl file regeneration in commit message for patch 2.
Link to v1: https://lore.kernel.org/all/[email protected]/
Zack McKevitt (4):
drm/drm_ras: Reference-count nodes across netlink handlers drm/drm_ras: Remove admin-perm flag from list-nodes operation drm/drm_ras: Extend DRM RAS interface to include telemetry nodes accel/qaic: Add callbacks for DRM RAS netlink telemetry
Documentation/netlink/specs/drm_ras.yaml | 98 +++- drivers/accel/qaic/Kconfig | 1 + drivers/accel/qaic/Makefile | 1 + drivers/accel/qaic/qaic.h | 19 + drivers/accel/qaic/qaic_drv.c | 15 + drivers/accel/qaic/qaic_telemetry.c | 564 +++++++++++++++++++++ drivers/accel/qaic/qaic_telemetry.h | 14 + drivers/gpu/drm/drm_ras.c | 611 ++++++++++++++++++++--- drivers/gpu/drm/drm_ras_nl.c | 45 +- drivers/gpu/drm/drm_ras_nl.h | 10 + include/drm/drm_ras.h | 98 ++++ include/uapi/drm/drm_ras.h | 29 +- include/uapi/drm/qaic_accel.h | 28 ++ 13 files changed, 1462 insertions(+), 71 deletions(-) create mode 100644 drivers/accel/qaic/qaic_telemetry.c create mode 100644 drivers/accel/qaic/qaic_telemetry.h
Signature · 1 line
2.43.0
PATCH v5 1/4 drm/drm_ras: Reference-count nodes across netlink handlers
The drm_ras generic netlink family sets .parallel_ops = true, so its handlers can run concurrently with each other and with drm_ras_node_unregister(). Every handler looks a node up with a bare xa_load() and then dereferences the returned pointer across GFP_KERNEL allocations and sleeping driver callbacks, while drm_ras_node_unregister() only calls xa_erase() and the driver frees the node immediately afterwards. xa_load() only holds the RCU read lock for the duration of the walk, so the node can be unregistered and freed while a handler is still using it.
Give each node a reference count. A node holds one reference for being registered; drm_ras_node_get()/drm_ras_node_get_next() take an additional reference under the xarray lock, which serialises them against the xa_erase() in drm_ras_node_unregister() so the bump can never race with the free. Handlers drop their reference with drm_ras_node_put() once they are done touching the node. drm_ras_node_unregister() removes the node from the xarray, drops the registration reference and waits for any in-flight handler to drop theirs before returning, so the driver can still free the node as soon as unregister() returns.
drm_ras_nl_error_event() is left unchanged: it is called by the driver with its own node, whose lifetime the caller already guarantees.
--- drivers/gpu/drm/drm_ras.c | 239 +++++++++++++++++++++++++++++--------- include/drm/drm_ras.h | 16 +++ 2 files changed, 201 insertions(+), 54 deletions(-)
drivers/gpu/drm/drm_ras.c +185 -54
@@ -3,9 +3,11 @@* Copyright © 2026 Intel Corporation */ +#include <linux/completion.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/netdevice.h> +#include <linux/refcount.h> #include <linux/xarray.h> #include <net/genetlink.h>
@@ -60,6 +62,21 @@* - drm_ras_node_unregister(): Removes a previously registered * node from the xarray. * +* Node lifetime: +* +* The &drm_ras_nl_family uses &genl_family.parallel_ops, so netlink +* handlers may run concurrently with each other and with +* drm_ras_node_unregister(). Node memory is owned by the driver, which +* typically frees it right after drm_ras_node_unregister() returns. To make +* this safe, every handler looks a node up with drm_ras_node_get(), which +* takes a reference under the xarray lock, and drops it with +* drm_ras_node_put() once it is done touching the node. A node holds one +* reference for being registered; drm_ras_node_unregister() removes the node +* from the xarray (so no new lookups can find it), drops that registration +* reference, and then waits for any in-flight handlers to drop theirs before +* returning. The driver may therefore free the node as soon as +* drm_ras_node_unregister() returns. +* * Node type: * * - ERROR_COUNTER:
@@ -107,6 +124,75 @@ struct drm_ras_ctx {unsigned long restart; }; +/** +* drm_ras_node_get() - Look up a RAS node by ID and take a reference +* @node_id: ID of the node to look up +* +* Looks the node up in the global xarray and, if found, takes a reference to +* it so that it cannot be freed while the caller is using it. The lookup and +* the reference bump happen under the xarray lock, which serialises them +* against the xa_erase() in drm_ras_node_unregister(): a node that is still +* present in the xarray is guaranteed to still hold its registration +* reference, so the bump can never operate on freed memory. +* +* The caller must drop the returned reference with drm_ras_node_put(). +* +* Return: the referenced node, or NULL if no node with @node_id is registered. +*/ +static struct drm_ras_node *drm_ras_node_get (u32 node_id) +{ +struct drm_ras_node *node; + +xa_lock (&drm_ras_xa); + node =xa_load (&drm_ras_xa, node_id); +if (node) +refcount_inc (&node->ref); +xa_unlock (&drm_ras_xa); + +return node; +} + +/** +* drm_ras_node_get_next() - Take a reference on the next registered RAS node +* @next: in/out cursor; on entry the first ID to consider, on return the ID of +* the node whose reference was taken +* +* Iterator counterpart of drm_ras_node_get() used by the LIST_NODES dump. +* Finds the first node with an ID at or above *@next, takes a reference to it +* under the xarray lock and reports its ID back in *@next. +* +* The caller must drop the returned reference with drm_ras_node_put(). +* +* Return: the referenced node, or NULL if no further node is registered. +*/ +static struct drm_ras_node *drm_ras_node_get_next (unsigned long *next) +{ +struct drm_ras_node *node; + +xa_lock (&drm_ras_xa); + node =xa_find (&drm_ras_xa, next,ULONG_MAX ,XA_PRESENT ); +if (node) +refcount_inc (&node->ref); +xa_unlock (&drm_ras_xa); + +return node; +} + +/** +* drm_ras_node_put() - Drop a reference taken on a RAS node +* @node: node to drop a reference on, may be NULL +* +* Drops a reference previously taken by drm_ras_node_get() or +* drm_ras_node_get_next(). When the last reference (including the registration +* reference dropped by drm_ras_node_unregister()) goes away, the waiter in +* drm_ras_node_unregister() is woken so the driver can free the node. +*/ +static void drm_ras_node_put (struct drm_ras_node *node) +{ +if (node &&refcount_dec_and_test (&node->ref)) +complete (&node->unregistered); +} +/** * drm_ras_nl_list_nodes_dumpit() - Dump all registered RAS nodes * @skb: Netlink message buffer
@@ -127,46 +213,47 @@ int drm_ras_nl_list_nodes_dumpit(struct sk_buff *skb, {const struct genl_info *info =genl_info_dump (cb);struct drm_ras_ctx *ctx = (void *)cb->ctx; +unsigned long id = ctx->restart;struct drm_ras_node *node;struct nlattr *hdr; -unsigned long id; -int ret; +int ret =0 ; -xa_for_each_start (&drm_ras_xa, id, node, ctx->restart) { +while ((node =drm_ras_node_get_next (&id))) { hdr =genlmsg_iput (skb, info);if (!hdr) { ret = -EMSGSIZE ; +drm_ras_node_put (node);break ; } ret =nla_put_u32 (skb,DRM_RAS_A_NODE_ATTRS_NODE_ID , node->id); -if (ret) { -genlmsg_cancel (skb, hdr); -break ; - } +if (ret) + goto cancel; ret =nla_put_string (skb,DRM_RAS_A_NODE_ATTRS_DEVICE_NAME , node->device_name); -if (ret) { -genlmsg_cancel (skb, hdr); -break ; - } +if (ret) + goto cancel; ret =nla_put_string (skb,DRM_RAS_A_NODE_ATTRS_NODE_NAME , node->node_name); -if (ret) { -genlmsg_cancel (skb, hdr); -break ; - } +if (ret) + goto cancel; ret =nla_put_u32 (skb,DRM_RAS_A_NODE_ATTRS_NODE_TYPE , node->type); -if (ret) { -genlmsg_cancel (skb, hdr); -break ; - } +if (ret) + goto cancel;genlmsg_end (skb, hdr); +drm_ras_node_put (node); + id++; +continue ; + +cancel: +genlmsg_cancel (skb, hdr); +drm_ras_node_put (node); +break ; }if (ret == -EMSGSIZE )
@@ -175,13 +262,10 @@ int drm_ras_nl_list_nodes_dumpit(struct sk_buff *skb,return ret; } -static int get_node_error_counter (u32 node_id,u32 error_id, +static int get_node_error_counter (struct drm_ras_node *node,u32 error_id,const char **name,u32 *value) { -struct drm_ras_node *node; - - node =xa_load (&drm_ras_xa, node_id); -if (!node || !node->query_error_counter) +if (!node->query_error_counter)return -ENOENT ; if (error_id < node->error_counter_range.first ||
@@ -191,14 +275,9 @@ static int get_node_error_counter(u32 node_id, u32 error_id,return node->query_error_counter (node, error_id, name, value); } -static int get_node_error_threshold (u32 node_id,u32 error_id,const char **name,u32 *threshold) +static int get_node_error_threshold (struct drm_ras_node *node,u32 error_id, +const char **name,u32 *threshold) { -struct drm_ras_node *node; - - node =xa_load (&drm_ras_xa, node_id); -if (!node) -return -ENOENT ; -if (!node->query_error_threshold)return -EOPNOTSUPP ;
@@ -208,14 +287,8 @@ static int get_node_error_threshold(u32 node_id, u32 error_id, const char **namereturn node->query_error_threshold (node, error_id, name, threshold); } -static int set_node_error_threshold (u32 node_id,u32 error_id,u32 threshold) +static int set_node_error_threshold (struct drm_ras_node *node,u32 error_id,u32 threshold) { -struct drm_ras_node *node; - - node =xa_load (&drm_ras_xa, node_id); -if (!node) -return -ENOENT ; -if (!node->set_error_threshold)return -EOPNOTSUPP ;
@@ -290,15 +363,22 @@ static int msg_reply_threshold(struct sk_buff *msg, u32 error_id, const char *erstatic int doit_reply_value (struct genl_info *info,u32 node_id,u32 error_id) { +struct drm_ras_node *node;struct sk_buff *msg;struct nlattr *hdr;const char *error_name;u32 value;int ret; + node =drm_ras_node_get (node_id); +if (!node) +return -ENOENT ; + msg =genlmsg_new (NLMSG_GOODSIZE ,GFP_KERNEL ); -if (!msg) -return -ENOMEM ; +if (!msg) { + ret = -ENOMEM ; + goto put_node; + } hdr =genlmsg_iput (msg, info);if (!hdr) {
@@ -306,7 +386,7 @@ static int doit_reply_value(struct genl_info *info, u32 node_id, goto free_msg; } - ret =get_node_error_counter (node_id, error_id, + ret =get_node_error_counter (node, error_id, &error_name, &value);if (ret) goto cancel_msg;
@@ -317,26 +397,37 @@ static int doit_reply_value(struct genl_info *info, u32 node_id,genlmsg_end (msg, hdr); +drm_ras_node_put (node); +return genlmsg_reply (msg, info); cancel_msg:genlmsg_cancel (msg, hdr); free_msg:nlmsg_free (msg); +put_node: +drm_ras_node_put (node);return ret; }static int doit_reply_threshold (struct genl_info *info,u32 node_id,u32 error_id) { +struct drm_ras_node *node;const char *error_name;struct sk_buff *msg;struct nlattr *hdr;u32 threshold;int ret; + node =drm_ras_node_get (node_id); +if (!node) +return -ENOENT ; + msg =genlmsg_new (NLMSG_GOODSIZE ,GFP_KERNEL ); -if (!msg) -return -ENOMEM ; +if (!msg) { + ret = -ENOMEM ; + goto put_node; + } hdr =genlmsg_iput (msg, info);if (!hdr) {
@@ -344,7 +435,7 @@ static int doit_reply_threshold(struct genl_info *info, u32 node_id, u32 error_i goto free_msg; } - ret =get_node_error_threshold (node_id, error_id, &error_name, &threshold); + ret =get_node_error_threshold (node, error_id, &error_name, &threshold);if (ret) goto cancel_msg;
@@ -354,12 +445,16 @@ static int doit_reply_threshold(struct genl_info *info, u32 node_id, u32 error_igenlmsg_end (msg, hdr); +drm_ras_node_put (node); +return genlmsg_reply (msg, info); cancel_msg:genlmsg_cancel (msg, hdr); free_msg:nlmsg_free (msg); +put_node: +drm_ras_node_put (node);return ret; }
@@ -372,6 +467,10 @@ static int doit_reply_threshold(struct genl_info *info, u32 node_id, u32 error_i* * Report an error-event to userspace using the error-report multicast group. * +* The caller owns @node and must guarantee it stays alive for the duration of +* this call (it is the driver's own node), so no additional reference is taken +* here. +* * Context: Process context only. Uses %GFP_KERNEL and multicasts to all * netns, which is unbounded work; callers in interrupt handlers * or other atomic context must defer event.
@@ -455,21 +554,21 @@ int drm_ras_nl_get_error_counter_dumpit(struct sk_buff *skb,struct nlattr *hdr;const char *error_name;u32 node_id, error_id, value; -int ret; +int ret =0 ;if (!info->attrs ||GENL_REQ_ATTR_CHECK (info,DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID ))return -EINVAL ; node_id =nla_get_u32 (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID ]); - node =xa_load (&drm_ras_xa, node_id); + node =drm_ras_node_get (node_id);if (!node)return -ENOENT ;for (error_id =max (node->error_counter_range.first, ctx->restart); error_id <= node->error_counter_range.last; error_id++) { - ret =get_node_error_counter (node_id, error_id, + ret =get_node_error_counter (node, error_id, &error_name, &value);/* * For non-contiguous range, driver return -ENOENT as indication
@@ -478,7 +577,7 @@ int drm_ras_nl_get_error_counter_dumpit(struct sk_buff *skb,if (ret == -ENOENT )continue ;if (ret) -return ret; +break ; hdr =genlmsg_iput (skb, info);
@@ -499,6 +598,8 @@ int drm_ras_nl_get_error_counter_dumpit(struct sk_buff *skb,if (ret == -EMSGSIZE ) ctx->restart = error_id; +drm_ras_node_put (node); +return ret; }
@@ -544,6 +645,7 @@ int drm_ras_nl_clear_error_counter_doit(struct sk_buff *skb, {struct drm_ras_node *node;u32 node_id, error_id; +int ret; if (!info->attrs || GENL_REQ_ATTR_CHECK(info, DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID) ||
@@ -553,15 +655,23 @@ int drm_ras_nl_clear_error_counter_doit(struct sk_buff *skb, node_id =nla_get_u32 (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID ]); error_id =nla_get_u32 (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID ]); - node =xa_load (&drm_ras_xa, node_id); -if (!node || !node->clear_error_counter) + node =drm_ras_node_get (node_id); +if (!node || !node->clear_error_counter) { +drm_ras_node_put (node);return -ENOENT ; + }if (error_id < node->error_counter_range.first || - error_id > node->error_counter_range.last) + error_id > node->error_counter_range.last) { +drm_ras_node_put (node);return -EINVAL ; + } -return node->clear_error_counter (node, error_id); + ret = node->clear_error_counter (node, error_id); + +drm_ras_node_put (node); + +return ret; }/**
@@ -603,6 +713,8 @@ int drm_ras_nl_get_error_threshold_doit(struct sk_buff *skb, struct genl_info *iint drm_ras_nl_set_error_threshold_doit (struct sk_buff *skb,struct genl_info *info) {u32 node_id, error_id, threshold; +struct drm_ras_node *node; +int ret; if (!info->attrs || GENL_REQ_ATTR_CHECK(info, DRM_RAS_A_ERROR_COUNTER_ATTRS_NODE_ID) ||
@@ -614,7 +726,15 @@ int drm_ras_nl_set_error_threshold_doit(struct sk_buff *skb, struct genl_info *i error_id =nla_get_u32 (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_ID ]); threshold =nla_get_u32 (info->attrs[DRM_RAS_A_ERROR_COUNTER_ATTRS_ERROR_THRESHOLD ]); -return set_node_error_threshold (node_id, error_id, threshold); + node =drm_ras_node_get (node_id); +if (!node) +return -ENOENT ; + + ret =set_node_error_threshold (node, error_id, threshold); + +drm_ras_node_put (node); + +return ret; }/**
@@ -640,6 +760,10 @@ int drm_ras_node_register(struct drm_ras_node *node) (!node->error_counter_range.last || !node->query_error_counter)) return -EINVAL; +/* One reference is held for being registered in the xarray */ +refcount_set (&node->ref,1 ); +init_completion (&node->unregistered); +return xa_alloc (&drm_ras_xa, &node->id, node, xa_limit_32b,GFP_KERNEL ); }EXPORT_SYMBOL (drm_ras_node_register);
@@ -648,10 +772,17 @@ EXPORT_SYMBOL(drm_ras_node_register);* drm_ras_node_unregister() - Unregister a previously registered node * @node: Node structure to unregister * -* Removes the given node from the global node xarray using its ID. +* Removes the given node from the global node xarray using its ID and waits +* for any netlink handler that may still be using it to finish. Once this +* returns, no handler holds a reference to @node and the caller may free it. */ void drm_ras_node_unregister (struct drm_ras_node *node) { +/* Remove from the xarray so no new lookup can find the node */ xa_erase (&drm_ras_xa, node->id); + +/* Drop the registration reference and wait for in-flight handlers */ +drm_ras_node_put (node); +wait_for_completion (&node->unregistered); }EXPORT_SYMBOL (drm_ras_node_unregister);
include/drm/drm_ras.h +16 -0
@@ -6,6 +6,8 @@#ifndef __DRM_RAS_H__#define __DRM_RAS_H__ +#include <linux/completion.h> +#include <linux/refcount.h> #include <linux/types.h> #include <uapi/drm/drm_ras.h>
@@ -102,6 +104,20 @@ struct drm_ras_node {/** @priv: Driver private data */ void *priv; + +/* private: Internal drm_ras bookkeeping, drivers must not touch. */ + +/* +* @ref: One reference is held while the node is registered in the +* xarray; netlink handlers take an additional reference across their +* use of the node. See drm_ras_node_get()/drm_ras_node_put(). +*/ +refcount_t ref; +/* +* @unregistered: Completed when the last reference is dropped, so +* drm_ras_node_unregister() can wait for in-flight handlers. +*/ +struct completion unregistered; };struct drm_device ;
Signature · 1 line
2.43.0
PATCH v5 2/4 drm/drm_ras: Remove admin-perm flag from list-nodes operation
In reply to Zack McKevittDrivers may want to avoid requiring CAP_NET_ADMIN for subsequent drm-ras operations. However, userspace must still be able to access the list of RAS nodes to determine the node IDs. So, drop the CAP_NET_ADMIN requirement for dumping RAS nodes so that drivers with different permission requirements are still able to use the interface.
This prepares the interface to be used for telemetry by the qaic driver.
--- Documentation/netlink/specs/drm_ras.yaml | 1 - drivers/gpu/drm/drm_ras_nl.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
Documentation/netlink/specs/drm_ras.yaml +0 -1
@@ -112,7 +112,6 @@ operations: the node IDs. These IDs are required for all subsequent operations on nodes, such as querying error counters. attribute-set: node-attrs - flags: [admin-perm] dump: reply: attributes:
drivers/gpu/drm/drm_ras_nl.c +1 -1
@@ -46,7 +46,7 @@ static const struct genl_split_ops drm_ras_nl_ops[] = { { .cmd = DRM_RAS_CMD_LIST_NODES, .dumpit = drm_ras_nl_list_nodes_dumpit, - .flags = GENL_ADMIN_PERM | GENL_CMD_CAP_DUMP, + .flags = GENL_CMD_CAP_DUMP, }, { .cmd = DRM_RAS_CMD_GET_ERROR_COUNTER,
Signature · 1 line
2.43.0
PATCH v5 3/4 drm/drm_ras: Extend DRM RAS interface to include telemetry nodes
In reply to Zack McKevittAdd a new node type, attribute set, and doit/dump functions for performing telemetry operations using the DRM RAS interface.
Introduce telemetry_get and telemetry_set operations for reading and writing telemetry values. The telemetry_list_fields dump operation reports the telemetry fields that the driver defines, listing the enum string, enum value, and read/write mode of each field.
Telemetry get and set operations have associated pre and post doit functions. The pre-doit will retrieve the specified node from the xarray, increase its refcount, and store a handle to the node in the request context. This function will also check for an optional node-specified telemetry_pre function, which can be used to enforce permission checks, and ensure that the specified node is a telemetry node type. This node handle is retrieved from the context in the doit, which ensures the same node remains pinned across the pre-doit and doit functions. The post-doit will decrease the refcount for the stashed node.
The telemetry_list_fields callback does not have associated pre and post doit functions. Instead, it takes and drops the node reference within each call. This ensures an unfinished dump can't block the wait in drm_ras_node_unregister().
ynl-regen.sh was used to regenerate drm_ras_nl.c, drm_ras_nl.h, and include/uapi/drm/drm_ras.h from the drm_ras.yaml spec.
--- Documentation/netlink/specs/drm_ras.yaml | 97 +++++- drivers/gpu/drm/drm_ras.c | 374 ++++++++++++++++++++++- drivers/gpu/drm/drm_ras_nl.c | 43 +++ drivers/gpu/drm/drm_ras_nl.h | 10 + include/drm/drm_ras.h | 82 +++++ include/uapi/drm/drm_ras.h | 29 +- 6 files changed, 619 insertions(+), 16 deletions(-)
Documentation/netlink/specs/drm_ras.yaml +93 -4
@@ -16,11 +16,16 @@ definitions: type: enum name: node-type value-start: 1 - entries: [error-counter] + entries: [error-counter, telemetry] doc: >- - Type of the node. Currently, only error-counter nodes are - supported, which expose reliability counters for a hardware/software - component. + Type of the node. The error-counter nodes expose reliability counters + for a hardware/software component, and telemetry nodes expose an + interface for reading and writing telemetry values to a device. + - + type: flags + name: telemetry-field-mode + entries: [read, write] + doc: Bitmask of access modes supported by a telemetry field. attribute-sets: -
@@ -100,6 +105,41 @@ attribute-sets: name: error-value type: u32 doc: Current value of the error counter. + - + name: telemetry-attrs + attributes: + - + name: node-id + type: u32 + doc: >- + Unique identifier for the node. + Assigned dynamically by the DRM RAS core upon registration. + - + name: field + type: uint + doc: Telemetry field to be read/written, e.g., SoC temp. + - + name: field-name + type: string + doc: Name of the telemetry field defined by the device's uAPI. + - + name: value + type: sint + doc: Value of telemetry field that was read/written. + - + name: status + type: sint + doc: >- + Status of the telemetry operation. + Populated by the device in response to the performed + telemetry operation. Errors may be hardware specific. + - + name: mode + type: uint + enum: telemetry-field-mode + doc: >- + Bitmask of access modes (read/write) supported by the + telemetry field. operations: list:
@@ -198,6 +238,55 @@ operations: - node-id - error-id - error-threshold + - + name: telemetry-get + doc: Perform a read of the specified telemetry field. + attribute-set: telemetry-attrs + do: + pre: drm-ras-nl-pre-telemetry + post: drm-ras-nl-post-telemetry + request: + attributes: + - node-id + - field + reply: + attributes: + - value + - status + - + name: telemetry-set + doc: >- + Perform a write of the specified telemetry field. + Telemetry writes are device specific, and may be used to set + device limits or other capacities, for example. + attribute-set: telemetry-attrs + flags: [admin-perm] + do: + pre: drm-ras-nl-pre-telemetry + post: drm-ras-nl-post-telemetry + request: + attributes: + - node-id + - field + - value + reply: + attributes: + - status + - + name: telemetry-list-fields + doc: >- + Enumerate the telemetry fields exposed by a node, reporting each + field's value, name, and supported access modes (read/write). + attribute-set: telemetry-attrs + dump: + request: + attributes: + - node-id + reply: + attributes: + - field + - field-name + - mode mcast-groups: list:
drivers/gpu/drm/drm_ras.c +364 -10
427 lines not on this page · raw message
drivers/gpu/drm/drm_ras_nl.c +43 -0
55 lines not on this page · raw message
drivers/gpu/drm/drm_ras_nl.h +10 -0
@@ -12,6 +12,12 @@#include <uapi/drm/drm_ras.h> +int drm_ras_nl_pre_telemetry (const struct genl_split_ops *ops, +struct sk_buff *skb,struct genl_info *info); +void +drm_ras_nl_post_telemetry (const struct genl_split_ops *ops, +struct sk_buff *skb,struct genl_info *info); +int drm_ras_nl_list_nodes_dumpit (struct sk_buff *skb,struct netlink_callback *cb); int drm_ras_nl_get_error_counter_doit(struct sk_buff *skb,
@@ -24,6 +30,10 @@ int drm_ras_nl_get_error_threshold_doit(struct sk_buff *skb, struct genl_info *info);int drm_ras_nl_set_error_threshold_doit (struct sk_buff *skb,struct genl_info *info); +int drm_ras_nl_telemetry_get_doit (struct sk_buff *skb,struct genl_info *info); +int drm_ras_nl_telemetry_set_doit (struct sk_buff *skb,struct genl_info *info); +int drm_ras_nl_telemetry_list_fields_dumpit (struct sk_buff *skb, +struct netlink_callback *cb);enum {DRM_RAS_NLGRP_ERROR_REPORT ,
include/drm/drm_ras.h +82 -0
94 lines not on this page · raw message
include/uapi/drm/drm_ras.h +27 -2
@@ -11,11 +11,21 @@#define DRM_RAS_FAMILY_VERSION 1/* -* Type of the node. Currently, only error-counter nodes are supported, which -* expose reliability counters for a hardware/software component. +* Type of the node. The error-counter nodes expose reliability counters for a +* hardware/software component, and telemetry nodes expose an interface for +* reading and writing telemetry values to a device. */ enum drm_ras_node_type {DRM_RAS_NODE_TYPE_ERROR_COUNTER =1 , +DRM_RAS_NODE_TYPE_TELEMETRY , +}; + +/* +* Bitmask of access modes supported by a telemetry field. +*/ +enum drm_ras_telemetry_field_mode { +DRM_RAS_TELEMETRY_FIELD_MODE_READ =1 , +DRM_RAS_TELEMETRY_FIELD_MODE_WRITE =2 , };enum {
@@ -51,6 +61,18 @@ enum {DRM_RAS_A_ERROR_EVENT_ATTRS_MAX = (__DRM_RAS_A_ERROR_EVENT_ATTRS_MAX -1 ) }; +enum { +DRM_RAS_A_TELEMETRY_ATTRS_NODE_ID =1 , +DRM_RAS_A_TELEMETRY_ATTRS_FIELD , +DRM_RAS_A_TELEMETRY_ATTRS_FIELD_NAME , +DRM_RAS_A_TELEMETRY_ATTRS_VALUE , +DRM_RAS_A_TELEMETRY_ATTRS_STATUS , +DRM_RAS_A_TELEMETRY_ATTRS_MODE , + + __DRM_RAS_A_TELEMETRY_ATTRS_MAX, +DRM_RAS_A_TELEMETRY_ATTRS_MAX = (__DRM_RAS_A_TELEMETRY_ATTRS_MAX -1 ) +}; +enum {DRM_RAS_CMD_LIST_NODES =1 ,DRM_RAS_CMD_GET_ERROR_COUNTER ,
@@ -58,6 +80,9 @@ enum {DRM_RAS_CMD_ERROR_EVENT ,DRM_RAS_CMD_GET_ERROR_THRESHOLD ,DRM_RAS_CMD_SET_ERROR_THRESHOLD , +DRM_RAS_CMD_TELEMETRY_GET , +DRM_RAS_CMD_TELEMETRY_SET , +DRM_RAS_CMD_TELEMETRY_LIST_FIELDS , __DRM_RAS_CMD_MAX,DRM_RAS_CMD_MAX = (__DRM_RAS_CMD_MAX -1 )
Signature · 1 line
2.43.0
PATCH v5 4/4 accel/qaic: Add callbacks for DRM RAS netlink telemetry
In reply to Zack McKevittUse the DRM RAS netlink infrastructure to perform device telemetry. During MHI probe, create a DRM RAS node with DRM_RAS_NODE_TYPE_TELEMETRY type and add callbacks to telemetry_request for read and write operations.
--- drivers/accel/qaic/Kconfig | 1 + drivers/accel/qaic/Makefile | 1 + drivers/accel/qaic/qaic.h | 19 + drivers/accel/qaic/qaic_drv.c | 15 + drivers/accel/qaic/qaic_telemetry.c | 564 ++++++++++++++++++++++++++++ drivers/accel/qaic/qaic_telemetry.h | 14 + include/uapi/drm/qaic_accel.h | 28 ++ 7 files changed, 642 insertions(+) create mode 100644 drivers/accel/qaic/qaic_telemetry.c create mode 100644 drivers/accel/qaic/qaic_telemetry.h
drivers/accel/qaic/Kconfig +1 -0
@@ -8,6 +8,7 @@ config DRM_ACCEL_QAIC depends on DRM_ACCEL depends on PCI && HAS_IOMEM depends on MHI_BUS + depends on DRM_RAS select CRC32 select WANT_DEV_COREDUMP help
drivers/accel/qaic/Makefile +1 -0
@@ -13,6 +13,7 @@ qaic-y := \ qaic_ras.o \ qaic_ssr.o \ qaic_sysfs.o \ + qaic_telemetry.o \ qaic_timesync.o \ sahara.o
drivers/accel/qaic/qaic.h +19 -0
@@ -17,6 +17,7 @@#include <linux/workqueue.h> #include <drm/drm_device.h> #include <drm/drm_gem.h> +#include <drm/drm_ras.h> #define QAIC_DBC_BASE SZ_128K#define QAIC_DBC_SIZE SZ_4K
@@ -204,6 +205,24 @@ struct qaic_device {void *ssr_mhi_buf;/* DBC which is under SSR. Sentinel U32_MAX would mean that no SSR in progress */ u32 ssr_dbc; +/* MHI telemetry channel device */ +struct mhi_device *tele_ch; +/* Head in list of requests queued in MHI telemetry device */ +struct list_head tele_xfer_list; +/* Req. ID of request that will be queued next in MHI telemetry device */ +u32 tele_next_seq_num; +/* Synchronizes MHI telemetry device transactions and its xfer list */ +struct mutex tele_mutex; +/* +* TRUE: A tx MHI transaction has failed and a rx buffer is still queued +* in telemetry device. Such a buffer is considered lost rx buffer +* FALSE: No rx buffer is lost in telemetry device +*/ +bool tele_lost_buf; +/* Work queue for tasks related to MHI telemetry device */ +struct workqueue_struct *tele_wq; +/* Netlink telemetry node */ +struct drm_ras_node *ras_node;/* Array of DBC struct of this device */ struct dma_bridge_chan dbc[] __counted_by(num_dbc); };
drivers/accel/qaic/qaic_drv.c +15 -0
@@ -32,6 +32,7 @@#include "qaic_debugfs.h" #include "qaic_ras.h" #include "qaic_ssr.h" +#include "qaic_telemetry.h" #include "qaic_timesync.h" #include "sahara.h"
@@ -389,6 +390,7 @@ static void qaic_notify_reset(struct qaic_device *qdev) qdev->dev_state =QAIC_OFFLINE ;/* wake up any waiters to avoid waiting for timeouts at sync */ wake_all_cntl (qdev); +wake_all_telemetry (qdev);for (i =0 ; i < qdev->num_dbc; ++i)wakeup_dbc (qdev, i);synchronize_srcu (&qdev->dev_lock);
@@ -439,6 +441,9 @@ static struct qaic_device *create_qdev(struct pci_dev *pdev,if (ret)return NULL ; ret =drmm_mutex_init (drm, &qdev->bootlog_mutex); +if (ret) +return NULL ; + ret =drmm_mutex_init (drm, &qdev->tele_mutex);if (ret)return NULL ;
@@ -451,6 +456,9 @@ static struct qaic_device *create_qdev(struct pci_dev *pdev, qdev->ssr_wq =qaicm_wq_init (drm,"qaic_ssr" );if (IS_ERR (qdev->ssr_wq))return NULL ; + qdev->tele_wq =qaicm_wq_init (drm,"qaic_tele" ); +if (IS_ERR (qdev->tele_wq)) +return NULL ; ret =qaicm_srcu_init (drm, &qdev->dev_lock);if (ret)
@@ -466,6 +474,7 @@ static struct qaic_device *create_qdev(struct pci_dev *pdev,INIT_LIST_HEAD (&qdev->cntl_xfer_list);INIT_LIST_HEAD (&qdev->bootlog); +INIT_LIST_HEAD (&qdev->tele_xfer_list);INIT_LIST_HEAD (&qddev->users);for (i =0 ; i < qdev->num_dbc; ++i) {
@@ -854,12 +863,17 @@ static int __init qaic_init(void) ret =qaic_ras_register ();if (ret)pr_debug ("qaic: qaic_ras_register failed %d\n" , ret); + ret =qaic_ssr_register ();if (ret) {pr_debug ("qaic: qaic_ssr_register failed %d\n" , ret); goto free_bootlog; } + ret =qaic_telemetry_register (); +if (ret) +pr_debug ("qaic: qaic_telemetry_register failed %d\n" , ret); +return 0 ; free_bootlog:
@@ -889,6 +903,7 @@ static void __exit qaic_exit(void)* reinitializing the link_up state after the cleanup is done. */ link_up = true; +qaic_telemetry_unregister ();qaic_ssr_unregister ();qaic_ras_unregister ();qaic_bootlog_unregister ();
drivers/accel/qaic/qaic_telemetry.c new file +564 -0
564 lines not on this page · raw message
drivers/accel/qaic/qaic_telemetry.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* Copyright (c) 2020, The Linux Foundation. All rights reserved. */ + +#ifndef __QAIC_TELEMETRY_H__ +#define __QAIC_TELEMETRY_H__ + +#include "qaic.h" + +int qaic_telemetry_register (void ); +void qaic_telemetry_unregister (void ); +void wake_all_telemetry (struct qaic_device *qdev); + +#endif /* __QAIC_TELEMETRY_H__ */
include/uapi/drm/qaic_accel.h +28 -0
@@ -51,6 +51,34 @@ extern "C" {#define QAIC_TRANS_VALIDATE_PARTITION_FROM_DEV 19#define QAIC_TRANS_VALIDATE_PARTITION_TO_DEV 20 +/* Telemetry fields */ +#define QAIC_DEVINFO_THERMAL_SOC_MAX_TEMP 1 +#define QAIC_DEVINFO_THERMAL_BOARD_TEMP 2 +#define QAIC_DEVINFO_THERMAL_BOARD_MAX_TEMP 3 +#define QAIC_DEVINFO_THERMAL_DDR_TEMP 4 +#define QAIC_DEVINFO_THERMAL_WARNING_TEMP 5 +#define QAIC_DEVINFO_THERMAL_SHUTDOWN_TEMP 6 +#define QAIC_DEVINFO_BOARD_TDP 7 +#define QAIC_DEVINFO_BOARD_POWER 8 +#define QAIC_DEVINFO_POWER_STATE 9 +#define QAIC_DEVINFO_POWER_MAX 10 +#define QAIC_DEVINFO_THROTTLE_PERCENT 11 +#define QAIC_DEVINFO_THROTTLE_TIME 12 +#define QAIC_DEVINFO_UPTIME 13 +#define QAIC_DEVINFO_THERMAL_SOC_FLOOR_TEMP 14 +#define QAIC_DEVINFO_THERMAL_SOC_CEILING_TEMP 15 +#define QAIC_DEVINFO_VOLTAGE_CX 16 +#define QAIC_DEVINFO_VOLTAGE_MX 17 +#define QAIC_DEVINFO_VOLTAGE_NSP_CX 18 +#define QAIC_DEVINFO_VOLTAGE_NSP_MX 19 +#define QAIC_DEVINFO_CFG_TOPS 20 +#define QAIC_DEVINFO_THERMAL_PMIC_TEMP_A 21 +#define QAIC_DEVINFO_THERMAL_PMIC_TEMP_C 22 +#define QAIC_DEVINFO_THERMAL_PMIC_TEMP_E 23 +#define QAIC_DEVINFO_POWER_ACTION 24 +#define QAIC_DEVINFO_SOC_TDP 25 +#define QAIC_DEVINFO_SOC_POWER 26 +/** * struct qaic_manage_trans_hdr - Header for a transaction in a manage message. * @type: In. Identifies this transaction. See QAIC_TRANS_* defines.
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v5 4/4] accel/qaic: Add callbacks for DRM RAS netlink telemetry
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] accel/qaic: Kconfig depends on default-n DRM_RAS despite stubbed API - [Low] accel/qaic: ignored…
Thank you for your contribution! Sashiko AI review found 2 potential issues to consider:
- [Medium] accel/qaic: Kconfig depends on default-n DRM_RAS despite stubbed API
- [Low] accel/qaic: ignored qaic_telemetry_register() failure in qaic_init()
--
commit 8ce3ab45dd93c62906cce075f4239c57f0d04fc1
Author: Zack McKevitt <[email protected]>
accel/qaic: Add callbacks for DRM RAS netlink telemetry
This commit adds MHI telemetry channel support for QAIC devices and registers a DRM RAS telemetry node to expose device telemetry fields over netlink.
drivers/accel/qaic/Kconfig config DRM_ACCEL_QAIC · line 14
Quoted 12 lines
drivers/accel/qaic/Kconfig +1
-0@@ -8,6 +8,7 @@ config DRM_ACCEL_QAIC depends on DRM_ACCEL depends on PCI && HAS_IOMEM depends on MHI_BUS + depends on DRM_RAS select CRC32 select WANT_DEV_COREDUMP help
[Severity: Medium]
Does DRM_ACCEL_QAIC need to depend on DRM_RAS?
DRM_RAS defaults to n (and depends on NET), so adding this dependency causes existing configs with CONFIG_DRM_ACCEL_QAIC enabled to silently drop the driver during olddefconfig unless CONFIG_DRM_RAS is also enabled. Since include/drm/drm_ras.h provides no-op stubs for drm_ras_node_register() and drm_ras_node_unregister() when CONFIG_DRM_RAS is disabled, qaic_telemetry.c can build without this dependency.
[ ... ]
Quoted 4 lines
drivers/accel/qaic/qaic_drv.c +0
-0
[ ... ]
Quoted 19 lines
drivers/accel/qaic/qaic_drv.c +5
-0@@ -854,12 +863,17 @@ static int __init qaic_init(void) ret =qaic_ras_register ();if (ret)pr_debug ("qaic: qaic_ras_register failed %d\n" , ret); + ret =qaic_ssr_register ();if (ret) {pr_debug ("qaic: qaic_ssr_register failed %d\n" , ret); goto free_bootlog; } + ret =qaic_telemetry_register (); +if (ret) +pr_debug ("qaic: qaic_telemetry_register failed %d\n" , ret); +return 0 ; free_bootlog:
drivers/accel/qaic/qaic_drv.c static void __exit qaic_exit(void) · line 909
Quoted 7 lines
drivers/accel/qaic/qaic_drv.c +1
-0@@ -889,6 +903,7 @@ static void __exit qaic_exit(void)* reinitializing the link_up state after the cleanup is done. */ link_up = true; +qaic_telemetry_unregister ();qaic_ssr_unregister ();qaic_ras_unregister ();qaic_bootlog_unregister ();
[Severity: Low]
If qaic_telemetry_register() fails in qaic_init(), module load still succeeds and leaves qaic_telemetry_mhi_driver unregistered. On module unload, qaic_exit() unconditionally calls qaic_telemetry_unregister() -> mhi_driver_unregister() -> driver_unregister(), which hits WARN(1, "Unexpected driver unregister!\n") because drv->p is NULL. Should qaic_init() unwind and return the error when qaic_telemetry_register() fails?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
Quoted 19 lines · Zack McKevitt
This patch series extends the
drm_rasnetlink interface to include a new node type for telemetry nodes. Telemetry nodes support three operations:
getting, setting (optional), and listing telemetry fields. Drivers may specify an optional predoit function to validate get and set operations.Telemetry get operations take the
drm_rasnode id and telemetry field to be read and return the field's value and any status reported by the driver. Telemetry set operations take the node id, telemetry field, and value, and return only the status reported by the driver.Before adding telemetry nodes, a new patch is introduced to add refcounts to
drm_rasnodes stored in the xarray. This protects the nodes, which are owned by the device, from being unregistered and freed in the middle of a netlink doit such as getting an error counter.This extension also removes the admin requirement on the list-nodes operation. This allows
drm_rasnodes to be discovered by userspace programs for drivers that do not necessarily require admin privileges, like qaic.
Quoted 7 lines
The new
drm_rastelemetry interface is implemented by the qaic driver, which exposes the telemetry fields to userspace and enforces filesystem- esque permission checks on telemetry operations in itstelemetry_precallback.Claude Opus 5.5 was used to assist in the development of these patches and to address Sashiko feedback.
Pushed to drm-misc-next, thank you for the patches.
Thanks,
Rodrigo.
Quoted 98 lines
Changes in v5:
- Address Sashiko comments:
- Convert mode from u8 to uint indrm_rasnetlink spec.
- Add check forqdev->dev_state!=QAIC_ONLINEintelemetry_request().
- Flush thetele_wqworkqueue aftermhi_unprepare_from_transferinqaic_telemetry_mhi_remove.
- Small formatting fixes.Link to v4: https://lore.kernel.org/all/[email protected]/
Changes in v4:
- Add refcounts to trackdrm_rasnode lifetimes.
- Address Sashiko comments:
- Fix status field population when HW returns an error.
- Add refcounts for telemetry nodes.
- Update outdated commit messages.
- Add static to private functions inqaic_telemetry.c, and remove them fromqaic_telemetry.h.
- Stop returning remaining jiffies when device status is nonzero intelemetry_request().
- Addmhi_unprepare_from_transferifdrm_rasnode registration fails inqaic_telemetry_mhi_probe().
- Consolidate get/set dumpits into a single dump operation.
- Pin telemetry node to context in pre-doit and unpin in post-doit. This ensures the same node is used between pre-doit and doit calls.
- Change field attribute to uint and status to sint.
- AddedNL_SET_BAD_ATTRcalls to telemetry netlink functions.
- Reject non-telemetry nodes in telemetry get/set/list-fields.
- Updated qaicKconfigto depend onDRM_RAS.Link to v3: https://lore.kernel.org/all/[email protected]/#t
Changes in v3:
- Address Sashiko comments:
- Properly return status when telemetry request is successful but a hardware error occurs.
- Validate telemetry fields against their gettable/settable fields lists when invoking the predoit.
- Update documentation ininclude/drm/drm_ras.h.
- Moved calls to qaic_drm_ras_register/unregister to mhi_probe/remove instead of pci_probe/remove.
- Added srcu read locks around calls totelemetry_request()in get and set callbacks inqaic_telemetry.c.
- Added atele_chcheck totelemetry_request().
- Properly handle a-ERESTARTSYSreturn fromwait_for_completion_interrputableintelemetry_request().
- Ensure field can be truncated to a u8 in qaic's telemetry get and set callbacks.
- Minor code cleanups (typos, header ordering, etc).Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Address Sashiko comments:
- Initialize certain stack variables indrm_ras.c.
- Added attribute guards (GENL_REQ_ATTR_CHECK) in telemetry doits.
- Added a valid node check indrm_ras_nl_pre_telemetry.
- Fixed improper node callback intelemetry_set.
- Now registeringdrm_rasnode after MHI initialization.
- Now removingdrm_rasnode before freeing MHI controller.
- Addedscoped_with_init_fsguard to qaic_telemetry_pre's inode check.
- Fixed improper kfree inqaic_drm_ras_register_node.
- Changed telemetry value attribute to sint and dropped padding attribute.
- Updated documentation indrm_ras.yaml.
- Renamed telemetry read/write to get/set.
- Added dumpit for gettable and settable telemetry values.
- Madetelemetry_setoptional and added admin-perm for it.
- Specified ynl file regeneration in commit message for patch 2.Link to v1: https://lore.kernel.org/all/[email protected]/
Zack McKevitt (4):
drm/drm_ras: Reference-count nodes across netlink handlers drm/drm_ras: Remove admin-perm flag from list-nodes operation drm/drm_ras: Extend DRM RAS interface to include telemetry nodes accel/qaic: Add callbacks for DRM RAS netlink telemetryDocumentation/netlink/specs/drm_ras.yaml | 98 +++- drivers/accel/qaic/Kconfig | 1 + drivers/accel/qaic/Makefile | 1 + drivers/accel/qaic/qaic.h | 19 + drivers/accel/qaic/qaic_drv.c | 15 + drivers/accel/qaic/qaic_telemetry.c | 564 +++++++++++++++++++++ drivers/accel/qaic/qaic_telemetry.h | 14 + drivers/gpu/drm/drm_ras.c | 611 ++++++++++++++++++++--- drivers/gpu/drm/drm_ras_nl.c | 45 +- drivers/gpu/drm/drm_ras_nl.h | 10 + include/drm/drm_ras.h | 98 ++++ include/uapi/drm/drm_ras.h | 29 +- include/uapi/drm/qaic_accel.h | 28 ++ 13 files changed, 1462 insertions(+), 71 deletions(-) create mode 100644 drivers/accel/qaic/qaic_telemetry.c create mode 100644 drivers/accel/qaic/qaic_telemetry.hSignature · 1 line
2.43.0