From: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
To: intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
alexander.deucher@amd.com, airlied@gmail.com, daniel@ffwll.ch,
joonas.lahtinen@linux.intel.com, ogabbay@kernel.org,
ttayar@habana.ai, Hawking.Zhang@amd.com,
Harish.Kasiviswanathan@amd.com, Felix.Kuehling@amd.com,
Luben.Tuikov@amd.com, michael.j.ruhl@intel.com
Subject: [Intel-xe] [RFC v2 2/5] drm/xe/RAS: Register netlink capability
Date: Fri, 20 Oct 2023 21:28:32 +0530 [thread overview]
Message-ID: <20231020155835.1295524-3-aravind.iddamsetty@linux.intel.com> (raw)
In-Reply-To: <20231020155835.1295524-1-aravind.iddamsetty@linux.intel.com>
Register netlink capability with the DRM and register the driver
callbacks to DRM RAS netlink commands.
v2:
Move the netlink registration parts to DRM susbsytem (Tomer Tayar)
Cc: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Aravind Iddamsetty <aravind.iddamsetty@linux.intel.com>
---
drivers/gpu/drm/xe/Makefile | 1 +
drivers/gpu/drm/xe/xe_device.c | 4 ++++
drivers/gpu/drm/xe/xe_device_types.h | 1 +
drivers/gpu/drm/xe/xe_netlink.c | 22 ++++++++++++++++++++++
4 files changed, 28 insertions(+)
create mode 100644 drivers/gpu/drm/xe/xe_netlink.c
diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index ed772f440689..048f9a23e2f0 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -87,6 +87,7 @@ xe-y += xe_bb.o \
xe_mmio.o \
xe_mocs.o \
xe_module.o \
+ xe_netlink.o \
xe_pat.o \
xe_pci.o \
xe_pcode.o \
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 628cb46a2509..8c928719a537 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -151,6 +151,8 @@ static void xe_driver_release(struct drm_device *dev)
pci_set_drvdata(to_pci_dev(xe->drm.dev), NULL);
}
+extern const struct driver_genl_ops xe_genl_ops[];
+
static struct drm_driver driver = {
/* Don't use MTRRs here; the Xserver or userspace app should
* deal with them for Intel hardware.
@@ -159,6 +161,7 @@ static struct drm_driver driver = {
DRIVER_GEM |
DRIVER_RENDER | DRIVER_SYNCOBJ |
DRIVER_SYNCOBJ_TIMELINE | DRIVER_GEM_GPUVA,
+
.open = xe_file_open,
.postclose = xe_file_close,
@@ -170,6 +173,7 @@ static struct drm_driver driver = {
.show_fdinfo = xe_drm_client_fdinfo,
#endif
.release = &xe_driver_release,
+ .genl_ops = xe_genl_ops,
.ioctls = xe_ioctls,
.num_ioctls = ARRAY_SIZE(xe_ioctls),
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index a1bacf820d37..8201f3644b86 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -10,6 +10,7 @@
#include <drm/drm_device.h>
#include <drm/drm_file.h>
+#include <drm/drm_netlink.h>
#include <drm/ttm/ttm_device.h>
#include "xe_devcoredump_types.h"
diff --git a/drivers/gpu/drm/xe/xe_netlink.c b/drivers/gpu/drm/xe/xe_netlink.c
new file mode 100644
index 000000000000..81d785455632
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_netlink.c
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2023 Intel Corporation
+ */
+#include "xe_device.h"
+
+static int xe_genl_list_errors(struct drm_device *drm, struct sk_buff *msg, struct genl_info *info)
+{
+ return 0;
+}
+
+static int xe_genl_read_error(struct drm_device *drm, struct sk_buff *msg, struct genl_info *info)
+{
+ return 0;
+}
+
+/* driver callbacks to DRM netlink commands*/
+const struct driver_genl_ops xe_genl_ops[] = {
+ [DRM_RAS_CMD_QUERY] = { .doit = xe_genl_list_errors },
+ [DRM_RAS_CMD_READ_ONE] = { .doit = xe_genl_read_error },
+ [DRM_RAS_CMD_READ_ALL] = { .doit = xe_genl_list_errors, },
+};
--
2.25.1
next prev parent reply other threads:[~2023-10-20 15:56 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 15:58 [Intel-xe] [RFC v4 0/5] Proposal to use netlink for RAS and Telemetry across drm subsystem Aravind Iddamsetty
2023-10-20 15:58 ` [Intel-xe] [RFC v4 1/5] drm/netlink: Add netlink infrastructure Aravind Iddamsetty
2023-10-20 20:36 ` Ruhl, Michael J
2023-10-21 1:10 ` Aravind Iddamsetty
2023-11-10 12:24 ` Tomer Tayar
2023-11-22 14:32 ` Aravind Iddamsetty
2023-11-23 7:26 ` Tomer Tayar
2023-10-20 15:58 ` Aravind Iddamsetty [this message]
2023-10-20 20:37 ` [Intel-xe] [RFC v2 2/5] drm/xe/RAS: Register netlink capability Ruhl, Michael J
2023-10-20 15:58 ` [Intel-xe] [RFC v3 3/5] drm/xe/RAS: Expose the error counters Aravind Iddamsetty
2023-10-20 20:39 ` Ruhl, Michael J
2023-11-10 12:27 ` Tomer Tayar
2023-11-22 14:33 ` Aravind Iddamsetty
2023-10-20 15:58 ` [Intel-xe] [RFC 4/5] drm/netlink: Define multicast groups Aravind Iddamsetty
2023-10-20 20:39 ` Ruhl, Michael J
2023-10-20 15:58 ` [Intel-xe] [RFC v2 5/5] drm/xe/RAS: send multicast event on occurrence of an error Aravind Iddamsetty
2023-10-20 20:40 ` Ruhl, Michael J
2023-11-10 12:27 ` Tomer Tayar
2023-11-12 15:28 ` Tomer Tayar
2023-11-22 14:34 ` Aravind Iddamsetty
2023-10-23 15:29 ` [Intel-xe] [RFC v4 0/5] Proposal to use netlink for RAS and Telemetry across drm subsystem Alex Deucher
2023-10-24 8:59 ` Zhang, Hawking
2023-10-26 9:27 ` Aravind Iddamsetty
2023-10-26 10:04 ` Lazar, Lijo
2023-10-30 6:19 ` Aravind Iddamsetty
2023-10-30 15:11 ` Lazar, Lijo
2023-11-01 8:06 ` Aravind Iddamsetty
2023-11-07 5:30 ` Lazar, Lijo
2023-11-08 9:24 ` Aravind Iddamsetty
2023-10-24 1:58 ` [Intel-xe] ✗ CI.Patch_applied: failure for Proposal to use netlink for RAS and Telemetry across drm subsystem (rev4) Patchwork
2023-11-10 12:23 ` [Intel-xe] [RFC v4 0/5] Proposal to use netlink for RAS and Telemetry across drm subsystem Tomer Tayar
2023-11-22 14:28 ` Aravind Iddamsetty
-- strict thread matches above, loose matches on Subject: below --
2023-10-08 9:26 [Intel-xe] [RFC v3 " Aravind Iddamsetty
2023-10-08 9:26 ` [Intel-xe] [RFC v2 2/5] drm/xe/RAS: Register netlink capability Aravind Iddamsetty
2023-08-25 11:55 [Intel-xe] [RFC v2 0/5] Proposal to use netlink for RAS and Telemetry across drm subsystem Aravind Iddamsetty
2023-08-25 11:55 ` [Intel-xe] [RFC v2 2/5] drm/xe/RAS: Register netlink capability Aravind Iddamsetty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231020155835.1295524-3-aravind.iddamsetty@linux.intel.com \
--to=aravind.iddamsetty@linux.intel.com \
--cc=Felix.Kuehling@amd.com \
--cc=Harish.Kasiviswanathan@amd.com \
--cc=Hawking.Zhang@amd.com \
--cc=Luben.Tuikov@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=joonas.lahtinen@linux.intel.com \
--cc=michael.j.ruhl@intel.com \
--cc=ogabbay@kernel.org \
--cc=ttayar@habana.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox