]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/ras: Introduce the DRM RAS infrastructure over generic netlink
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Wed, 4 Mar 2026 07:44:08 +0000 (13:14 +0530)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 6 Mar 2026 00:38:55 +0000 (19:38 -0500)
commitc36218dc49f5e9ef9e3074670fdae7ac3a7e794f
tree18aae01ce22efb3d3abf70cb0be551c82480b297
parent724b4a12116fdb60130b89778611482bf8de0a6a
drm/ras: Introduce the DRM RAS infrastructure over generic netlink

Introduces the DRM RAS infrastructure over generic netlink.

The new interface allows drivers to expose RAS nodes and their
associated error counters to userspace in a structured and extensible
way. Each drm_ras node can register its own set of error counters, which
are then discoverable and queryable through netlink operations. This
lays the groundwork for reporting and managing hardware error states
in a unified manner across different DRM drivers.

Currently it only supports error-counter nodes. But it can be
extended later.

The registration is also not tied to any drm node, so it can be
used by accel devices as well.

It uses the new and mandatory YAML description format stored in
Documentation/netlink/specs/. This forces a single generic netlink
family namespace for the entire drm: "drm-ras".
But multiple-endpoints are supported within the single family.

Any modification to this API needs to be applied to
Documentation/netlink/specs/drm_ras.yaml before regenerating the
code:

$ tools/net/ynl/pyynl/ynl_gen_c.py --spec \
 Documentation/netlink/specs/drm_ras.yaml --mode uapi --header \
 -o include/uapi/drm/drm_ras.h

$ tools/net/ynl/pyynl/ynl_gen_c.py --spec \
  Documentation/netlink/specs/drm_ras.yaml --mode kernel \
  --header -o drivers/gpu/drm/drm_ras_nl.h

$ tools/net/ynl/pyynl/ynl_gen_c.py --spec \
  Documentation/netlink/specs/drm_ras.yaml \
  --mode kernel --source -o drivers/gpu/drm/drm_ras_nl.c

Cc: Zack McKevitt <zachary.mckevitt@oss.qualcomm.com>
Cc: Lijo Lazar <lijo.lazar@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: netdev@vger.kernel.org
Co-developed-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
Signed-off-by: Riana Tauro <riana.tauro@intel.com>
Reviewed-by: Zack McKevitt <zachary.mckevitt@oss.qualcomm.com>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patch.msgid.link/20260304074412.464435-8-riana.tauro@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
13 files changed:
Documentation/gpu/drm-ras.rst [new file with mode: 0644]
Documentation/gpu/index.rst
Documentation/netlink/specs/drm_ras.yaml [new file with mode: 0644]
drivers/gpu/drm/Kconfig
drivers/gpu/drm/Makefile
drivers/gpu/drm/drm_drv.c
drivers/gpu/drm/drm_ras.c [new file with mode: 0644]
drivers/gpu/drm/drm_ras_genl_family.c [new file with mode: 0644]
drivers/gpu/drm/drm_ras_nl.c [new file with mode: 0644]
drivers/gpu/drm/drm_ras_nl.h [new file with mode: 0644]
include/drm/drm_ras.h [new file with mode: 0644]
include/drm/drm_ras_genl_family.h [new file with mode: 0644]
include/uapi/drm/drm_ras.h [new file with mode: 0644]