Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
@ 2026-01-02 16:54 Anoop, Vijay
  2026-01-02 16:54 ` [PATCH v2 1/1] " Anoop, Vijay
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Anoop, Vijay @ 2026-01-02 16:54 UTC (permalink / raw)
  To: intel-xe
  Cc: umesh.nerlige.ramappa, badal.nilawar, rodrigo.vivi,
	aravind.iddamsetty, riana.tauro, ravi.kishore.koppuravuri,
	anshuman.gupta, matthew.d.roper, michael.j.ruhl, paul.e.luse,
	mohamed.mansoor.v, kam.nasim

From: Anoop Vijay <anoop.c.vijay@intel.com>

This patch introduces System Controller (sysctrl) component for Intel Xe3p dGPU platforms.

This component provides the foundational infrastructure for communication
with the System Controller firmware using MKHI protocol over a mailbox interface.

Key features introduced:
- Detection and initialization of System Controller interface on Xe3p dGPU platforms
- Mailbox communication with System Controller firmware
- Fragmented message transfer for large command payloads

This implementation establishes the base for future System Controller feature
enablement and firmware command handling.

Changes in v2:
- General code cleanup and improved inline documentation.
- Rebased on latest upstream branch.
- Addressed all warnings and kernel coding style issues reported in v1 patch.
- Improved function parameter alignment and line wrapping.
- Updated macro definitions in header files to avoid long lines.
- Updated variable and parameter names for better readability.

Anoop Vijay (1):
  drm/xe/sysctrl: Add system controller component for Xe3p dGPU
    platforms

 drivers/gpu/drm/xe/Makefile               |   2 +
 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h |  44 +++
 drivers/gpu/drm/xe/xe_device.c            |   5 +
 drivers/gpu/drm/xe/xe_device_types.h      |   6 +
 drivers/gpu/drm/xe/xe_pci.c               |   2 +
 drivers/gpu/drm/xe/xe_pci_types.h         |   1 +
 drivers/gpu/drm/xe/xe_sysctrl.c           |  62 ++++
 drivers/gpu/drm/xe/xe_sysctrl.h           |  18 +
 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c   | 409 ++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h   |  77 ++++
 drivers/gpu/drm/xe/xe_sysctrl_types.h     |  23 ++
 11 files changed, 649 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.c
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.h
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h

-- 
2.43.0


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
  2026-01-02 16:54 [PATCH v2 0/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms Anoop, Vijay
@ 2026-01-02 16:54 ` Anoop, Vijay
  2026-01-02 23:15   ` Matthew Brost
                     ` (2 more replies)
  2026-01-02 17:01 ` ✗ CI.checkpatch: warning for drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms (rev2) Patchwork
  2026-01-02 17:02 ` ✓ CI.KUnit: success " Patchwork
  2 siblings, 3 replies; 8+ messages in thread
From: Anoop, Vijay @ 2026-01-02 16:54 UTC (permalink / raw)
  To: intel-xe
  Cc: umesh.nerlige.ramappa, badal.nilawar, rodrigo.vivi,
	aravind.iddamsetty, riana.tauro, ravi.kishore.koppuravuri,
	anshuman.gupta, matthew.d.roper, michael.j.ruhl, paul.e.luse,
	mohamed.mansoor.v, kam.nasim

From: Anoop Vijay <anoop.c.vijay@intel.com>

Add a new system controller (sysctrl) component for Intel Xe3p dGPU
platforms.

This component provides the foundational infrastructure for communication
with the System Controller firmware using MKHI protocol over a mailbox
interface.

Key features introduced:
 - Detection and initialization of System Controller interface on Xe3p
   dGPU platforms
 - Mailbox communication with System Controller firmware
 - Fragmented message transfer for large command payloads

This implementation establishes the base for future System Controller
feature enablement and firmware command handling.

Signed-off-by: Anoop Vijay <anoop.c.vijay@intel.com>
---
 drivers/gpu/drm/xe/Makefile               |   2 +
 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h |  44 +++
 drivers/gpu/drm/xe/xe_device.c            |   5 +
 drivers/gpu/drm/xe/xe_device_types.h      |   6 +
 drivers/gpu/drm/xe/xe_pci.c               |   2 +
 drivers/gpu/drm/xe/xe_pci_types.h         |   1 +
 drivers/gpu/drm/xe/xe_sysctrl.c           |  62 ++++
 drivers/gpu/drm/xe/xe_sysctrl.h           |  18 +
 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c   | 409 ++++++++++++++++++++++
 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h   |  77 ++++
 drivers/gpu/drm/xe/xe_sysctrl_types.h     |  23 ++
 11 files changed, 649 insertions(+)
 create mode 100644 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.c
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.h
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
 create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h

diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
index 2b20c79d7ec9..947fbcac65d5 100644
--- a/drivers/gpu/drm/xe/Makefile
+++ b/drivers/gpu/drm/xe/Makefile
@@ -121,6 +121,8 @@ xe-y += xe_bb.o \
 	xe_step.o \
 	xe_survivability_mode.o \
 	xe_sync.o \
+	xe_sysctrl.o \
+	xe_sysctrl_mailbox.o \
 	xe_tile.o \
 	xe_tile_sysfs.o \
 	xe_tlb_inval.o \
diff --git a/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
new file mode 100644
index 000000000000..6627a9c32c4f
--- /dev/null
+++ b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
@@ -0,0 +1,44 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#ifndef _XE_SYSCTRL_REGS_H_
+#define _XE_SYSCTRL_REGS_H_
+
+#include "xe_regs.h"
+
+#define SYSCTRL_BASE_OFFSET		0xDB000
+#define SYSCTRL_BASE			(SOC_BASE + SYSCTRL_BASE_OFFSET)
+#define SYSCTRL_MAILBOX_INDEX		0x03
+#define SC_BAR_LENGTH			0x1000
+
+#define SC_MB_CTRL			XE_REG(SYSCTRL_BASE + 0x10)
+#define   SC_MB_CTRL_RUN_BUSY		REG_BIT(31)
+#define   SC_MB_CTRL_IRQ		REG_BIT(30)
+#define   SC_MB_CTRL_RUN_BUSY_OUT	REG_BIT(29)
+#define   SC_MB_CTRL_PARAM3_MASK	REG_GENMASK(28, 24)
+#define   SC_MB_CTRL_PARAM2_MASK	REG_GENMASK(23, 16)
+#define   SC_MB_CTRL_PARAM1_MASK	REG_GENMASK(15, 8)
+#define   SC_MB_CTRL_COMMAND_MASK	REG_GENMASK(7, 0)
+
+#define SC_MB_DATA0			XE_REG(SYSCTRL_BASE + 0x14)
+#define SC_MB_DATA1			XE_REG(SYSCTRL_BASE + 0x18)
+#define SC_MB_DATA2			XE_REG(SYSCTRL_BASE + 0x1C)
+#define SC_MB_DATA3			XE_REG(SYSCTRL_BASE + 0x20)
+
+#define MKHI_FRAME_PHASE		REG_BIT(24)
+#define MKHI_FRAME_CURRENT_MASK		REG_GENMASK(21, 16)
+#define MKHI_FRAME_TOTAL_MASK		REG_GENMASK(13, 8)
+#define MKHI_FRAME_COMMAND_MASK		REG_GENMASK(7, 0)
+
+#define SC_MB_FRAME_SIZE		16
+#define SC_MB_MAX_FRAMES		64
+#define SC_MB_MAX_MESSAGE_SIZE		(SC_MB_FRAME_SIZE * SC_MB_MAX_FRAMES)
+#define SC_MKHI_COMMAND			5
+
+#define SC_MB_DEFAULT_TIMEOUT_MS	500
+#define SC_MB_RETRY_TIMEOUT_MS		20
+#define SC_MB_POLL_INTERVAL_US		100
+
+#endif /* _XE_SYSCTRL_REGS_H_ */
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index e101d290b2a6..805d48dd954d 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -66,6 +66,7 @@
 #include "xe_survivability_mode.h"
 #include "xe_sriov.h"
 #include "xe_svm.h"
+#include "xe_sysctrl.h"
 #include "xe_tile.h"
 #include "xe_ttm_stolen_mgr.h"
 #include "xe_ttm_sys_mgr.h"
@@ -1032,6 +1033,10 @@ int xe_device_probe(struct xe_device *xe)
 	if (err)
 		goto err_unregister_display;
 
+	err = xe_sysctrl_init(xe);
+	if (err)
+		goto err_unregister_display;
+
 	err = xe_device_sysfs_init(xe);
 	if (err)
 		goto err_unregister_display;
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index a85be9ba175e..6295b2c35d4a 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -29,6 +29,7 @@
 #include "xe_sriov_vf_ccs_types.h"
 #include "xe_step_types.h"
 #include "xe_survivability_mode_types.h"
+#include "xe_sysctrl_types.h"
 #include "xe_tile_sriov_vf_types.h"
 #include "xe_validation.h"
 
@@ -340,6 +341,8 @@ struct xe_device {
 		u8 has_soc_remapper_telem:1;
 		/** @info.has_sriov: Supports SR-IOV */
 		u8 has_sriov:1;
+		/** @info.has_sysctrl: Supports System Controller */
+		u8 has_sysctrl:1;
 		/** @info.has_usm: Device has unified shared memory support */
 		u8 has_usm:1;
 		/** @info.has_64bit_timestamp: Device supports 64-bit timestamps */
@@ -606,6 +609,9 @@ struct xe_device {
 	/** @heci_gsc: graphics security controller */
 	struct xe_heci_gsc heci_gsc;
 
+	/** @sc: System Controller */
+	struct xe_sysctrl sc;
+
 	/** @nvm: discrete graphics non-volatile memory */
 	struct intel_dg_nvm_dev *nvm;
 
diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index 91e0553a8163..b6dc3030b673 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -426,6 +426,7 @@ static const struct xe_device_desc cri_desc = {
 	.has_soc_remapper_sysctrl = true,
 	.has_soc_remapper_telem = true,
 	.has_sriov = true,
+	.has_sysctrl = true,
 	.max_gt_per_tile = 2,
 	.require_force_probe = true,
 	.va_bits = 57,
@@ -701,6 +702,7 @@ static int xe_info_init_early(struct xe_device *xe,
 	xe->info.has_soc_remapper_telem = desc->has_soc_remapper_telem;
 	xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
 		desc->has_sriov;
+	xe->info.has_sysctrl = desc->has_sysctrl;
 	xe->info.has_mem_copy_instr = desc->has_mem_copy_instr;
 	xe->info.skip_guc_pc = desc->skip_guc_pc;
 	xe->info.skip_mtcfg = desc->skip_mtcfg;
diff --git a/drivers/gpu/drm/xe/xe_pci_types.h b/drivers/gpu/drm/xe/xe_pci_types.h
index 5f20f56571d1..53e44a32883d 100644
--- a/drivers/gpu/drm/xe/xe_pci_types.h
+++ b/drivers/gpu/drm/xe/xe_pci_types.h
@@ -56,6 +56,7 @@ struct xe_device_desc {
 	u8 has_soc_remapper_sysctrl:1;
 	u8 has_soc_remapper_telem:1;
 	u8 has_sriov:1;
+	u8 has_sysctrl:1;
 	u8 needs_scratch:1;
 	u8 skip_guc_pc:1;
 	u8 skip_mtcfg:1;
diff --git a/drivers/gpu/drm/xe/xe_sysctrl.c b/drivers/gpu/drm/xe/xe_sysctrl.c
new file mode 100644
index 000000000000..e0e7b0ecf2bf
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sysctrl.c
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#include <drm/drm_managed.h>
+#include <linux/device.h>
+#include <linux/mutex.h>
+
+#include "regs/xe_sysctrl_regs.h"
+#include "xe_device.h"
+#include "xe_printk.h"
+#include "xe_soc_remapper.h"
+#include "xe_sysctrl.h"
+#include "xe_sysctrl_mailbox.h"
+#include "xe_sysctrl_types.h"
+
+static void xe_sysctrl_fini(void *arg)
+{
+	struct xe_sysctrl *sc = arg;
+	struct xe_device *xe = sc_to_xe(sc);
+
+	if (!xe->soc_remapper.set_sysctrl_region)
+		return;
+
+	xe->soc_remapper.set_sysctrl_region(xe, 0);
+}
+
+/**
+ * xe_sysctrl_init - Initialize SC subsystem
+ * @xe: xe device instance
+ *
+ * Entry point for SC initialization, called from xe_device_probe().
+ * This function checks platform support and initializes the system controller.
+ *
+ * Return: 0 on success, error code on failure
+ */
+int xe_sysctrl_init(struct xe_device *xe)
+{
+	struct xe_sysctrl *sc = &xe->sc;
+	int ret;
+
+	if (!xe->info.has_sysctrl)
+		return 0;
+
+	ret = devm_add_action_or_reset(xe->drm.dev, xe_sysctrl_fini, sc);
+	if (ret)
+		return ret;
+
+	if (!xe->soc_remapper.set_sysctrl_region)
+		return -ENODEV;
+
+	xe->soc_remapper.set_sysctrl_region(xe, SYSCTRL_MAILBOX_INDEX);
+
+	ret = drmm_mutex_init(&xe->drm, &sc->cmd_lock);
+	if (ret)
+		return ret;
+
+	xe_sysctrl_mailbox_init(sc);
+
+	return 0;
+}
diff --git a/drivers/gpu/drm/xe/xe_sysctrl.h b/drivers/gpu/drm/xe/xe_sysctrl.h
new file mode 100644
index 000000000000..fe90d6577d54
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sysctrl.h
@@ -0,0 +1,18 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#ifndef _XE_SYSCTRL_H_
+#define _XE_SYSCTRL_H_
+
+struct xe_device;
+
+static inline struct xe_device *sc_to_xe(struct xe_sysctrl *sc)
+{
+	return container_of(sc, struct xe_device, sc);
+}
+
+int xe_sysctrl_init(struct xe_device *xe);
+
+#endif /* _XE_SYSCTRL_H_ */
diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
new file mode 100644
index 000000000000..940ea535da2e
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
@@ -0,0 +1,409 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#include <linux/bitfield.h>
+#include <linux/errno.h>
+#include <linux/minmax.h>
+#include <linux/mutex.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include <linux/types.h>
+
+#include "regs/xe_sysctrl_regs.h"
+#include "xe_device.h"
+#include "xe_mmio.h"
+#include "xe_pm.h"
+#include "xe_printk.h"
+#include "xe_sysctrl.h"
+#include "xe_sysctrl_mailbox.h"
+#include "xe_sysctrl_types.h"
+
+static bool xe_sysctrl_mailbox_wait_bit_clear(struct xe_sysctrl *sc, u32 bit_mask,
+					      unsigned int timeout_ms)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+	int ret;
+
+	ret = xe_mmio_wait32_not(mmio, SC_MB_CTRL, bit_mask, bit_mask,
+				 timeout_ms * 1000, NULL, false);
+
+	return ret == 0;
+}
+
+static bool xe_sysctrl_mailbox_wait_bit_set(struct xe_sysctrl *sc, u32 bit_mask,
+					    unsigned int timeout_ms)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+	int ret;
+
+	ret = xe_mmio_wait32(mmio, SC_MB_CTRL, bit_mask, bit_mask,
+			     timeout_ms * 1000, NULL, false);
+
+	return ret == 0;
+}
+
+static int xe_sysctrl_mailbox_write_frame(struct xe_sysctrl *sc, const void *frame,
+					  size_t len)
+{
+	static const struct xe_reg regs[] = {
+		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
+	};
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
+	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
+	u32 i;
+
+	memcpy(val, frame, len);
+
+	for (i = 0; i < dw; i++)
+		xe_mmio_write32(mmio, regs[i], val[i]);
+
+	return 0;
+}
+
+static int xe_sysctrl_mailbox_read_frame(struct xe_sysctrl *sc, void *frame,
+					 size_t len)
+{
+	static const struct xe_reg regs[] = {
+		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
+	};
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
+	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
+	u32 i;
+
+	for (i = 0; i < dw; i++)
+		val[i] = xe_mmio_read32(mmio, regs[i]);
+
+	memcpy(frame, val, len);
+
+	return 0;
+}
+
+static void xe_sysctrl_mailbox_clear_response(struct xe_sysctrl *sc)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+
+	xe_mmio_rmw32(mmio, SC_MB_CTRL, SC_MB_CTRL_RUN_BUSY_OUT, 0);
+}
+
+static int xe_sysctrl_mailbox_prepare_command(struct xe_sysctrl *sc,
+					      u8 group_id, u8 command,
+					      const void *data_in, size_t data_in_len,
+					      u8 **mbox_cmd, size_t *cmd_size)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
+	size_t size;
+	u8 *buffer;
+
+	size = sizeof(*mkhi_hdr) + data_in_len;
+	if (size > SC_MB_MAX_MESSAGE_SIZE) {
+		xe_err(xe, "sysctrl: Message too large: %zu bytes\n", size);
+		return -EINVAL;
+	}
+
+	buffer = kmalloc(size, GFP_KERNEL);
+	if (!buffer)
+		return -ENOMEM;
+
+	mkhi_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)buffer;
+	mkhi_hdr->data = cpu_to_le32(FIELD_PREP(MKHI_HDR_GROUP_ID_MASK, group_id) |
+				     FIELD_PREP(MKHI_HDR_COMMAND_MASK, command & 0x7F) |
+				     FIELD_PREP(MKHI_HDR_IS_RESPONSE, 0) |
+				     FIELD_PREP(MKHI_HDR_RESERVED_MASK, 0) |
+				     FIELD_PREP(MKHI_HDR_RESULT_MASK, 0));
+
+	if (data_in && data_in_len)
+		memcpy(buffer + sizeof(*mkhi_hdr), data_in, data_in_len);
+
+	*mbox_cmd = buffer;
+	*cmd_size = size;
+
+	return 0;
+}
+
+static int xe_sysctrl_mailbox_send_frames(struct xe_sysctrl *sc, const u8 *mbox_cmd,
+					  size_t cmd_size, unsigned int timeout_ms)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+	u32 ctrl_reg, total_frames, frame;
+	size_t bytes_sent, frame_size;
+
+	total_frames = DIV_ROUND_UP(cmd_size, SC_MB_FRAME_SIZE);
+
+	if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
+		xe_err(xe, "sysctrl: Mailbox busy\n");
+		return -EBUSY;
+	}
+
+	sc->phase_bit ^= 1;
+	bytes_sent = 0;
+
+	for (frame = 0; frame < total_frames; frame++) {
+		frame_size = min(cmd_size - bytes_sent, (size_t)SC_MB_FRAME_SIZE);
+
+		if (xe_sysctrl_mailbox_write_frame(sc, mbox_cmd + bytes_sent, frame_size)) {
+			xe_err(xe, "sysctrl: Failed to write frame %u\n", frame);
+			sc->phase_bit ^= 1;
+			return -EIO;
+		}
+
+		ctrl_reg = SC_MB_CTRL_RUN_BUSY |
+			   FIELD_PREP(MKHI_FRAME_CURRENT_MASK, frame) |
+			   FIELD_PREP(MKHI_FRAME_TOTAL_MASK, total_frames - 1) |
+			   FIELD_PREP(MKHI_FRAME_COMMAND_MASK, SC_MKHI_COMMAND) |
+			   (sc->phase_bit ? MKHI_FRAME_PHASE : 0);
+
+		xe_mmio_write32(mmio, SC_MB_CTRL, ctrl_reg);
+
+		if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
+			xe_err(xe, "sysctrl: Frame %u acknowledgment timeout\n", frame);
+			return -ETIMEDOUT;
+		}
+
+		bytes_sent += frame_size;
+	}
+
+	return 0;
+}
+
+static int xe_sysctrl_mailbox_process_first_frame(struct xe_sysctrl *sc,
+						  const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
+						  void *out,
+						  size_t frame_size,
+						  size_t *payload_bytes)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	u32 frame_data[4];
+	struct xe_sysctrl_mailbox_mkhi_msg_hdr *resp_hdr;
+	size_t hdr_size = sizeof(*resp_hdr);
+	size_t payload_size;
+	int ret;
+
+	ret = xe_sysctrl_mailbox_read_frame(sc, frame_data, frame_size);
+	if (ret)
+		return ret;
+
+	resp_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)frame_data;
+
+	if (!XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(resp_hdr) ||
+	    XE_SYSCTRL_MKHI_HDR_GROUP_ID(resp_hdr) != XE_SYSCTRL_MKHI_HDR_GROUP_ID(req) ||
+	    XE_SYSCTRL_MKHI_HDR_COMMAND(resp_hdr) != XE_SYSCTRL_MKHI_HDR_COMMAND(req)) {
+		xe_err(xe, "SC: Response header mismatch\n");
+		return -EPROTO;
+	}
+
+	if (XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr) != 0) {
+		xe_err(xe, "SC: Firmware error: 0x%02lx\n",
+		       XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr));
+		return -EIO;
+	}
+
+	payload_size = frame_size - hdr_size;
+	if (payload_size > 0)
+		memcpy(out, (u8 *)frame_data + hdr_size, payload_size);
+
+	*payload_bytes = payload_size;
+
+	xe_sysctrl_mailbox_clear_response(sc);
+
+	return 0;
+}
+
+static int xe_sysctrl_mailbox_process_frame(struct xe_sysctrl *sc,
+					    void *out, size_t frame_size,
+					    unsigned int timeout_ms)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	int ret;
+
+	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
+		xe_err(xe, "sysctrl: Response frame timeout\n");
+		return -ETIMEDOUT;
+	}
+
+	ret = xe_sysctrl_mailbox_read_frame(sc, out, frame_size);
+	if (ret)
+		return ret;
+
+	xe_sysctrl_mailbox_clear_response(sc);
+
+	return 0;
+}
+
+static int xe_sysctrl_mailbox_receive_frames(struct xe_sysctrl *sc,
+					     const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
+					     void *data_out, size_t data_out_len,
+					     size_t *rdata_len, unsigned int timeout_ms)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
+	u32 ctrl_reg, total_frames, frame;
+	size_t hdr_size = sizeof(*mkhi_hdr);
+	u8 *out = data_out;
+	size_t received = 0;
+	size_t frame_size;
+	int ret = 0;
+
+	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
+		xe_err(xe, "sysctrl: Response frame 0 timeout\n");
+		return -ETIMEDOUT;
+	}
+
+	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
+	total_frames = FIELD_GET(MKHI_FRAME_TOTAL_MASK, ctrl_reg) + 1;
+
+	if (total_frames == 1)
+		frame_size = min(hdr_size + data_out_len, (size_t)SC_MB_FRAME_SIZE);
+	else
+		frame_size = SC_MB_FRAME_SIZE;
+
+	ret = xe_sysctrl_mailbox_process_first_frame(sc, req, out, frame_size, &received);
+	if (ret)
+		return ret;
+
+	out += received;
+
+	for (frame = 1; frame < total_frames; frame++) {
+		size_t remaining = data_out_len - received;
+
+		frame_size = min_t(size_t, remaining, SC_MB_FRAME_SIZE);
+
+		ret = xe_sysctrl_mailbox_process_frame(sc, out, frame_size, timeout_ms);
+		if (ret)
+			break;
+
+		received += frame_size;
+		out += frame_size;
+	}
+
+	*rdata_len = received;
+
+	return ret;
+}
+
+static int xe_sysctrl_mailbox_send_command(struct xe_sysctrl *sc,
+					   const u8 *mbox_cmd, size_t cmd_size,
+					   void *data_out, size_t data_out_len,
+					   size_t *rdata_len, unsigned int timeout_ms)
+{
+	const struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
+	size_t received;
+	int ret;
+
+	ret = xe_sysctrl_mailbox_send_frames(sc, mbox_cmd, cmd_size, timeout_ms);
+	if (ret)
+		return ret;
+
+	if (!data_out || !rdata_len)
+		return 0;
+
+	mkhi_hdr = (const struct xe_sysctrl_mailbox_mkhi_msg_hdr *)mbox_cmd;
+
+	ret = xe_sysctrl_mailbox_receive_frames(sc, mkhi_hdr, data_out, data_out_len,
+						&received, timeout_ms);
+	if (ret)
+		return ret;
+
+	*rdata_len = received;
+
+	return 0;
+}
+
+/**
+ * xe_sysctrl_send_command - Send command to System Controller via mailbox
+ * @handle: XE device handle
+ * @cmd_buffer: Pointer to xe_sysctrl_mailbox_command structure
+ * @rdata_len: Pointer to store actual response data size (can be NULL)
+ *
+ * Send a command to the System Controller using MKHI protocol. Handles
+ * command preparation, fragmentation, transmission, and response reception.
+ *
+ * Return: 0 on success, negative error code on failure
+ */
+int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len)
+{
+	struct xe_device *xe = handle;
+	struct xe_sysctrl *sc = &xe->sc;
+	struct xe_sysctrl_mailbox_command *cmd = cmd_buffer;
+	u8 *mbox_cmd = NULL;
+	size_t cmd_size = 0;
+	u8 group_id, command_code;
+	int ret = 0;
+
+	if (!xe) {
+		pr_err("sysctrl: Invalid device handle\n");
+		return -EINVAL;
+	}
+
+	if (!cmd) {
+		xe_err(xe, "sysctrl: Invalid command buffer\n");
+		return -EINVAL;
+	}
+
+	if (!xe->info.has_sysctrl)
+		return -ENODEV;
+
+	group_id = XE_SYSCTRL_APP_HDR_GROUP_ID(&cmd->header);
+	command_code = XE_SYSCTRL_APP_HDR_COMMAND(&cmd->header);
+
+	if (!cmd->data_in && cmd->data_in_len) {
+		xe_err(xe, "sysctrl: Invalid input parameters\n");
+		return -EINVAL;
+	}
+
+	if (!cmd->data_out && cmd->data_out_len) {
+		xe_err(xe, "sysctrl: Invalid output parameters\n");
+		return -EINVAL;
+	}
+
+	might_sleep();
+
+	ret = xe_sysctrl_mailbox_prepare_command(sc, group_id, command_code,
+						 cmd->data_in, cmd->data_in_len,
+						 &mbox_cmd, &cmd_size);
+	if (ret) {
+		xe_err(xe, "sysctrl: Failed to prepare command: %d\n", ret);
+		return ret;
+	}
+
+	guard(xe_pm_runtime)(xe);
+
+	guard(mutex)(&sc->cmd_lock);
+
+	ret = xe_sysctrl_mailbox_send_command(sc, mbox_cmd, cmd_size,
+					      cmd->data_out, cmd->data_out_len, rdata_len,
+					      SC_MB_DEFAULT_TIMEOUT_MS);
+	if (ret)
+		xe_err(xe, "sysctrl: Mailbox command failed: %d\n", ret);
+
+	kfree(mbox_cmd);
+
+	return ret;
+}
+
+/**
+ * xe_sysctrl_mailbox_init - Initialize the System Controller mailbox state
+ * @sc: System controller structure
+ */
+void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc)
+{
+	struct xe_device *xe = sc_to_xe(sc);
+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+	u32 ctrl_reg;
+
+	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
+	sc->phase_bit = (ctrl_reg & MKHI_FRAME_PHASE) ? 1 : 0;
+
+	xe_mmio_rmw32(mmio, SC_MB_CTRL, MKHI_FRAME_PHASE, 0);
+}
diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
new file mode 100644
index 000000000000..3e472418ebd0
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
@@ -0,0 +1,77 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#ifndef __XE_SYSCTRL_MAILBOX_H__
+#define __XE_SYSCTRL_MAILBOX_H__
+
+#include <linux/bitfield.h>
+#include <linux/types.h>
+
+struct xe_sysctrl;
+
+#define MKHI_HDR_GROUP_ID_MASK		GENMASK(7, 0)
+#define MKHI_HDR_COMMAND_MASK		GENMASK(14, 8)
+#define MKHI_HDR_IS_RESPONSE		BIT(15)
+#define MKHI_HDR_RESERVED_MASK		GENMASK(23, 16)
+#define MKHI_HDR_RESULT_MASK		GENMASK(31, 24)
+
+struct xe_sysctrl_mailbox_mkhi_msg_hdr {
+	__le32 data;
+} __packed;
+
+#define APP_HDR_GROUP_ID_MASK		GENMASK(7, 0)
+#define APP_HDR_COMMAND_MASK		GENMASK(15, 8)
+#define APP_HDR_VERSION_MASK		GENMASK(23, 16)
+#define APP_HDR_RESERVED_MASK		GENMASK(31, 24)
+
+struct xe_sysctrl_mailbox_app_msg_hdr {
+	__le32 data;
+} __packed;
+
+#define XE_SYSCTRL_APP_HDR_GROUP_ID(hdr) \
+	FIELD_GET(APP_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
+
+#define XE_SYSCTRL_APP_HDR_COMMAND(hdr) \
+	FIELD_GET(APP_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
+
+#define XE_SYSCTRL_APP_HDR_VERSION(hdr) \
+	FIELD_GET(APP_HDR_VERSION_MASK, le32_to_cpu((hdr)->data))
+
+#define XE_SYSCTRL_MKHI_HDR_GROUP_ID(hdr) \
+	FIELD_GET(MKHI_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
+
+#define XE_SYSCTRL_MKHI_HDR_COMMAND(hdr) \
+	FIELD_GET(MKHI_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
+
+#define XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(hdr) \
+	FIELD_GET(MKHI_HDR_IS_RESPONSE, le32_to_cpu((hdr)->data))
+
+#define XE_SYSCTRL_MKHI_HDR_RESULT(hdr) \
+	FIELD_GET(MKHI_HDR_RESULT_MASK, le32_to_cpu((hdr)->data))
+
+/**
+ * struct xe_sysctrl_mailbox_command - System Controller mailbox command structure
+ */
+struct xe_sysctrl_mailbox_command {
+	/** @header: Application message header containing command information */
+	struct xe_sysctrl_mailbox_app_msg_hdr header;
+
+	/** @data_in: Pointer to input payload data (can be NULL if no input data) */
+	void *data_in;
+
+	/** @data_in_len: Size of input payload in bytes (0 if no input data) */
+	size_t data_in_len;
+
+	/** @data_out: Pointer to output buffer for response data (can be NULL if no response) */
+	void *data_out;
+
+	/** @data_out_len: Size of output buffer in bytes (0 if no response expected) */
+	size_t data_out_len;
+};
+
+void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc);
+int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len);
+
+#endif /* __XE_SYSCTRL_MAILBOX_H__ */
diff --git a/drivers/gpu/drm/xe/xe_sysctrl_types.h b/drivers/gpu/drm/xe/xe_sysctrl_types.h
new file mode 100644
index 000000000000..88a34967688b
--- /dev/null
+++ b/drivers/gpu/drm/xe/xe_sysctrl_types.h
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2026 Intel Corporation
+ */
+
+#ifndef _XE_SYSCTRL_TYPES_H_
+#define _XE_SYSCTRL_TYPES_H_
+
+#include <linux/mutex.h>
+#include <linux/types.h>
+
+/**
+ * struct xe_sysctrl - System Controller driver context
+ */
+struct xe_sysctrl {
+	/** @cmd_lock: Mutex protecting mailbox command operations */
+	struct mutex cmd_lock;
+
+	/** @phase_bit: MKHI message boundary phase toggle bit */
+	u32 phase_bit;
+};
+
+#endif /* _XE_SYSCTRL_TYPES_H_ */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* ✗ CI.checkpatch: warning for drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms (rev2)
  2026-01-02 16:54 [PATCH v2 0/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms Anoop, Vijay
  2026-01-02 16:54 ` [PATCH v2 1/1] " Anoop, Vijay
@ 2026-01-02 17:01 ` Patchwork
  2026-01-02 17:02 ` ✓ CI.KUnit: success " Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2026-01-02 17:01 UTC (permalink / raw)
  To: Anoop, Vijay; +Cc: intel-xe

== Series Details ==

Series: drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms (rev2)
URL   : https://patchwork.freedesktop.org/series/159554/
State : warning

== Summary ==

+ KERNEL=/kernel
+ git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt
Cloning into 'mt'...
warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/
+ git -C mt rev-list -n1 origin/master
9f1cb6875f3f9eb0925ed50c16100322a2df513c
+ cd /kernel
+ git config --global --add safe.directory /kernel
+ git log -n1
commit 1778e9c2f2563b2d10d4392a78ddd987b72a3372
Author: Anoop Vijay <anoop.c.vijay@intel.com>
Date:   Fri Jan 2 08:54:50 2026 -0800

    drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
    
    Add a new system controller (sysctrl) component for Intel Xe3p dGPU
    platforms.
    
    This component provides the foundational infrastructure for communication
    with the System Controller firmware using MKHI protocol over a mailbox
    interface.
    
    Key features introduced:
     - Detection and initialization of System Controller interface on Xe3p
       dGPU platforms
     - Mailbox communication with System Controller firmware
     - Fragmented message transfer for large command payloads
    
    This implementation establishes the base for future System Controller
    feature enablement and firmware command handling.
    
    Signed-off-by: Anoop Vijay <anoop.c.vijay@intel.com>
+ /mt/dim checkpatch 56a791b474c0faeff1a2ed97660224617c2b9d2b drm-intel
1778e9c2f256 drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
-:39: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#39: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 703 lines checked



^ permalink raw reply	[flat|nested] 8+ messages in thread

* ✓ CI.KUnit: success for drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms (rev2)
  2026-01-02 16:54 [PATCH v2 0/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms Anoop, Vijay
  2026-01-02 16:54 ` [PATCH v2 1/1] " Anoop, Vijay
  2026-01-02 17:01 ` ✗ CI.checkpatch: warning for drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms (rev2) Patchwork
@ 2026-01-02 17:02 ` Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2026-01-02 17:02 UTC (permalink / raw)
  To: Anoop, Vijay; +Cc: intel-xe

== Series Details ==

Series: drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms (rev2)
URL   : https://patchwork.freedesktop.org/series/159554/
State : success

== Summary ==

+ trap cleanup EXIT
+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/xe/.kunitconfig
[17:01:07] Configuring KUnit Kernel ...
Generating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[17:01:11] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[17:01:43] Starting KUnit Kernel (1/1)...
[17:01:43] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[17:01:43] ================== guc_buf (11 subtests) ===================
[17:01:43] [PASSED] test_smallest
[17:01:43] [PASSED] test_largest
[17:01:43] [PASSED] test_granular
[17:01:43] [PASSED] test_unique
[17:01:43] [PASSED] test_overlap
[17:01:43] [PASSED] test_reusable
[17:01:43] [PASSED] test_too_big
[17:01:43] [PASSED] test_flush
[17:01:43] [PASSED] test_lookup
[17:01:43] [PASSED] test_data
[17:01:43] [PASSED] test_class
[17:01:43] ===================== [PASSED] guc_buf =====================
[17:01:43] =================== guc_dbm (7 subtests) ===================
[17:01:43] [PASSED] test_empty
[17:01:43] [PASSED] test_default
[17:01:43] ======================== test_size  ========================
[17:01:43] [PASSED] 4
[17:01:43] [PASSED] 8
[17:01:43] [PASSED] 32
[17:01:43] [PASSED] 256
[17:01:43] ==================== [PASSED] test_size ====================
[17:01:43] ======================= test_reuse  ========================
[17:01:43] [PASSED] 4
[17:01:43] [PASSED] 8
[17:01:43] [PASSED] 32
[17:01:43] [PASSED] 256
[17:01:43] =================== [PASSED] test_reuse ====================
[17:01:43] =================== test_range_overlap  ====================
[17:01:43] [PASSED] 4
[17:01:43] [PASSED] 8
[17:01:43] [PASSED] 32
[17:01:43] [PASSED] 256
[17:01:43] =============== [PASSED] test_range_overlap ================
[17:01:43] =================== test_range_compact  ====================
[17:01:43] [PASSED] 4
[17:01:43] [PASSED] 8
[17:01:43] [PASSED] 32
[17:01:43] [PASSED] 256
[17:01:43] =============== [PASSED] test_range_compact ================
[17:01:43] ==================== test_range_spare  =====================
[17:01:43] [PASSED] 4
[17:01:43] [PASSED] 8
[17:01:43] [PASSED] 32
[17:01:43] [PASSED] 256
[17:01:43] ================ [PASSED] test_range_spare =================
[17:01:43] ===================== [PASSED] guc_dbm =====================
[17:01:43] =================== guc_idm (6 subtests) ===================
[17:01:43] [PASSED] bad_init
[17:01:43] [PASSED] no_init
[17:01:43] [PASSED] init_fini
[17:01:43] [PASSED] check_used
[17:01:43] [PASSED] check_quota
[17:01:43] [PASSED] check_all
[17:01:43] ===================== [PASSED] guc_idm =====================
[17:01:43] ================== no_relay (3 subtests) ===================
[17:01:43] [PASSED] xe_drops_guc2pf_if_not_ready
[17:01:43] [PASSED] xe_drops_guc2vf_if_not_ready
[17:01:43] [PASSED] xe_rejects_send_if_not_ready
[17:01:43] ==================== [PASSED] no_relay =====================
[17:01:43] ================== pf_relay (14 subtests) ==================
[17:01:43] [PASSED] pf_rejects_guc2pf_too_short
[17:01:43] [PASSED] pf_rejects_guc2pf_too_long
[17:01:43] [PASSED] pf_rejects_guc2pf_no_payload
[17:01:43] [PASSED] pf_fails_no_payload
[17:01:43] [PASSED] pf_fails_bad_origin
[17:01:43] [PASSED] pf_fails_bad_type
[17:01:43] [PASSED] pf_txn_reports_error
[17:01:43] [PASSED] pf_txn_sends_pf2guc
[17:01:43] [PASSED] pf_sends_pf2guc
[17:01:43] [SKIPPED] pf_loopback_nop
[17:01:43] [SKIPPED] pf_loopback_echo
[17:01:43] [SKIPPED] pf_loopback_fail
[17:01:43] [SKIPPED] pf_loopback_busy
[17:01:43] [SKIPPED] pf_loopback_retry
[17:01:43] ==================== [PASSED] pf_relay =====================
[17:01:43] ================== vf_relay (3 subtests) ===================
[17:01:43] [PASSED] vf_rejects_guc2vf_too_short
[17:01:43] [PASSED] vf_rejects_guc2vf_too_long
[17:01:43] [PASSED] vf_rejects_guc2vf_no_payload
[17:01:43] ==================== [PASSED] vf_relay =====================
[17:01:43] ================ pf_gt_config (6 subtests) =================
[17:01:43] [PASSED] fair_contexts_1vf
[17:01:43] [PASSED] fair_doorbells_1vf
[17:01:43] [PASSED] fair_ggtt_1vf
[17:01:43] ====================== fair_contexts  ======================
[17:01:43] [PASSED] 1 VF
[17:01:43] [PASSED] 2 VFs
[17:01:43] [PASSED] 3 VFs
[17:01:43] [PASSED] 4 VFs
[17:01:43] [PASSED] 5 VFs
[17:01:43] [PASSED] 6 VFs
[17:01:43] [PASSED] 7 VFs
[17:01:43] [PASSED] 8 VFs
[17:01:43] [PASSED] 9 VFs
[17:01:43] [PASSED] 10 VFs
[17:01:43] [PASSED] 11 VFs
[17:01:43] [PASSED] 12 VFs
[17:01:43] [PASSED] 13 VFs
[17:01:43] [PASSED] 14 VFs
[17:01:43] [PASSED] 15 VFs
[17:01:43] [PASSED] 16 VFs
[17:01:43] [PASSED] 17 VFs
[17:01:43] [PASSED] 18 VFs
[17:01:43] [PASSED] 19 VFs
[17:01:43] [PASSED] 20 VFs
[17:01:43] [PASSED] 21 VFs
[17:01:43] [PASSED] 22 VFs
[17:01:43] [PASSED] 23 VFs
[17:01:43] [PASSED] 24 VFs
[17:01:43] [PASSED] 25 VFs
[17:01:43] [PASSED] 26 VFs
[17:01:43] [PASSED] 27 VFs
[17:01:43] [PASSED] 28 VFs
[17:01:43] [PASSED] 29 VFs
[17:01:43] [PASSED] 30 VFs
[17:01:43] [PASSED] 31 VFs
[17:01:43] [PASSED] 32 VFs
[17:01:43] [PASSED] 33 VFs
[17:01:43] [PASSED] 34 VFs
[17:01:43] [PASSED] 35 VFs
[17:01:43] [PASSED] 36 VFs
[17:01:43] [PASSED] 37 VFs
[17:01:43] [PASSED] 38 VFs
[17:01:43] [PASSED] 39 VFs
[17:01:43] [PASSED] 40 VFs
[17:01:43] [PASSED] 41 VFs
[17:01:43] [PASSED] 42 VFs
[17:01:43] [PASSED] 43 VFs
[17:01:43] [PASSED] 44 VFs
[17:01:43] [PASSED] 45 VFs
[17:01:43] [PASSED] 46 VFs
[17:01:43] [PASSED] 47 VFs
[17:01:43] [PASSED] 48 VFs
[17:01:43] [PASSED] 49 VFs
[17:01:43] [PASSED] 50 VFs
[17:01:43] [PASSED] 51 VFs
[17:01:43] [PASSED] 52 VFs
[17:01:43] [PASSED] 53 VFs
[17:01:43] [PASSED] 54 VFs
[17:01:43] [PASSED] 55 VFs
[17:01:43] [PASSED] 56 VFs
[17:01:43] [PASSED] 57 VFs
[17:01:43] [PASSED] 58 VFs
[17:01:43] [PASSED] 59 VFs
[17:01:43] [PASSED] 60 VFs
[17:01:43] [PASSED] 61 VFs
[17:01:43] [PASSED] 62 VFs
[17:01:43] [PASSED] 63 VFs
[17:01:43] ================== [PASSED] fair_contexts ==================
[17:01:43] ===================== fair_doorbells  ======================
[17:01:43] [PASSED] 1 VF
[17:01:43] [PASSED] 2 VFs
[17:01:43] [PASSED] 3 VFs
[17:01:43] [PASSED] 4 VFs
[17:01:43] [PASSED] 5 VFs
[17:01:43] [PASSED] 6 VFs
[17:01:43] [PASSED] 7 VFs
[17:01:43] [PASSED] 8 VFs
[17:01:43] [PASSED] 9 VFs
[17:01:43] [PASSED] 10 VFs
[17:01:43] [PASSED] 11 VFs
[17:01:43] [PASSED] 12 VFs
[17:01:43] [PASSED] 13 VFs
[17:01:43] [PASSED] 14 VFs
[17:01:43] [PASSED] 15 VFs
[17:01:43] [PASSED] 16 VFs
[17:01:43] [PASSED] 17 VFs
[17:01:43] [PASSED] 18 VFs
[17:01:43] [PASSED] 19 VFs
[17:01:43] [PASSED] 20 VFs
[17:01:43] [PASSED] 21 VFs
[17:01:43] [PASSED] 22 VFs
[17:01:43] [PASSED] 23 VFs
[17:01:43] [PASSED] 24 VFs
[17:01:43] [PASSED] 25 VFs
[17:01:43] [PASSED] 26 VFs
[17:01:43] [PASSED] 27 VFs
[17:01:43] [PASSED] 28 VFs
[17:01:43] [PASSED] 29 VFs
[17:01:43] [PASSED] 30 VFs
[17:01:43] [PASSED] 31 VFs
[17:01:43] [PASSED] 32 VFs
[17:01:43] [PASSED] 33 VFs
[17:01:43] [PASSED] 34 VFs
[17:01:43] [PASSED] 35 VFs
[17:01:43] [PASSED] 36 VFs
[17:01:43] [PASSED] 37 VFs
[17:01:43] [PASSED] 38 VFs
[17:01:43] [PASSED] 39 VFs
[17:01:43] [PASSED] 40 VFs
[17:01:43] [PASSED] 41 VFs
[17:01:43] [PASSED] 42 VFs
[17:01:43] [PASSED] 43 VFs
[17:01:43] [PASSED] 44 VFs
[17:01:43] [PASSED] 45 VFs
[17:01:43] [PASSED] 46 VFs
[17:01:43] [PASSED] 47 VFs
[17:01:43] [PASSED] 48 VFs
[17:01:43] [PASSED] 49 VFs
[17:01:43] [PASSED] 50 VFs
[17:01:43] [PASSED] 51 VFs
[17:01:43] [PASSED] 52 VFs
[17:01:43] [PASSED] 53 VFs
[17:01:43] [PASSED] 54 VFs
[17:01:43] [PASSED] 55 VFs
[17:01:43] [PASSED] 56 VFs
[17:01:43] [PASSED] 57 VFs
[17:01:43] [PASSED] 58 VFs
[17:01:43] [PASSED] 59 VFs
[17:01:43] [PASSED] 60 VFs
[17:01:43] [PASSED] 61 VFs
[17:01:43] [PASSED] 62 VFs
[17:01:43] [PASSED] 63 VFs
[17:01:43] ================= [PASSED] fair_doorbells ==================
[17:01:43] ======================== fair_ggtt  ========================
[17:01:43] [PASSED] 1 VF
[17:01:43] [PASSED] 2 VFs
[17:01:43] [PASSED] 3 VFs
[17:01:43] [PASSED] 4 VFs
[17:01:43] [PASSED] 5 VFs
[17:01:43] [PASSED] 6 VFs
[17:01:43] [PASSED] 7 VFs
[17:01:43] [PASSED] 8 VFs
[17:01:43] [PASSED] 9 VFs
[17:01:43] [PASSED] 10 VFs
[17:01:43] [PASSED] 11 VFs
[17:01:43] [PASSED] 12 VFs
[17:01:43] [PASSED] 13 VFs
[17:01:43] [PASSED] 14 VFs
[17:01:43] [PASSED] 15 VFs
[17:01:43] [PASSED] 16 VFs
[17:01:43] [PASSED] 17 VFs
[17:01:43] [PASSED] 18 VFs
[17:01:43] [PASSED] 19 VFs
[17:01:43] [PASSED] 20 VFs
[17:01:43] [PASSED] 21 VFs
[17:01:43] [PASSED] 22 VFs
[17:01:43] [PASSED] 23 VFs
[17:01:43] [PASSED] 24 VFs
[17:01:43] [PASSED] 25 VFs
[17:01:43] [PASSED] 26 VFs
[17:01:43] [PASSED] 27 VFs
[17:01:43] [PASSED] 28 VFs
[17:01:43] [PASSED] 29 VFs
[17:01:43] [PASSED] 30 VFs
[17:01:43] [PASSED] 31 VFs
[17:01:43] [PASSED] 32 VFs
[17:01:43] [PASSED] 33 VFs
[17:01:43] [PASSED] 34 VFs
[17:01:43] [PASSED] 35 VFs
[17:01:43] [PASSED] 36 VFs
[17:01:43] [PASSED] 37 VFs
[17:01:43] [PASSED] 38 VFs
[17:01:43] [PASSED] 39 VFs
[17:01:43] [PASSED] 40 VFs
[17:01:43] [PASSED] 41 VFs
[17:01:43] [PASSED] 42 VFs
[17:01:43] [PASSED] 43 VFs
[17:01:43] [PASSED] 44 VFs
[17:01:43] [PASSED] 45 VFs
[17:01:43] [PASSED] 46 VFs
[17:01:43] [PASSED] 47 VFs
[17:01:43] [PASSED] 48 VFs
[17:01:43] [PASSED] 49 VFs
[17:01:43] [PASSED] 50 VFs
[17:01:43] [PASSED] 51 VFs
[17:01:43] [PASSED] 52 VFs
[17:01:43] [PASSED] 53 VFs
[17:01:43] [PASSED] 54 VFs
[17:01:43] [PASSED] 55 VFs
[17:01:43] [PASSED] 56 VFs
[17:01:43] [PASSED] 57 VFs
[17:01:43] [PASSED] 58 VFs
[17:01:43] [PASSED] 59 VFs
[17:01:43] [PASSED] 60 VFs
[17:01:43] [PASSED] 61 VFs
[17:01:43] [PASSED] 62 VFs
[17:01:43] [PASSED] 63 VFs
[17:01:43] ==================== [PASSED] fair_ggtt ====================
[17:01:43] ================== [PASSED] pf_gt_config ===================
[17:01:43] ===================== lmtt (1 subtest) =====================
[17:01:43] ======================== test_ops  =========================
[17:01:43] [PASSED] 2-level
[17:01:43] [PASSED] multi-level
[17:01:43] ==================== [PASSED] test_ops =====================
[17:01:43] ====================== [PASSED] lmtt =======================
[17:01:43] ================= pf_service (11 subtests) =================
[17:01:43] [PASSED] pf_negotiate_any
[17:01:43] [PASSED] pf_negotiate_base_match
[17:01:43] [PASSED] pf_negotiate_base_newer
[17:01:43] [PASSED] pf_negotiate_base_next
[17:01:43] [SKIPPED] pf_negotiate_base_older
[17:01:43] [PASSED] pf_negotiate_base_prev
[17:01:43] [PASSED] pf_negotiate_latest_match
[17:01:43] [PASSED] pf_negotiate_latest_newer
[17:01:43] [PASSED] pf_negotiate_latest_next
[17:01:43] [SKIPPED] pf_negotiate_latest_older
[17:01:43] [SKIPPED] pf_negotiate_latest_prev
[17:01:43] =================== [PASSED] pf_service ====================
[17:01:43] ================= xe_guc_g2g (2 subtests) ==================
[17:01:43] ============== xe_live_guc_g2g_kunit_default  ==============
[17:01:43] ========= [SKIPPED] xe_live_guc_g2g_kunit_default ==========
[17:01:43] ============== xe_live_guc_g2g_kunit_allmem  ===============
[17:01:43] ========== [SKIPPED] xe_live_guc_g2g_kunit_allmem ==========
[17:01:43] =================== [SKIPPED] xe_guc_g2g ===================
[17:01:43] =================== xe_mocs (2 subtests) ===================
[17:01:43] ================ xe_live_mocs_kernel_kunit  ================
[17:01:43] =========== [SKIPPED] xe_live_mocs_kernel_kunit ============
[17:01:43] ================ xe_live_mocs_reset_kunit  =================
[17:01:43] ============ [SKIPPED] xe_live_mocs_reset_kunit ============
[17:01:43] ==================== [SKIPPED] xe_mocs =====================
[17:01:43] ================= xe_migrate (2 subtests) ==================
[17:01:43] ================= xe_migrate_sanity_kunit  =================
[17:01:43] ============ [SKIPPED] xe_migrate_sanity_kunit =============
[17:01:43] ================== xe_validate_ccs_kunit  ==================
[17:01:43] ============= [SKIPPED] xe_validate_ccs_kunit ==============
[17:01:43] =================== [SKIPPED] xe_migrate ===================
[17:01:43] ================== xe_dma_buf (1 subtest) ==================
[17:01:43] ==================== xe_dma_buf_kunit  =====================
[17:01:43] ================ [SKIPPED] xe_dma_buf_kunit ================
[17:01:43] =================== [SKIPPED] xe_dma_buf ===================
[17:01:43] ================= xe_bo_shrink (1 subtest) =================
[17:01:43] =================== xe_bo_shrink_kunit  ====================
[17:01:43] =============== [SKIPPED] xe_bo_shrink_kunit ===============
[17:01:43] ================== [SKIPPED] xe_bo_shrink ==================
[17:01:43] ==================== xe_bo (2 subtests) ====================
[17:01:43] ================== xe_ccs_migrate_kunit  ===================
[17:01:43] ============== [SKIPPED] xe_ccs_migrate_kunit ==============
[17:01:43] ==================== xe_bo_evict_kunit  ====================
[17:01:43] =============== [SKIPPED] xe_bo_evict_kunit ================
[17:01:43] ===================== [SKIPPED] xe_bo ======================
[17:01:43] ==================== args (13 subtests) ====================
[17:01:43] [PASSED] count_args_test
[17:01:43] [PASSED] call_args_example
[17:01:43] [PASSED] call_args_test
[17:01:43] [PASSED] drop_first_arg_example
[17:01:43] [PASSED] drop_first_arg_test
[17:01:43] [PASSED] first_arg_example
[17:01:43] [PASSED] first_arg_test
[17:01:43] [PASSED] last_arg_example
[17:01:43] [PASSED] last_arg_test
[17:01:43] [PASSED] pick_arg_example
[17:01:43] [PASSED] if_args_example
[17:01:43] [PASSED] if_args_test
[17:01:43] [PASSED] sep_comma_example
[17:01:43] ====================== [PASSED] args =======================
[17:01:43] =================== xe_pci (3 subtests) ====================
[17:01:43] ==================== check_graphics_ip  ====================
[17:01:43] [PASSED] 12.00 Xe_LP
[17:01:43] [PASSED] 12.10 Xe_LP+
[17:01:43] [PASSED] 12.55 Xe_HPG
[17:01:43] [PASSED] 12.60 Xe_HPC
[17:01:43] [PASSED] 12.70 Xe_LPG
[17:01:43] [PASSED] 12.71 Xe_LPG
[17:01:43] [PASSED] 12.74 Xe_LPG+
[17:01:43] [PASSED] 20.01 Xe2_HPG
[17:01:43] [PASSED] 20.02 Xe2_HPG
[17:01:43] [PASSED] 20.04 Xe2_LPG
[17:01:43] [PASSED] 30.00 Xe3_LPG
[17:01:43] [PASSED] 30.01 Xe3_LPG
[17:01:43] [PASSED] 30.03 Xe3_LPG
[17:01:43] [PASSED] 30.04 Xe3_LPG
[17:01:43] [PASSED] 30.05 Xe3_LPG
[17:01:43] [PASSED] 35.11 Xe3p_XPC
[17:01:43] ================ [PASSED] check_graphics_ip ================
[17:01:43] ===================== check_media_ip  ======================
[17:01:43] [PASSED] 12.00 Xe_M
[17:01:43] [PASSED] 12.55 Xe_HPM
[17:01:43] [PASSED] 13.00 Xe_LPM+
[17:01:43] [PASSED] 13.01 Xe2_HPM
[17:01:43] [PASSED] 20.00 Xe2_LPM
[17:01:43] [PASSED] 30.00 Xe3_LPM
[17:01:43] [PASSED] 30.02 Xe3_LPM
[17:01:43] [PASSED] 35.00 Xe3p_LPM
[17:01:43] [PASSED] 35.03 Xe3p_HPM
[17:01:43] ================= [PASSED] check_media_ip ==================
[17:01:43] =================== check_platform_desc  ===================
[17:01:43] [PASSED] 0x9A60 (TIGERLAKE)
[17:01:43] [PASSED] 0x9A68 (TIGERLAKE)
[17:01:43] [PASSED] 0x9A70 (TIGERLAKE)
[17:01:43] [PASSED] 0x9A40 (TIGERLAKE)
[17:01:43] [PASSED] 0x9A49 (TIGERLAKE)
[17:01:43] [PASSED] 0x9A59 (TIGERLAKE)
[17:01:43] [PASSED] 0x9A78 (TIGERLAKE)
[17:01:43] [PASSED] 0x9AC0 (TIGERLAKE)
[17:01:43] [PASSED] 0x9AC9 (TIGERLAKE)
[17:01:43] [PASSED] 0x9AD9 (TIGERLAKE)
[17:01:43] [PASSED] 0x9AF8 (TIGERLAKE)
[17:01:43] [PASSED] 0x4C80 (ROCKETLAKE)
[17:01:43] [PASSED] 0x4C8A (ROCKETLAKE)
[17:01:43] [PASSED] 0x4C8B (ROCKETLAKE)
[17:01:43] [PASSED] 0x4C8C (ROCKETLAKE)
[17:01:43] [PASSED] 0x4C90 (ROCKETLAKE)
[17:01:43] [PASSED] 0x4C9A (ROCKETLAKE)
[17:01:43] [PASSED] 0x4680 (ALDERLAKE_S)
[17:01:43] [PASSED] 0x4682 (ALDERLAKE_S)
[17:01:43] [PASSED] 0x4688 (ALDERLAKE_S)
[17:01:43] [PASSED] 0x468A (ALDERLAKE_S)
[17:01:43] [PASSED] 0x468B (ALDERLAKE_S)
[17:01:43] [PASSED] 0x4690 (ALDERLAKE_S)
[17:01:43] [PASSED] 0x4692 (ALDERLAKE_S)
[17:01:43] [PASSED] 0x4693 (ALDERLAKE_S)
[17:01:43] [PASSED] 0x46A0 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46A1 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46A2 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46A3 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46A6 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46A8 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46AA (ALDERLAKE_P)
[17:01:43] [PASSED] 0x462A (ALDERLAKE_P)
[17:01:43] [PASSED] 0x4626 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x4628 (ALDERLAKE_P)
stty: 'standard input': Inappropriate ioctl for device
[17:01:43] [PASSED] 0x46B0 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46B1 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46B2 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46B3 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46C0 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46C1 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46C2 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46C3 (ALDERLAKE_P)
[17:01:43] [PASSED] 0x46D0 (ALDERLAKE_N)
[17:01:43] [PASSED] 0x46D1 (ALDERLAKE_N)
[17:01:43] [PASSED] 0x46D2 (ALDERLAKE_N)
[17:01:43] [PASSED] 0x46D3 (ALDERLAKE_N)
[17:01:43] [PASSED] 0x46D4 (ALDERLAKE_N)
[17:01:43] [PASSED] 0xA721 (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7A1 (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7A9 (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7AC (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7AD (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA720 (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7A0 (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7A8 (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7AA (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA7AB (ALDERLAKE_P)
[17:01:43] [PASSED] 0xA780 (ALDERLAKE_S)
[17:01:43] [PASSED] 0xA781 (ALDERLAKE_S)
[17:01:43] [PASSED] 0xA782 (ALDERLAKE_S)
[17:01:43] [PASSED] 0xA783 (ALDERLAKE_S)
[17:01:43] [PASSED] 0xA788 (ALDERLAKE_S)
[17:01:43] [PASSED] 0xA789 (ALDERLAKE_S)
[17:01:43] [PASSED] 0xA78A (ALDERLAKE_S)
[17:01:43] [PASSED] 0xA78B (ALDERLAKE_S)
[17:01:43] [PASSED] 0x4905 (DG1)
[17:01:43] [PASSED] 0x4906 (DG1)
[17:01:43] [PASSED] 0x4907 (DG1)
[17:01:43] [PASSED] 0x4908 (DG1)
[17:01:43] [PASSED] 0x4909 (DG1)
[17:01:43] [PASSED] 0x56C0 (DG2)
[17:01:43] [PASSED] 0x56C2 (DG2)
[17:01:43] [PASSED] 0x56C1 (DG2)
[17:01:43] [PASSED] 0x7D51 (METEORLAKE)
[17:01:43] [PASSED] 0x7DD1 (METEORLAKE)
[17:01:43] [PASSED] 0x7D41 (METEORLAKE)
[17:01:43] [PASSED] 0x7D67 (METEORLAKE)
[17:01:43] [PASSED] 0xB640 (METEORLAKE)
[17:01:43] [PASSED] 0x56A0 (DG2)
[17:01:43] [PASSED] 0x56A1 (DG2)
[17:01:43] [PASSED] 0x56A2 (DG2)
[17:01:43] [PASSED] 0x56BE (DG2)
[17:01:43] [PASSED] 0x56BF (DG2)
[17:01:43] [PASSED] 0x5690 (DG2)
[17:01:43] [PASSED] 0x5691 (DG2)
[17:01:43] [PASSED] 0x5692 (DG2)
[17:01:43] [PASSED] 0x56A5 (DG2)
[17:01:43] [PASSED] 0x56A6 (DG2)
[17:01:43] [PASSED] 0x56B0 (DG2)
[17:01:43] [PASSED] 0x56B1 (DG2)
[17:01:43] [PASSED] 0x56BA (DG2)
[17:01:43] [PASSED] 0x56BB (DG2)
[17:01:43] [PASSED] 0x56BC (DG2)
[17:01:43] [PASSED] 0x56BD (DG2)
[17:01:43] [PASSED] 0x5693 (DG2)
[17:01:43] [PASSED] 0x5694 (DG2)
[17:01:43] [PASSED] 0x5695 (DG2)
[17:01:43] [PASSED] 0x56A3 (DG2)
[17:01:43] [PASSED] 0x56A4 (DG2)
[17:01:43] [PASSED] 0x56B2 (DG2)
[17:01:43] [PASSED] 0x56B3 (DG2)
[17:01:43] [PASSED] 0x5696 (DG2)
[17:01:43] [PASSED] 0x5697 (DG2)
[17:01:43] [PASSED] 0xB69 (PVC)
[17:01:43] [PASSED] 0xB6E (PVC)
[17:01:43] [PASSED] 0xBD4 (PVC)
[17:01:43] [PASSED] 0xBD5 (PVC)
[17:01:43] [PASSED] 0xBD6 (PVC)
[17:01:43] [PASSED] 0xBD7 (PVC)
[17:01:43] [PASSED] 0xBD8 (PVC)
[17:01:43] [PASSED] 0xBD9 (PVC)
[17:01:43] [PASSED] 0xBDA (PVC)
[17:01:43] [PASSED] 0xBDB (PVC)
[17:01:43] [PASSED] 0xBE0 (PVC)
[17:01:43] [PASSED] 0xBE1 (PVC)
[17:01:43] [PASSED] 0xBE5 (PVC)
[17:01:43] [PASSED] 0x7D40 (METEORLAKE)
[17:01:43] [PASSED] 0x7D45 (METEORLAKE)
[17:01:43] [PASSED] 0x7D55 (METEORLAKE)
[17:01:43] [PASSED] 0x7D60 (METEORLAKE)
[17:01:43] [PASSED] 0x7DD5 (METEORLAKE)
[17:01:43] [PASSED] 0x6420 (LUNARLAKE)
[17:01:43] [PASSED] 0x64A0 (LUNARLAKE)
[17:01:43] [PASSED] 0x64B0 (LUNARLAKE)
[17:01:43] [PASSED] 0xE202 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE209 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE20B (BATTLEMAGE)
[17:01:43] [PASSED] 0xE20C (BATTLEMAGE)
[17:01:43] [PASSED] 0xE20D (BATTLEMAGE)
[17:01:43] [PASSED] 0xE210 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE211 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE212 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE216 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE220 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE221 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE222 (BATTLEMAGE)
[17:01:43] [PASSED] 0xE223 (BATTLEMAGE)
[17:01:43] [PASSED] 0xB080 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB081 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB082 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB083 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB084 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB085 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB086 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB087 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB08F (PANTHERLAKE)
[17:01:43] [PASSED] 0xB090 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB0A0 (PANTHERLAKE)
[17:01:43] [PASSED] 0xB0B0 (PANTHERLAKE)
[17:01:43] [PASSED] 0xFD80 (PANTHERLAKE)
[17:01:43] [PASSED] 0xFD81 (PANTHERLAKE)
[17:01:43] [PASSED] 0xD740 (NOVALAKE_S)
[17:01:43] [PASSED] 0xD741 (NOVALAKE_S)
[17:01:43] [PASSED] 0xD742 (NOVALAKE_S)
[17:01:43] [PASSED] 0xD743 (NOVALAKE_S)
[17:01:43] [PASSED] 0xD744 (NOVALAKE_S)
[17:01:43] [PASSED] 0xD745 (NOVALAKE_S)
[17:01:43] [PASSED] 0x674C (CRESCENTISLAND)
[17:01:43] =============== [PASSED] check_platform_desc ===============
[17:01:43] ===================== [PASSED] xe_pci ======================
[17:01:43] =================== xe_rtp (2 subtests) ====================
[17:01:43] =============== xe_rtp_process_to_sr_tests  ================
[17:01:43] [PASSED] coalesce-same-reg
[17:01:43] [PASSED] no-match-no-add
[17:01:43] [PASSED] match-or
[17:01:43] [PASSED] match-or-xfail
[17:01:43] [PASSED] no-match-no-add-multiple-rules
[17:01:43] [PASSED] two-regs-two-entries
[17:01:43] [PASSED] clr-one-set-other
[17:01:43] [PASSED] set-field
[17:01:43] [PASSED] conflict-duplicate
[17:01:43] [PASSED] conflict-not-disjoint
[17:01:43] [PASSED] conflict-reg-type
[17:01:43] =========== [PASSED] xe_rtp_process_to_sr_tests ============
[17:01:43] ================== xe_rtp_process_tests  ===================
[17:01:43] [PASSED] active1
[17:01:43] [PASSED] active2
[17:01:43] [PASSED] active-inactive
[17:01:43] [PASSED] inactive-active
[17:01:43] [PASSED] inactive-1st_or_active-inactive
[17:01:43] [PASSED] inactive-2nd_or_active-inactive
[17:01:43] [PASSED] inactive-last_or_active-inactive
[17:01:43] [PASSED] inactive-no_or_active-inactive
[17:01:43] ============== [PASSED] xe_rtp_process_tests ===============
[17:01:43] ===================== [PASSED] xe_rtp ======================
[17:01:43] ==================== xe_wa (1 subtest) =====================
[17:01:43] ======================== xe_wa_gt  =========================
[17:01:43] [PASSED] TIGERLAKE B0
[17:01:43] [PASSED] DG1 A0
[17:01:43] [PASSED] DG1 B0
[17:01:43] [PASSED] ALDERLAKE_S A0
[17:01:43] [PASSED] ALDERLAKE_S B0
[17:01:43] [PASSED] ALDERLAKE_S C0
[17:01:43] [PASSED] ALDERLAKE_S D0
[17:01:43] [PASSED] ALDERLAKE_P A0
[17:01:43] [PASSED] ALDERLAKE_P B0
[17:01:43] [PASSED] ALDERLAKE_P C0
[17:01:43] [PASSED] ALDERLAKE_S RPLS D0
[17:01:43] [PASSED] ALDERLAKE_P RPLU E0
[17:01:43] [PASSED] DG2 G10 C0
[17:01:43] [PASSED] DG2 G11 B1
[17:01:43] [PASSED] DG2 G12 A1
[17:01:43] [PASSED] METEORLAKE 12.70(Xe_LPG) A0 13.00(Xe_LPM+) A0
[17:01:43] [PASSED] METEORLAKE 12.71(Xe_LPG) A0 13.00(Xe_LPM+) A0
[17:01:43] [PASSED] METEORLAKE 12.74(Xe_LPG+) A0 13.00(Xe_LPM+) A0
[17:01:43] [PASSED] LUNARLAKE 20.04(Xe2_LPG) A0 20.00(Xe2_LPM) A0
[17:01:43] [PASSED] LUNARLAKE 20.04(Xe2_LPG) B0 20.00(Xe2_LPM) A0
[17:01:43] [PASSED] BATTLEMAGE 20.01(Xe2_HPG) A0 13.01(Xe2_HPM) A1
[17:01:43] [PASSED] PANTHERLAKE 30.00(Xe3_LPG) A0 30.00(Xe3_LPM) A0
[17:01:43] ==================== [PASSED] xe_wa_gt =====================
[17:01:43] ====================== [PASSED] xe_wa ======================
[17:01:43] ============================================================
[17:01:43] Testing complete. Ran 512 tests: passed: 494, skipped: 18
[17:01:43] Elapsed time: 36.174s total, 4.219s configuring, 31.438s building, 0.471s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/tests/.kunitconfig
[17:01:43] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[17:01:45] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[17:02:11] Starting KUnit Kernel (1/1)...
[17:02:11] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[17:02:11] ============ drm_test_pick_cmdline (2 subtests) ============
[17:02:11] [PASSED] drm_test_pick_cmdline_res_1920_1080_60
[17:02:11] =============== drm_test_pick_cmdline_named  ===============
[17:02:11] [PASSED] NTSC
[17:02:11] [PASSED] NTSC-J
[17:02:11] [PASSED] PAL
[17:02:11] [PASSED] PAL-M
[17:02:11] =========== [PASSED] drm_test_pick_cmdline_named ===========
[17:02:11] ============== [PASSED] drm_test_pick_cmdline ==============
[17:02:11] == drm_test_atomic_get_connector_for_encoder (1 subtest) ===
[17:02:11] [PASSED] drm_test_drm_atomic_get_connector_for_encoder
[17:02:11] ==== [PASSED] drm_test_atomic_get_connector_for_encoder ====
[17:02:11] =========== drm_validate_clone_mode (2 subtests) ===========
[17:02:11] ============== drm_test_check_in_clone_mode  ===============
[17:02:11] [PASSED] in_clone_mode
[17:02:11] [PASSED] not_in_clone_mode
[17:02:11] ========== [PASSED] drm_test_check_in_clone_mode ===========
[17:02:11] =============== drm_test_check_valid_clones  ===============
[17:02:11] [PASSED] not_in_clone_mode
[17:02:11] [PASSED] valid_clone
[17:02:11] [PASSED] invalid_clone
[17:02:11] =========== [PASSED] drm_test_check_valid_clones ===========
[17:02:11] ============= [PASSED] drm_validate_clone_mode =============
[17:02:11] ============= drm_validate_modeset (1 subtest) =============
[17:02:11] [PASSED] drm_test_check_connector_changed_modeset
[17:02:11] ============== [PASSED] drm_validate_modeset ===============
[17:02:11] ====== drm_test_bridge_get_current_state (2 subtests) ======
[17:02:11] [PASSED] drm_test_drm_bridge_get_current_state_atomic
[17:02:11] [PASSED] drm_test_drm_bridge_get_current_state_legacy
[17:02:11] ======== [PASSED] drm_test_bridge_get_current_state ========
[17:02:11] ====== drm_test_bridge_helper_reset_crtc (3 subtests) ======
[17:02:11] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic
[17:02:11] [PASSED] drm_test_drm_bridge_helper_reset_crtc_atomic_disabled
[17:02:11] [PASSED] drm_test_drm_bridge_helper_reset_crtc_legacy
[17:02:11] ======== [PASSED] drm_test_bridge_helper_reset_crtc ========
[17:02:11] ============== drm_bridge_alloc (2 subtests) ===============
[17:02:11] [PASSED] drm_test_drm_bridge_alloc_basic
[17:02:11] [PASSED] drm_test_drm_bridge_alloc_get_put
[17:02:11] ================ [PASSED] drm_bridge_alloc =================
[17:02:11] ================== drm_buddy (8 subtests) ==================
[17:02:11] [PASSED] drm_test_buddy_alloc_limit
[17:02:11] [PASSED] drm_test_buddy_alloc_optimistic
[17:02:11] [PASSED] drm_test_buddy_alloc_pessimistic
[17:02:11] [PASSED] drm_test_buddy_alloc_pathological
[17:02:11] [PASSED] drm_test_buddy_alloc_contiguous
[17:02:11] [PASSED] drm_test_buddy_alloc_clear
[17:02:11] [PASSED] drm_test_buddy_alloc_range_bias
[17:02:11] [PASSED] drm_test_buddy_fragmentation_performance
[17:02:11] ==================== [PASSED] drm_buddy ====================
[17:02:11] ============= drm_cmdline_parser (40 subtests) =============
[17:02:11] [PASSED] drm_test_cmdline_force_d_only
[17:02:11] [PASSED] drm_test_cmdline_force_D_only_dvi
[17:02:11] [PASSED] drm_test_cmdline_force_D_only_hdmi
[17:02:11] [PASSED] drm_test_cmdline_force_D_only_not_digital
[17:02:11] [PASSED] drm_test_cmdline_force_e_only
[17:02:11] [PASSED] drm_test_cmdline_res
[17:02:11] [PASSED] drm_test_cmdline_res_vesa
[17:02:11] [PASSED] drm_test_cmdline_res_vesa_rblank
[17:02:11] [PASSED] drm_test_cmdline_res_rblank
[17:02:11] [PASSED] drm_test_cmdline_res_bpp
[17:02:11] [PASSED] drm_test_cmdline_res_refresh
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh_margins
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh_force_off
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_analog
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh_force_on_digital
[17:02:11] [PASSED] drm_test_cmdline_res_bpp_refresh_interlaced_margins_force_on
[17:02:11] [PASSED] drm_test_cmdline_res_margins_force_on
[17:02:11] [PASSED] drm_test_cmdline_res_vesa_margins
[17:02:11] [PASSED] drm_test_cmdline_name
[17:02:11] [PASSED] drm_test_cmdline_name_bpp
[17:02:11] [PASSED] drm_test_cmdline_name_option
[17:02:11] [PASSED] drm_test_cmdline_name_bpp_option
[17:02:11] [PASSED] drm_test_cmdline_rotate_0
[17:02:11] [PASSED] drm_test_cmdline_rotate_90
[17:02:11] [PASSED] drm_test_cmdline_rotate_180
[17:02:11] [PASSED] drm_test_cmdline_rotate_270
[17:02:11] [PASSED] drm_test_cmdline_hmirror
[17:02:11] [PASSED] drm_test_cmdline_vmirror
[17:02:11] [PASSED] drm_test_cmdline_margin_options
[17:02:11] [PASSED] drm_test_cmdline_multiple_options
[17:02:11] [PASSED] drm_test_cmdline_bpp_extra_and_option
[17:02:11] [PASSED] drm_test_cmdline_extra_and_option
[17:02:11] [PASSED] drm_test_cmdline_freestanding_options
[17:02:11] [PASSED] drm_test_cmdline_freestanding_force_e_and_options
[17:02:11] [PASSED] drm_test_cmdline_panel_orientation
[17:02:11] ================ drm_test_cmdline_invalid  =================
[17:02:11] [PASSED] margin_only
[17:02:11] [PASSED] interlace_only
[17:02:11] [PASSED] res_missing_x
[17:02:11] [PASSED] res_missing_y
[17:02:11] [PASSED] res_bad_y
[17:02:11] [PASSED] res_missing_y_bpp
[17:02:11] [PASSED] res_bad_bpp
[17:02:11] [PASSED] res_bad_refresh
[17:02:11] [PASSED] res_bpp_refresh_force_on_off
[17:02:11] [PASSED] res_invalid_mode
[17:02:11] [PASSED] res_bpp_wrong_place_mode
[17:02:11] [PASSED] name_bpp_refresh
[17:02:11] [PASSED] name_refresh
[17:02:11] [PASSED] name_refresh_wrong_mode
[17:02:11] [PASSED] name_refresh_invalid_mode
[17:02:11] [PASSED] rotate_multiple
[17:02:11] [PASSED] rotate_invalid_val
[17:02:11] [PASSED] rotate_truncated
[17:02:11] [PASSED] invalid_option
[17:02:11] [PASSED] invalid_tv_option
[17:02:11] [PASSED] truncated_tv_option
[17:02:11] ============ [PASSED] drm_test_cmdline_invalid =============
[17:02:11] =============== drm_test_cmdline_tv_options  ===============
[17:02:11] [PASSED] NTSC
[17:02:11] [PASSED] NTSC_443
[17:02:11] [PASSED] NTSC_J
[17:02:11] [PASSED] PAL
[17:02:11] [PASSED] PAL_M
[17:02:11] [PASSED] PAL_N
[17:02:11] [PASSED] SECAM
[17:02:11] [PASSED] MONO_525
[17:02:11] [PASSED] MONO_625
[17:02:11] =========== [PASSED] drm_test_cmdline_tv_options ===========
[17:02:11] =============== [PASSED] drm_cmdline_parser ================
[17:02:11] ========== drmm_connector_hdmi_init (20 subtests) ==========
[17:02:11] [PASSED] drm_test_connector_hdmi_init_valid
[17:02:11] [PASSED] drm_test_connector_hdmi_init_bpc_8
[17:02:11] [PASSED] drm_test_connector_hdmi_init_bpc_10
[17:02:11] [PASSED] drm_test_connector_hdmi_init_bpc_12
[17:02:11] [PASSED] drm_test_connector_hdmi_init_bpc_invalid
[17:02:11] [PASSED] drm_test_connector_hdmi_init_bpc_null
[17:02:11] [PASSED] drm_test_connector_hdmi_init_formats_empty
[17:02:11] [PASSED] drm_test_connector_hdmi_init_formats_no_rgb
[17:02:11] === drm_test_connector_hdmi_init_formats_yuv420_allowed  ===
[17:02:11] [PASSED] supported_formats=0x9 yuv420_allowed=1
[17:02:11] [PASSED] supported_formats=0x9 yuv420_allowed=0
[17:02:11] [PASSED] supported_formats=0x3 yuv420_allowed=1
[17:02:11] [PASSED] supported_formats=0x3 yuv420_allowed=0
[17:02:11] === [PASSED] drm_test_connector_hdmi_init_formats_yuv420_allowed ===
[17:02:11] [PASSED] drm_test_connector_hdmi_init_null_ddc
[17:02:11] [PASSED] drm_test_connector_hdmi_init_null_product
[17:02:11] [PASSED] drm_test_connector_hdmi_init_null_vendor
[17:02:11] [PASSED] drm_test_connector_hdmi_init_product_length_exact
[17:02:11] [PASSED] drm_test_connector_hdmi_init_product_length_too_long
[17:02:11] [PASSED] drm_test_connector_hdmi_init_product_valid
[17:02:11] [PASSED] drm_test_connector_hdmi_init_vendor_length_exact
[17:02:11] [PASSED] drm_test_connector_hdmi_init_vendor_length_too_long
[17:02:11] [PASSED] drm_test_connector_hdmi_init_vendor_valid
[17:02:11] ========= drm_test_connector_hdmi_init_type_valid  =========
[17:02:11] [PASSED] HDMI-A
[17:02:11] [PASSED] HDMI-B
[17:02:11] ===== [PASSED] drm_test_connector_hdmi_init_type_valid =====
[17:02:11] ======== drm_test_connector_hdmi_init_type_invalid  ========
[17:02:11] [PASSED] Unknown
[17:02:11] [PASSED] VGA
[17:02:11] [PASSED] DVI-I
[17:02:11] [PASSED] DVI-D
[17:02:11] [PASSED] DVI-A
[17:02:11] [PASSED] Composite
[17:02:11] [PASSED] SVIDEO
[17:02:11] [PASSED] LVDS
[17:02:11] [PASSED] Component
[17:02:11] [PASSED] DIN
[17:02:11] [PASSED] DP
[17:02:11] [PASSED] TV
[17:02:11] [PASSED] eDP
[17:02:11] [PASSED] Virtual
[17:02:11] [PASSED] DSI
[17:02:11] [PASSED] DPI
[17:02:11] [PASSED] Writeback
[17:02:11] [PASSED] SPI
[17:02:11] [PASSED] USB
[17:02:11] ==== [PASSED] drm_test_connector_hdmi_init_type_invalid ====
[17:02:11] ============ [PASSED] drmm_connector_hdmi_init =============
[17:02:11] ============= drmm_connector_init (3 subtests) =============
[17:02:11] [PASSED] drm_test_drmm_connector_init
[17:02:11] [PASSED] drm_test_drmm_connector_init_null_ddc
[17:02:11] ========= drm_test_drmm_connector_init_type_valid  =========
[17:02:11] [PASSED] Unknown
[17:02:11] [PASSED] VGA
[17:02:11] [PASSED] DVI-I
[17:02:11] [PASSED] DVI-D
[17:02:11] [PASSED] DVI-A
[17:02:11] [PASSED] Composite
[17:02:11] [PASSED] SVIDEO
[17:02:11] [PASSED] LVDS
[17:02:11] [PASSED] Component
[17:02:11] [PASSED] DIN
[17:02:11] [PASSED] DP
[17:02:11] [PASSED] HDMI-A
[17:02:11] [PASSED] HDMI-B
[17:02:11] [PASSED] TV
[17:02:11] [PASSED] eDP
[17:02:11] [PASSED] Virtual
[17:02:11] [PASSED] DSI
[17:02:11] [PASSED] DPI
[17:02:11] [PASSED] Writeback
[17:02:11] [PASSED] SPI
[17:02:11] [PASSED] USB
[17:02:11] ===== [PASSED] drm_test_drmm_connector_init_type_valid =====
[17:02:11] =============== [PASSED] drmm_connector_init ===============
[17:02:11] ========= drm_connector_dynamic_init (6 subtests) ==========
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_init
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_init_null_ddc
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_init_not_added
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_init_properties
[17:02:11] ===== drm_test_drm_connector_dynamic_init_type_valid  ======
[17:02:11] [PASSED] Unknown
[17:02:11] [PASSED] VGA
[17:02:11] [PASSED] DVI-I
[17:02:11] [PASSED] DVI-D
[17:02:11] [PASSED] DVI-A
[17:02:11] [PASSED] Composite
[17:02:11] [PASSED] SVIDEO
[17:02:11] [PASSED] LVDS
[17:02:11] [PASSED] Component
[17:02:11] [PASSED] DIN
[17:02:11] [PASSED] DP
[17:02:11] [PASSED] HDMI-A
[17:02:11] [PASSED] HDMI-B
[17:02:11] [PASSED] TV
[17:02:11] [PASSED] eDP
[17:02:11] [PASSED] Virtual
[17:02:11] [PASSED] DSI
[17:02:11] [PASSED] DPI
[17:02:11] [PASSED] Writeback
[17:02:11] [PASSED] SPI
[17:02:11] [PASSED] USB
[17:02:11] = [PASSED] drm_test_drm_connector_dynamic_init_type_valid ==
[17:02:11] ======== drm_test_drm_connector_dynamic_init_name  =========
[17:02:11] [PASSED] Unknown
[17:02:11] [PASSED] VGA
[17:02:11] [PASSED] DVI-I
[17:02:11] [PASSED] DVI-D
[17:02:11] [PASSED] DVI-A
[17:02:11] [PASSED] Composite
[17:02:11] [PASSED] SVIDEO
[17:02:11] [PASSED] LVDS
[17:02:11] [PASSED] Component
[17:02:11] [PASSED] DIN
[17:02:11] [PASSED] DP
[17:02:11] [PASSED] HDMI-A
[17:02:11] [PASSED] HDMI-B
[17:02:11] [PASSED] TV
[17:02:11] [PASSED] eDP
[17:02:11] [PASSED] Virtual
[17:02:11] [PASSED] DSI
[17:02:11] [PASSED] DPI
[17:02:11] [PASSED] Writeback
[17:02:11] [PASSED] SPI
[17:02:11] [PASSED] USB
[17:02:11] ==== [PASSED] drm_test_drm_connector_dynamic_init_name =====
[17:02:11] =========== [PASSED] drm_connector_dynamic_init ============
[17:02:11] ==== drm_connector_dynamic_register_early (4 subtests) =====
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_early_on_list
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_early_defer
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_early_no_init
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_early_no_mode_object
[17:02:11] ====== [PASSED] drm_connector_dynamic_register_early =======
[17:02:11] ======= drm_connector_dynamic_register (7 subtests) ========
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_on_list
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_no_defer
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_no_init
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_mode_object
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_sysfs
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_sysfs_name
[17:02:11] [PASSED] drm_test_drm_connector_dynamic_register_debugfs
[17:02:11] ========= [PASSED] drm_connector_dynamic_register ==========
[17:02:11] = drm_connector_attach_broadcast_rgb_property (2 subtests) =
[17:02:11] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property
[17:02:11] [PASSED] drm_test_drm_connector_attach_broadcast_rgb_property_hdmi_connector
[17:02:11] === [PASSED] drm_connector_attach_broadcast_rgb_property ===
[17:02:11] ========== drm_get_tv_mode_from_name (2 subtests) ==========
[17:02:11] ========== drm_test_get_tv_mode_from_name_valid  ===========
[17:02:11] [PASSED] NTSC
[17:02:11] [PASSED] NTSC-443
[17:02:11] [PASSED] NTSC-J
[17:02:11] [PASSED] PAL
[17:02:11] [PASSED] PAL-M
[17:02:11] [PASSED] PAL-N
[17:02:11] [PASSED] SECAM
[17:02:11] [PASSED] Mono
[17:02:11] ====== [PASSED] drm_test_get_tv_mode_from_name_valid =======
[17:02:11] [PASSED] drm_test_get_tv_mode_from_name_truncated
[17:02:11] ============ [PASSED] drm_get_tv_mode_from_name ============
[17:02:11] = drm_test_connector_hdmi_compute_mode_clock (12 subtests) =
[17:02:11] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb
[17:02:11] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc
[17:02:11] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_10bpc_vic_1
[17:02:11] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc
[17:02:11] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_12bpc_vic_1
[17:02:11] [PASSED] drm_test_drm_hdmi_compute_mode_clock_rgb_double
[17:02:11] = drm_test_connector_hdmi_compute_mode_clock_yuv420_valid  =
[17:02:11] [PASSED] VIC 96
[17:02:11] [PASSED] VIC 97
[17:02:11] [PASSED] VIC 101
[17:02:11] [PASSED] VIC 102
[17:02:11] [PASSED] VIC 106
[17:02:11] [PASSED] VIC 107
[17:02:11] === [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_valid ===
[17:02:11] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_10_bpc
[17:02:11] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv420_12_bpc
[17:02:11] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_8_bpc
[17:02:11] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_10_bpc
[17:02:11] [PASSED] drm_test_connector_hdmi_compute_mode_clock_yuv422_12_bpc
[17:02:11] === [PASSED] drm_test_connector_hdmi_compute_mode_clock ====
[17:02:11] == drm_hdmi_connector_get_broadcast_rgb_name (2 subtests) ==
[17:02:11] === drm_test_drm_hdmi_connector_get_broadcast_rgb_name  ====
[17:02:11] [PASSED] Automatic
[17:02:11] [PASSED] Full
[17:02:11] [PASSED] Limited 16:235
[17:02:11] === [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name ===
[17:02:11] [PASSED] drm_test_drm_hdmi_connector_get_broadcast_rgb_name_invalid
[17:02:11] ==== [PASSED] drm_hdmi_connector_get_broadcast_rgb_name ====
[17:02:11] == drm_hdmi_connector_get_output_format_name (2 subtests) ==
[17:02:11] === drm_test_drm_hdmi_connector_get_output_format_name  ====
[17:02:11] [PASSED] RGB
[17:02:11] [PASSED] YUV 4:2:0
[17:02:11] [PASSED] YUV 4:2:2
[17:02:11] [PASSED] YUV 4:4:4
[17:02:11] === [PASSED] drm_test_drm_hdmi_connector_get_output_format_name ===
[17:02:11] [PASSED] drm_test_drm_hdmi_connector_get_output_format_name_invalid
[17:02:11] ==== [PASSED] drm_hdmi_connector_get_output_format_name ====
[17:02:11] ============= drm_damage_helper (21 subtests) ==============
[17:02:11] [PASSED] drm_test_damage_iter_no_damage
[17:02:11] [PASSED] drm_test_damage_iter_no_damage_fractional_src
[17:02:11] [PASSED] drm_test_damage_iter_no_damage_src_moved
[17:02:11] [PASSED] drm_test_damage_iter_no_damage_fractional_src_moved
[17:02:11] [PASSED] drm_test_damage_iter_no_damage_not_visible
[17:02:11] [PASSED] drm_test_damage_iter_no_damage_no_crtc
[17:02:11] [PASSED] drm_test_damage_iter_no_damage_no_fb
[17:02:11] [PASSED] drm_test_damage_iter_simple_damage
[17:02:11] [PASSED] drm_test_damage_iter_single_damage
[17:02:11] [PASSED] drm_test_damage_iter_single_damage_intersect_src
[17:02:11] [PASSED] drm_test_damage_iter_single_damage_outside_src
[17:02:11] [PASSED] drm_test_damage_iter_single_damage_fractional_src
[17:02:11] [PASSED] drm_test_damage_iter_single_damage_intersect_fractional_src
[17:02:11] [PASSED] drm_test_damage_iter_single_damage_outside_fractional_src
[17:02:11] [PASSED] drm_test_damage_iter_single_damage_src_moved
[17:02:11] [PASSED] drm_test_damage_iter_single_damage_fractional_src_moved
[17:02:11] [PASSED] drm_test_damage_iter_damage
[17:02:11] [PASSED] drm_test_damage_iter_damage_one_intersect
[17:02:11] [PASSED] drm_test_damage_iter_damage_one_outside
[17:02:11] [PASSED] drm_test_damage_iter_damage_src_moved
[17:02:11] [PASSED] drm_test_damage_iter_damage_not_visible
[17:02:11] ================ [PASSED] drm_damage_helper ================
[17:02:11] ============== drm_dp_mst_helper (3 subtests) ==============
[17:02:11] ============== drm_test_dp_mst_calc_pbn_mode  ==============
[17:02:11] [PASSED] Clock 154000 BPP 30 DSC disabled
[17:02:11] [PASSED] Clock 234000 BPP 30 DSC disabled
[17:02:11] [PASSED] Clock 297000 BPP 24 DSC disabled
[17:02:11] [PASSED] Clock 332880 BPP 24 DSC enabled
[17:02:11] [PASSED] Clock 324540 BPP 24 DSC enabled
[17:02:11] ========== [PASSED] drm_test_dp_mst_calc_pbn_mode ==========
[17:02:11] ============== drm_test_dp_mst_calc_pbn_div  ===============
[17:02:11] [PASSED] Link rate 2000000 lane count 4
[17:02:11] [PASSED] Link rate 2000000 lane count 2
[17:02:11] [PASSED] Link rate 2000000 lane count 1
[17:02:11] [PASSED] Link rate 1350000 lane count 4
[17:02:11] [PASSED] Link rate 1350000 lane count 2
[17:02:11] [PASSED] Link rate 1350000 lane count 1
[17:02:11] [PASSED] Link rate 1000000 lane count 4
[17:02:11] [PASSED] Link rate 1000000 lane count 2
[17:02:11] [PASSED] Link rate 1000000 lane count 1
[17:02:11] [PASSED] Link rate 810000 lane count 4
[17:02:11] [PASSED] Link rate 810000 lane count 2
[17:02:11] [PASSED] Link rate 810000 lane count 1
[17:02:11] [PASSED] Link rate 540000 lane count 4
[17:02:11] [PASSED] Link rate 540000 lane count 2
[17:02:11] [PASSED] Link rate 540000 lane count 1
[17:02:11] [PASSED] Link rate 270000 lane count 4
[17:02:11] [PASSED] Link rate 270000 lane count 2
[17:02:11] [PASSED] Link rate 270000 lane count 1
[17:02:11] [PASSED] Link rate 162000 lane count 4
[17:02:11] [PASSED] Link rate 162000 lane count 2
[17:02:11] [PASSED] Link rate 162000 lane count 1
[17:02:11] ========== [PASSED] drm_test_dp_mst_calc_pbn_div ===========
[17:02:11] ========= drm_test_dp_mst_sideband_msg_req_decode  =========
[17:02:11] [PASSED] DP_ENUM_PATH_RESOURCES with port number
[17:02:11] [PASSED] DP_POWER_UP_PHY with port number
[17:02:11] [PASSED] DP_POWER_DOWN_PHY with port number
[17:02:11] [PASSED] DP_ALLOCATE_PAYLOAD with SDP stream sinks
[17:02:11] [PASSED] DP_ALLOCATE_PAYLOAD with port number
[17:02:11] [PASSED] DP_ALLOCATE_PAYLOAD with VCPI
[17:02:11] [PASSED] DP_ALLOCATE_PAYLOAD with PBN
[17:02:11] [PASSED] DP_QUERY_PAYLOAD with port number
[17:02:11] [PASSED] DP_QUERY_PAYLOAD with VCPI
[17:02:11] [PASSED] DP_REMOTE_DPCD_READ with port number
[17:02:11] [PASSED] DP_REMOTE_DPCD_READ with DPCD address
[17:02:11] [PASSED] DP_REMOTE_DPCD_READ with max number of bytes
[17:02:11] [PASSED] DP_REMOTE_DPCD_WRITE with port number
[17:02:11] [PASSED] DP_REMOTE_DPCD_WRITE with DPCD address
[17:02:11] [PASSED] DP_REMOTE_DPCD_WRITE with data array
[17:02:11] [PASSED] DP_REMOTE_I2C_READ with port number
[17:02:11] [PASSED] DP_REMOTE_I2C_READ with I2C device ID
[17:02:11] [PASSED] DP_REMOTE_I2C_READ with transactions array
[17:02:11] [PASSED] DP_REMOTE_I2C_WRITE with port number
[17:02:11] [PASSED] DP_REMOTE_I2C_WRITE with I2C device ID
[17:02:11] [PASSED] DP_REMOTE_I2C_WRITE with data array
[17:02:11] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream ID
[17:02:11] [PASSED] DP_QUERY_STREAM_ENC_STATUS with client ID
[17:02:11] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream event
[17:02:11] [PASSED] DP_QUERY_STREAM_ENC_STATUS with valid stream event
[17:02:11] [PASSED] DP_QUERY_STREAM_ENC_STATUS with stream behavior
[17:02:11] [PASSED] DP_QUERY_STREAM_ENC_STATUS with a valid stream behavior
[17:02:11] ===== [PASSED] drm_test_dp_mst_sideband_msg_req_decode =====
[17:02:11] ================ [PASSED] drm_dp_mst_helper ================
[17:02:11] ================== drm_exec (7 subtests) ===================
[17:02:11] [PASSED] sanitycheck
[17:02:11] [PASSED] test_lock
[17:02:11] [PASSED] test_lock_unlock
[17:02:11] [PASSED] test_duplicates
[17:02:11] [PASSED] test_prepare
[17:02:11] [PASSED] test_prepare_array
[17:02:11] [PASSED] test_multiple_loops
[17:02:11] ==================== [PASSED] drm_exec =====================
[17:02:11] =========== drm_format_helper_test (17 subtests) ===========
[17:02:11] ============== drm_test_fb_xrgb8888_to_gray8  ==============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ========== [PASSED] drm_test_fb_xrgb8888_to_gray8 ==========
[17:02:11] ============= drm_test_fb_xrgb8888_to_rgb332  ==============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb332 ==========
[17:02:11] ============= drm_test_fb_xrgb8888_to_rgb565  ==============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb565 ==========
[17:02:11] ============ drm_test_fb_xrgb8888_to_xrgb1555  =============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======== [PASSED] drm_test_fb_xrgb8888_to_xrgb1555 =========
[17:02:11] ============ drm_test_fb_xrgb8888_to_argb1555  =============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======== [PASSED] drm_test_fb_xrgb8888_to_argb1555 =========
[17:02:11] ============ drm_test_fb_xrgb8888_to_rgba5551  =============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======== [PASSED] drm_test_fb_xrgb8888_to_rgba5551 =========
[17:02:11] ============= drm_test_fb_xrgb8888_to_rgb888  ==============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ========= [PASSED] drm_test_fb_xrgb8888_to_rgb888 ==========
[17:02:11] ============= drm_test_fb_xrgb8888_to_bgr888  ==============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ========= [PASSED] drm_test_fb_xrgb8888_to_bgr888 ==========
[17:02:11] ============ drm_test_fb_xrgb8888_to_argb8888  =============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======== [PASSED] drm_test_fb_xrgb8888_to_argb8888 =========
[17:02:11] =========== drm_test_fb_xrgb8888_to_xrgb2101010  ===========
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======= [PASSED] drm_test_fb_xrgb8888_to_xrgb2101010 =======
[17:02:11] =========== drm_test_fb_xrgb8888_to_argb2101010  ===========
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======= [PASSED] drm_test_fb_xrgb8888_to_argb2101010 =======
[17:02:11] ============== drm_test_fb_xrgb8888_to_mono  ===============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ========== [PASSED] drm_test_fb_xrgb8888_to_mono ===========
[17:02:11] ==================== drm_test_fb_swab  =====================
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ================ [PASSED] drm_test_fb_swab =================
[17:02:11] ============ drm_test_fb_xrgb8888_to_xbgr8888  =============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======== [PASSED] drm_test_fb_xrgb8888_to_xbgr8888 =========
[17:02:11] ============ drm_test_fb_xrgb8888_to_abgr8888  =============
[17:02:11] [PASSED] single_pixel_source_buffer
[17:02:11] [PASSED] single_pixel_clip_rectangle
[17:02:11] [PASSED] well_known_colors
[17:02:11] [PASSED] destination_pitch
[17:02:11] ======== [PASSED] drm_test_fb_xrgb8888_to_abgr8888 =========
[17:02:11] ================= drm_test_fb_clip_offset  =================
[17:02:11] [PASSED] pass through
[17:02:11] [PASSED] horizontal offset
[17:02:11] [PASSED] vertical offset
[17:02:11] [PASSED] horizontal and vertical offset
[17:02:11] [PASSED] horizontal offset (custom pitch)
[17:02:11] [PASSED] vertical offset (custom pitch)
[17:02:11] [PASSED] horizontal and vertical offset (custom pitch)
[17:02:11] ============= [PASSED] drm_test_fb_clip_offset =============
[17:02:11] =================== drm_test_fb_memcpy  ====================
[17:02:11] [PASSED] single_pixel_source_buffer: XR24 little-endian (0x34325258)
[17:02:11] [PASSED] single_pixel_source_buffer: XRA8 little-endian (0x38415258)
[17:02:11] [PASSED] single_pixel_source_buffer: YU24 little-endian (0x34325559)
[17:02:11] [PASSED] single_pixel_clip_rectangle: XB24 little-endian (0x34324258)
[17:02:11] [PASSED] single_pixel_clip_rectangle: XRA8 little-endian (0x38415258)
[17:02:11] [PASSED] single_pixel_clip_rectangle: YU24 little-endian (0x34325559)
[17:02:11] [PASSED] well_known_colors: XB24 little-endian (0x34324258)
[17:02:11] [PASSED] well_known_colors: XRA8 little-endian (0x38415258)
[17:02:11] [PASSED] well_known_colors: YU24 little-endian (0x34325559)
[17:02:11] [PASSED] destination_pitch: XB24 little-endian (0x34324258)
[17:02:11] [PASSED] destination_pitch: XRA8 little-endian (0x38415258)
[17:02:11] [PASSED] destination_pitch: YU24 little-endian (0x34325559)
[17:02:11] =============== [PASSED] drm_test_fb_memcpy ================
[17:02:11] ============= [PASSED] drm_format_helper_test ==============
[17:02:11] ================= drm_format (18 subtests) =================
[17:02:11] [PASSED] drm_test_format_block_width_invalid
[17:02:11] [PASSED] drm_test_format_block_width_one_plane
[17:02:11] [PASSED] drm_test_format_block_width_two_plane
[17:02:11] [PASSED] drm_test_format_block_width_three_plane
[17:02:11] [PASSED] drm_test_format_block_width_tiled
[17:02:11] [PASSED] drm_test_format_block_height_invalid
[17:02:11] [PASSED] drm_test_format_block_height_one_plane
[17:02:11] [PASSED] drm_test_format_block_height_two_plane
[17:02:11] [PASSED] drm_test_format_block_height_three_plane
[17:02:11] [PASSED] drm_test_format_block_height_tiled
[17:02:11] [PASSED] drm_test_format_min_pitch_invalid
[17:02:11] [PASSED] drm_test_format_min_pitch_one_plane_8bpp
[17:02:11] [PASSED] drm_test_format_min_pitch_one_plane_16bpp
[17:02:11] [PASSED] drm_test_format_min_pitch_one_plane_24bpp
[17:02:11] [PASSED] drm_test_format_min_pitch_one_plane_32bpp
[17:02:11] [PASSED] drm_test_format_min_pitch_two_plane
[17:02:11] [PASSED] drm_test_format_min_pitch_three_plane_8bpp
[17:02:11] [PASSED] drm_test_format_min_pitch_tiled
[17:02:11] =================== [PASSED] drm_format ====================
[17:02:11] ============== drm_framebuffer (10 subtests) ===============
[17:02:11] ========== drm_test_framebuffer_check_src_coords  ==========
[17:02:11] [PASSED] Success: source fits into fb
[17:02:11] [PASSED] Fail: overflowing fb with x-axis coordinate
[17:02:11] [PASSED] Fail: overflowing fb with y-axis coordinate
[17:02:11] [PASSED] Fail: overflowing fb with source width
[17:02:11] [PASSED] Fail: overflowing fb with source height
[17:02:11] ====== [PASSED] drm_test_framebuffer_check_src_coords ======
[17:02:11] [PASSED] drm_test_framebuffer_cleanup
[17:02:11] =============== drm_test_framebuffer_create  ===============
[17:02:11] [PASSED] ABGR8888 normal sizes
[17:02:11] [PASSED] ABGR8888 max sizes
[17:02:11] [PASSED] ABGR8888 pitch greater than min required
[17:02:11] [PASSED] ABGR8888 pitch less than min required
[17:02:11] [PASSED] ABGR8888 Invalid width
[17:02:11] [PASSED] ABGR8888 Invalid buffer handle
[17:02:11] [PASSED] No pixel format
[17:02:11] [PASSED] ABGR8888 Width 0
[17:02:11] [PASSED] ABGR8888 Height 0
[17:02:11] [PASSED] ABGR8888 Out of bound height * pitch combination
[17:02:11] [PASSED] ABGR8888 Large buffer offset
[17:02:11] [PASSED] ABGR8888 Buffer offset for inexistent plane
[17:02:11] [PASSED] ABGR8888 Invalid flag
[17:02:11] [PASSED] ABGR8888 Set DRM_MODE_FB_MODIFIERS without modifiers
[17:02:11] [PASSED] ABGR8888 Valid buffer modifier
[17:02:11] [PASSED] ABGR8888 Invalid buffer modifier(DRM_FORMAT_MOD_SAMSUNG_64_32_TILE)
[17:02:11] [PASSED] ABGR8888 Extra pitches without DRM_MODE_FB_MODIFIERS
[17:02:11] [PASSED] ABGR8888 Extra pitches with DRM_MODE_FB_MODIFIERS
[17:02:11] [PASSED] NV12 Normal sizes
[17:02:11] [PASSED] NV12 Max sizes
[17:02:11] [PASSED] NV12 Invalid pitch
[17:02:11] [PASSED] NV12 Invalid modifier/missing DRM_MODE_FB_MODIFIERS flag
[17:02:11] [PASSED] NV12 different  modifier per-plane
[17:02:11] [PASSED] NV12 with DRM_FORMAT_MOD_SAMSUNG_64_32_TILE
[17:02:11] [PASSED] NV12 Valid modifiers without DRM_MODE_FB_MODIFIERS
[17:02:11] [PASSED] NV12 Modifier for inexistent plane
[17:02:11] [PASSED] NV12 Handle for inexistent plane
[17:02:11] [PASSED] NV12 Handle for inexistent plane without DRM_MODE_FB_MODIFIERS
[17:02:11] [PASSED] YVU420 DRM_MODE_FB_MODIFIERS set without modifier
[17:02:11] [PASSED] YVU420 Normal sizes
[17:02:11] [PASSED] YVU420 Max sizes
[17:02:11] [PASSED] YVU420 Invalid pitch
[17:02:11] [PASSED] YVU420 Different pitches
[17:02:11] [PASSED] YVU420 Different buffer offsets/pitches
[17:02:11] [PASSED] YVU420 Modifier set just for plane 0, without DRM_MODE_FB_MODIFIERS
[17:02:11] [PASSED] YVU420 Modifier set just for planes 0, 1, without DRM_MODE_FB_MODIFIERS
[17:02:11] [PASSED] YVU420 Modifier set just for plane 0, 1, with DRM_MODE_FB_MODIFIERS
[17:02:11] [PASSED] YVU420 Valid modifier
[17:02:11] [PASSED] YVU420 Different modifiers per plane
[17:02:11] [PASSED] YVU420 Modifier for inexistent plane
[17:02:11] [PASSED] YUV420_10BIT Invalid modifier(DRM_FORMAT_MOD_LINEAR)
[17:02:11] [PASSED] X0L2 Normal sizes
[17:02:11] [PASSED] X0L2 Max sizes
[17:02:11] [PASSED] X0L2 Invalid pitch
[17:02:11] [PASSED] X0L2 Pitch greater than minimum required
[17:02:11] [PASSED] X0L2 Handle for inexistent plane
[17:02:11] [PASSED] X0L2 Offset for inexistent plane, without DRM_MODE_FB_MODIFIERS set
[17:02:11] [PASSED] X0L2 Modifier without DRM_MODE_FB_MODIFIERS set
[17:02:11] [PASSED] X0L2 Valid modifier
[17:02:11] [PASSED] X0L2 Modifier for inexistent plane
[17:02:11] =========== [PASSED] drm_test_framebuffer_create ===========
[17:02:11] [PASSED] drm_test_framebuffer_free
[17:02:11] [PASSED] drm_test_framebuffer_init
[17:02:11] [PASSED] drm_test_framebuffer_init_bad_format
[17:02:11] [PASSED] drm_test_framebuffer_init_dev_mismatch
[17:02:11] [PASSED] drm_test_framebuffer_lookup
[17:02:11] [PASSED] drm_test_framebuffer_lookup_inexistent
[17:02:11] [PASSED] drm_test_framebuffer_modifiers_not_supported
[17:02:11] ================= [PASSED] drm_framebuffer =================
[17:02:11] ================ drm_gem_shmem (8 subtests) ================
[17:02:11] [PASSED] drm_gem_shmem_test_obj_create
[17:02:11] [PASSED] drm_gem_shmem_test_obj_create_private
[17:02:11] [PASSED] drm_gem_shmem_test_pin_pages
[17:02:11] [PASSED] drm_gem_shmem_test_vmap
[17:02:11] [PASSED] drm_gem_shmem_test_get_sg_table
[17:02:11] [PASSED] drm_gem_shmem_test_get_pages_sgt
[17:02:11] [PASSED] drm_gem_shmem_test_madvise
[17:02:11] [PASSED] drm_gem_shmem_test_purge
[17:02:11] ================== [PASSED] drm_gem_shmem ==================
[17:02:11] === drm_atomic_helper_connector_hdmi_check (27 subtests) ===
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_auto_cea_mode_vic_1
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_full_cea_mode_vic_1
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_limited_cea_mode_vic_1
[17:02:11] ====== drm_test_check_broadcast_rgb_cea_mode_yuv420  =======
[17:02:11] [PASSED] Automatic
[17:02:11] [PASSED] Full
[17:02:11] [PASSED] Limited 16:235
[17:02:11] == [PASSED] drm_test_check_broadcast_rgb_cea_mode_yuv420 ===
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_changed
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_crtc_mode_not_changed
[17:02:11] [PASSED] drm_test_check_disable_connector
[17:02:11] [PASSED] drm_test_check_hdmi_funcs_reject_rate
[17:02:11] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_rgb
[17:02:11] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_yuv420
[17:02:11] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv422
[17:02:11] [PASSED] drm_test_check_max_tmds_rate_bpc_fallback_ignore_yuv420
[17:02:11] [PASSED] drm_test_check_driver_unsupported_fallback_yuv420
[17:02:11] [PASSED] drm_test_check_output_bpc_crtc_mode_changed
[17:02:11] [PASSED] drm_test_check_output_bpc_crtc_mode_not_changed
[17:02:11] [PASSED] drm_test_check_output_bpc_dvi
[17:02:11] [PASSED] drm_test_check_output_bpc_format_vic_1
[17:02:11] [PASSED] drm_test_check_output_bpc_format_display_8bpc_only
[17:02:11] [PASSED] drm_test_check_output_bpc_format_display_rgb_only
[17:02:11] [PASSED] drm_test_check_output_bpc_format_driver_8bpc_only
[17:02:11] [PASSED] drm_test_check_output_bpc_format_driver_rgb_only
[17:02:11] [PASSED] drm_test_check_tmds_char_rate_rgb_8bpc
[17:02:11] [PASSED] drm_test_check_tmds_char_rate_rgb_10bpc
[17:02:11] [PASSED] drm_test_check_tmds_char_rate_rgb_12bpc
[17:02:11] ===== [PASSED] drm_atomic_helper_connector_hdmi_check ======
[17:02:11] === drm_atomic_helper_connector_hdmi_reset (6 subtests) ====
[17:02:11] [PASSED] drm_test_check_broadcast_rgb_value
[17:02:11] [PASSED] drm_test_check_bpc_8_value
[17:02:11] [PASSED] drm_test_check_bpc_10_value
[17:02:11] [PASSED] drm_test_check_bpc_12_value
[17:02:11] [PASSED] drm_test_check_format_value
[17:02:11] [PASSED] drm_test_check_tmds_char_value
[17:02:11] ===== [PASSED] drm_atomic_helper_connector_hdmi_reset ======
[17:02:11] = drm_atomic_helper_connector_hdmi_mode_valid (4 subtests) =
[17:02:11] [PASSED] drm_test_check_mode_valid
[17:02:11] [PASSED] drm_test_check_mode_valid_reject
[17:02:11] [PASSED] drm_test_check_mode_valid_reject_rate
[17:02:11] [PASSED] drm_test_check_mode_valid_reject_max_clock
[17:02:11] === [PASSED] drm_atomic_helper_connector_hdmi_mode_valid ===
[17:02:11] ================= drm_managed (2 subtests) =================
[17:02:11] [PASSED] drm_test_managed_release_action
[17:02:11] [PASSED] drm_test_managed_run_action
[17:02:11] =================== [PASSED] drm_managed ===================
[17:02:11] =================== drm_mm (6 subtests) ====================
[17:02:11] [PASSED] drm_test_mm_init
[17:02:11] [PASSED] drm_test_mm_debug
[17:02:11] [PASSED] drm_test_mm_align32
[17:02:11] [PASSED] drm_test_mm_align64
[17:02:11] [PASSED] drm_test_mm_lowest
[17:02:11] [PASSED] drm_test_mm_highest
[17:02:11] ===================== [PASSED] drm_mm ======================
[17:02:11] ============= drm_modes_analog_tv (5 subtests) =============
[17:02:11] [PASSED] drm_test_modes_analog_tv_mono_576i
[17:02:11] [PASSED] drm_test_modes_analog_tv_ntsc_480i
[17:02:11] [PASSED] drm_test_modes_analog_tv_ntsc_480i_inlined
[17:02:11] [PASSED] drm_test_modes_analog_tv_pal_576i
[17:02:11] [PASSED] drm_test_modes_analog_tv_pal_576i_inlined
[17:02:11] =============== [PASSED] drm_modes_analog_tv ===============
[17:02:11] ============== drm_plane_helper (2 subtests) ===============
[17:02:11] =============== drm_test_check_plane_state  ================
[17:02:11] [PASSED] clipping_simple
[17:02:11] [PASSED] clipping_rotate_reflect
[17:02:11] [PASSED] positioning_simple
[17:02:11] [PASSED] upscaling
[17:02:11] [PASSED] downscaling
[17:02:11] [PASSED] rounding1
[17:02:11] [PASSED] rounding2
[17:02:11] [PASSED] rounding3
[17:02:11] [PASSED] rounding4
[17:02:11] =========== [PASSED] drm_test_check_plane_state ============
[17:02:11] =========== drm_test_check_invalid_plane_state  ============
[17:02:11] [PASSED] positioning_invalid
[17:02:11] [PASSED] upscaling_invalid
[17:02:11] [PASSED] downscaling_invalid
[17:02:11] ======= [PASSED] drm_test_check_invalid_plane_state ========
[17:02:11] ================ [PASSED] drm_plane_helper =================
[17:02:11] ====== drm_connector_helper_tv_get_modes (1 subtest) =======
[17:02:11] ====== drm_test_connector_helper_tv_get_modes_check  =======
[17:02:11] [PASSED] None
[17:02:11] [PASSED] PAL
[17:02:11] [PASSED] NTSC
[17:02:11] [PASSED] Both, NTSC Default
[17:02:11] [PASSED] Both, PAL Default
[17:02:11] [PASSED] Both, NTSC Default, with PAL on command-line
[17:02:11] [PASSED] Both, PAL Default, with NTSC on command-line
[17:02:11] == [PASSED] drm_test_connector_helper_tv_get_modes_check ===
[17:02:11] ======== [PASSED] drm_connector_helper_tv_get_modes ========
[17:02:11] ================== drm_rect (9 subtests) ===================
[17:02:11] [PASSED] drm_test_rect_clip_scaled_div_by_zero
[17:02:11] [PASSED] drm_test_rect_clip_scaled_not_clipped
[17:02:11] [PASSED] drm_test_rect_clip_scaled_clipped
[17:02:11] [PASSED] drm_test_rect_clip_scaled_signed_vs_unsigned
[17:02:11] ================= drm_test_rect_intersect  =================
[17:02:11] [PASSED] top-left x bottom-right: 2x2+1+1 x 2x2+0+0
[17:02:11] [PASSED] top-right x bottom-left: 2x2+0+0 x 2x2+1-1
[17:02:11] [PASSED] bottom-left x top-right: 2x2+1-1 x 2x2+0+0
[17:02:11] [PASSED] bottom-right x top-left: 2x2+0+0 x 2x2+1+1
[17:02:11] [PASSED] right x left: 2x1+0+0 x 3x1+1+0
[17:02:11] [PASSED] left x right: 3x1+1+0 x 2x1+0+0
[17:02:11] [PASSED] up x bottom: 1x2+0+0 x 1x3+0-1
[17:02:11] [PASSED] bottom x up: 1x3+0-1 x 1x2+0+0
[17:02:11] [PASSED] touching corner: 1x1+0+0 x 2x2+1+1
[17:02:11] [PASSED] touching side: 1x1+0+0 x 1x1+1+0
[17:02:11] [PASSED] equal rects: 2x2+0+0 x 2x2+0+0
[17:02:11] [PASSED] inside another: 2x2+0+0 x 1x1+1+1
[17:02:11] [PASSED] far away: 1x1+0+0 x 1x1+3+6
[17:02:11] [PASSED] points intersecting: 0x0+5+10 x 0x0+5+10
[17:02:11] [PASSED] points not intersecting: 0x0+0+0 x 0x0+5+10
[17:02:11] ============= [PASSED] drm_test_rect_intersect =============
[17:02:11] ================ drm_test_rect_calc_hscale  ================
[17:02:11] [PASSED] normal use
[17:02:11] [PASSED] out of max range
[17:02:11] [PASSED] out of min range
[17:02:11] [PASSED] zero dst
[17:02:11] [PASSED] negative src
[17:02:11] [PASSED] negative dst
[17:02:11] ============ [PASSED] drm_test_rect_calc_hscale ============
[17:02:11] ================ drm_test_rect_calc_vscale  ================
[17:02:11] [PASSED] normal use
stty: 'standard input': Inappropriate ioctl for device
[17:02:11] [PASSED] out of max range
[17:02:11] [PASSED] out of min range
[17:02:11] [PASSED] zero dst
[17:02:11] [PASSED] negative src
[17:02:11] [PASSED] negative dst
[17:02:11] ============ [PASSED] drm_test_rect_calc_vscale ============
[17:02:11] ================== drm_test_rect_rotate  ===================
[17:02:11] [PASSED] reflect-x
[17:02:11] [PASSED] reflect-y
[17:02:11] [PASSED] rotate-0
[17:02:11] [PASSED] rotate-90
[17:02:11] [PASSED] rotate-180
[17:02:11] [PASSED] rotate-270
[17:02:11] ============== [PASSED] drm_test_rect_rotate ===============
[17:02:11] ================ drm_test_rect_rotate_inv  =================
[17:02:11] [PASSED] reflect-x
[17:02:11] [PASSED] reflect-y
[17:02:11] [PASSED] rotate-0
[17:02:11] [PASSED] rotate-90
[17:02:11] [PASSED] rotate-180
[17:02:11] [PASSED] rotate-270
[17:02:11] ============ [PASSED] drm_test_rect_rotate_inv =============
[17:02:11] ==================== [PASSED] drm_rect =====================
[17:02:11] ============ drm_sysfb_modeset_test (1 subtest) ============
[17:02:11] ============ drm_test_sysfb_build_fourcc_list  =============
[17:02:11] [PASSED] no native formats
[17:02:11] [PASSED] XRGB8888 as native format
[17:02:11] [PASSED] remove duplicates
[17:02:11] [PASSED] convert alpha formats
[17:02:11] [PASSED] random formats
[17:02:11] ======== [PASSED] drm_test_sysfb_build_fourcc_list =========
[17:02:11] ============= [PASSED] drm_sysfb_modeset_test ==============
[17:02:11] ================== drm_fixp (2 subtests) ===================
[17:02:11] [PASSED] drm_test_int2fixp
[17:02:11] [PASSED] drm_test_sm2fixp
[17:02:11] ==================== [PASSED] drm_fixp =====================
[17:02:11] ============================================================
[17:02:11] Testing complete. Ran 624 tests: passed: 624
[17:02:11] Elapsed time: 27.578s total, 1.692s configuring, 25.512s building, 0.373s running

+ /kernel/tools/testing/kunit/kunit.py run --kunitconfig /kernel/drivers/gpu/drm/ttm/tests/.kunitconfig
[17:02:11] Configuring KUnit Kernel ...
Regenerating .config ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
[17:02:13] Building KUnit Kernel ...
Populating config with:
$ make ARCH=um O=.kunit olddefconfig
Building with:
$ make all compile_commands.json scripts_gdb ARCH=um O=.kunit --jobs=48
[17:02:22] Starting KUnit Kernel (1/1)...
[17:02:22] ============================================================
Running tests with:
$ .kunit/linux kunit.enable=1 mem=1G console=tty kunit_shutdown=halt
[17:02:22] ================= ttm_device (5 subtests) ==================
[17:02:22] [PASSED] ttm_device_init_basic
[17:02:22] [PASSED] ttm_device_init_multiple
[17:02:22] [PASSED] ttm_device_fini_basic
[17:02:22] [PASSED] ttm_device_init_no_vma_man
[17:02:22] ================== ttm_device_init_pools  ==================
[17:02:22] [PASSED] No DMA allocations, no DMA32 required
[17:02:22] [PASSED] DMA allocations, DMA32 required
[17:02:22] [PASSED] No DMA allocations, DMA32 required
[17:02:22] [PASSED] DMA allocations, no DMA32 required
[17:02:22] ============== [PASSED] ttm_device_init_pools ==============
[17:02:22] =================== [PASSED] ttm_device ====================
[17:02:22] ================== ttm_pool (8 subtests) ===================
[17:02:22] ================== ttm_pool_alloc_basic  ===================
[17:02:22] [PASSED] One page
[17:02:22] [PASSED] More than one page
[17:02:22] [PASSED] Above the allocation limit
[17:02:22] [PASSED] One page, with coherent DMA mappings enabled
[17:02:22] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[17:02:22] ============== [PASSED] ttm_pool_alloc_basic ===============
[17:02:22] ============== ttm_pool_alloc_basic_dma_addr  ==============
[17:02:22] [PASSED] One page
[17:02:22] [PASSED] More than one page
[17:02:22] [PASSED] Above the allocation limit
[17:02:22] [PASSED] One page, with coherent DMA mappings enabled
[17:02:22] [PASSED] Above the allocation limit, with coherent DMA mappings enabled
[17:02:22] ========== [PASSED] ttm_pool_alloc_basic_dma_addr ==========
[17:02:22] [PASSED] ttm_pool_alloc_order_caching_match
[17:02:22] [PASSED] ttm_pool_alloc_caching_mismatch
[17:02:22] [PASSED] ttm_pool_alloc_order_mismatch
[17:02:22] [PASSED] ttm_pool_free_dma_alloc
[17:02:22] [PASSED] ttm_pool_free_no_dma_alloc
[17:02:22] [PASSED] ttm_pool_fini_basic
[17:02:22] ==================== [PASSED] ttm_pool =====================
[17:02:22] ================ ttm_resource (8 subtests) =================
[17:02:22] ================= ttm_resource_init_basic  =================
[17:02:22] [PASSED] Init resource in TTM_PL_SYSTEM
[17:02:22] [PASSED] Init resource in TTM_PL_VRAM
[17:02:22] [PASSED] Init resource in a private placement
[17:02:22] [PASSED] Init resource in TTM_PL_SYSTEM, set placement flags
[17:02:22] ============= [PASSED] ttm_resource_init_basic =============
[17:02:22] [PASSED] ttm_resource_init_pinned
[17:02:22] [PASSED] ttm_resource_fini_basic
[17:02:22] [PASSED] ttm_resource_manager_init_basic
[17:02:22] [PASSED] ttm_resource_manager_usage_basic
[17:02:22] [PASSED] ttm_resource_manager_set_used_basic
[17:02:22] [PASSED] ttm_sys_man_alloc_basic
[17:02:22] [PASSED] ttm_sys_man_free_basic
[17:02:22] ================== [PASSED] ttm_resource ===================
[17:02:22] =================== ttm_tt (15 subtests) ===================
[17:02:22] ==================== ttm_tt_init_basic  ====================
[17:02:22] [PASSED] Page-aligned size
[17:02:22] [PASSED] Extra pages requested
[17:02:22] ================ [PASSED] ttm_tt_init_basic ================
[17:02:22] [PASSED] ttm_tt_init_misaligned
[17:02:22] [PASSED] ttm_tt_fini_basic
[17:02:22] [PASSED] ttm_tt_fini_sg
[17:02:22] [PASSED] ttm_tt_fini_shmem
[17:02:22] [PASSED] ttm_tt_create_basic
[17:02:22] [PASSED] ttm_tt_create_invalid_bo_type
[17:02:22] [PASSED] ttm_tt_create_ttm_exists
[17:02:22] [PASSED] ttm_tt_create_failed
[17:02:22] [PASSED] ttm_tt_destroy_basic
[17:02:22] [PASSED] ttm_tt_populate_null_ttm
[17:02:22] [PASSED] ttm_tt_populate_populated_ttm
[17:02:22] [PASSED] ttm_tt_unpopulate_basic
[17:02:22] [PASSED] ttm_tt_unpopulate_empty_ttm
[17:02:22] [PASSED] ttm_tt_swapin_basic
[17:02:22] ===================== [PASSED] ttm_tt ======================
[17:02:22] =================== ttm_bo (14 subtests) ===================
[17:02:22] =========== ttm_bo_reserve_optimistic_no_ticket  ===========
[17:02:22] [PASSED] Cannot be interrupted and sleeps
[17:02:22] [PASSED] Cannot be interrupted, locks straight away
[17:02:22] [PASSED] Can be interrupted, sleeps
[17:02:22] ======= [PASSED] ttm_bo_reserve_optimistic_no_ticket =======
[17:02:22] [PASSED] ttm_bo_reserve_locked_no_sleep
[17:02:22] [PASSED] ttm_bo_reserve_no_wait_ticket
[17:02:22] [PASSED] ttm_bo_reserve_double_resv
[17:02:22] [PASSED] ttm_bo_reserve_interrupted
[17:02:22] [PASSED] ttm_bo_reserve_deadlock
[17:02:22] [PASSED] ttm_bo_unreserve_basic
[17:02:22] [PASSED] ttm_bo_unreserve_pinned
[17:02:22] [PASSED] ttm_bo_unreserve_bulk
[17:02:22] [PASSED] ttm_bo_fini_basic
[17:02:22] [PASSED] ttm_bo_fini_shared_resv
[17:02:22] [PASSED] ttm_bo_pin_basic
[17:02:22] [PASSED] ttm_bo_pin_unpin_resource
[17:02:22] [PASSED] ttm_bo_multiple_pin_one_unpin
[17:02:22] ===================== [PASSED] ttm_bo ======================
[17:02:22] ============== ttm_bo_validate (21 subtests) ===============
[17:02:22] ============== ttm_bo_init_reserved_sys_man  ===============
[17:02:22] [PASSED] Buffer object for userspace
[17:02:22] [PASSED] Kernel buffer object
[17:02:22] [PASSED] Shared buffer object
[17:02:22] ========== [PASSED] ttm_bo_init_reserved_sys_man ===========
[17:02:22] ============== ttm_bo_init_reserved_mock_man  ==============
[17:02:22] [PASSED] Buffer object for userspace
[17:02:22] [PASSED] Kernel buffer object
[17:02:22] [PASSED] Shared buffer object
[17:02:22] ========== [PASSED] ttm_bo_init_reserved_mock_man ==========
[17:02:22] [PASSED] ttm_bo_init_reserved_resv
[17:02:22] ================== ttm_bo_validate_basic  ==================
[17:02:22] [PASSED] Buffer object for userspace
[17:02:22] [PASSED] Kernel buffer object
[17:02:22] [PASSED] Shared buffer object
[17:02:22] ============== [PASSED] ttm_bo_validate_basic ==============
[17:02:22] [PASSED] ttm_bo_validate_invalid_placement
[17:02:22] ============= ttm_bo_validate_same_placement  ==============
[17:02:22] [PASSED] System manager
[17:02:22] [PASSED] VRAM manager
[17:02:22] ========= [PASSED] ttm_bo_validate_same_placement ==========
[17:02:22] [PASSED] ttm_bo_validate_failed_alloc
[17:02:22] [PASSED] ttm_bo_validate_pinned
[17:02:22] [PASSED] ttm_bo_validate_busy_placement
[17:02:22] ================ ttm_bo_validate_multihop  =================
[17:02:22] [PASSED] Buffer object for userspace
[17:02:22] [PASSED] Kernel buffer object
[17:02:22] [PASSED] Shared buffer object
[17:02:22] ============ [PASSED] ttm_bo_validate_multihop =============
[17:02:22] ========== ttm_bo_validate_no_placement_signaled  ==========
[17:02:22] [PASSED] Buffer object in system domain, no page vector
[17:02:22] [PASSED] Buffer object in system domain with an existing page vector
[17:02:22] ====== [PASSED] ttm_bo_validate_no_placement_signaled ======
[17:02:22] ======== ttm_bo_validate_no_placement_not_signaled  ========
[17:02:22] [PASSED] Buffer object for userspace
[17:02:22] [PASSED] Kernel buffer object
[17:02:22] [PASSED] Shared buffer object
[17:02:22] ==== [PASSED] ttm_bo_validate_no_placement_not_signaled ====
[17:02:22] [PASSED] ttm_bo_validate_move_fence_signaled
[17:02:22] ========= ttm_bo_validate_move_fence_not_signaled  =========
[17:02:22] [PASSED] Waits for GPU
[17:02:22] [PASSED] Tries to lock straight away
[17:02:22] ===== [PASSED] ttm_bo_validate_move_fence_not_signaled =====
[17:02:22] [PASSED] ttm_bo_validate_happy_evict
[17:02:22] [PASSED] ttm_bo_validate_all_pinned_evict
[17:02:22] [PASSED] ttm_bo_validate_allowed_only_evict
[17:02:22] [PASSED] ttm_bo_validate_deleted_evict
[17:02:22] [PASSED] ttm_bo_validate_busy_domain_evict
[17:02:22] [PASSED] ttm_bo_validate_evict_gutting
[17:02:22] [PASSED] ttm_bo_validate_recrusive_evict
stty: 'standard input': Inappropriate ioctl for device
[17:02:22] ================= [PASSED] ttm_bo_validate =================
[17:02:22] ============================================================
[17:02:22] Testing complete. Ran 101 tests: passed: 101
[17:02:22] Elapsed time: 11.373s total, 1.676s configuring, 9.481s building, 0.183s running

+ cleanup
++ stat -c %u:%g /kernel
+ chown -R 1003:1003 /kernel



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
  2026-01-02 16:54 ` [PATCH v2 1/1] " Anoop, Vijay
@ 2026-01-02 23:15   ` Matthew Brost
  2026-01-05  6:29   ` Riana Tauro
  2026-01-06 18:37   ` Umesh Nerlige Ramappa
  2 siblings, 0 replies; 8+ messages in thread
From: Matthew Brost @ 2026-01-02 23:15 UTC (permalink / raw)
  To: Anoop, Vijay
  Cc: intel-xe, umesh.nerlige.ramappa, badal.nilawar, rodrigo.vivi,
	aravind.iddamsetty, riana.tauro, ravi.kishore.koppuravuri,
	anshuman.gupta, matthew.d.roper, michael.j.ruhl, paul.e.luse,
	mohamed.mansoor.v, kam.nasim

On Fri, Jan 02, 2026 at 08:54:50AM -0800, Anoop, Vijay wrote:
> From: Anoop Vijay <anoop.c.vijay@intel.com>
> 
> Add a new system controller (sysctrl) component for Intel Xe3p dGPU
> platforms.
> 
> This component provides the foundational infrastructure for communication
> with the System Controller firmware using MKHI protocol over a mailbox
> interface.
> 
> Key features introduced:
>  - Detection and initialization of System Controller interface on Xe3p
>    dGPU platforms
>  - Mailbox communication with System Controller firmware
>  - Fragmented message transfer for large command payloads
> 
> This implementation establishes the base for future System Controller
> feature enablement and firmware command handling.
> 
> Signed-off-by: Anoop Vijay <anoop.c.vijay@intel.com>

Drive by comment - this patch needs to be split into a series of smaller 
patches for review. A single large patch is highly unlikely to get
reviewed or pulled by a maintainer of Xe or DRM.

Off the top of my head, a sample split could be:

- Define xe_sysctrl_regs.h
- Add has_sysctrl to xe_device / xe_pci 
- Implement xe_sysctrl_mailbox
- Implement xe_sysctrl
- Call xe_sysctrl_init during device probe.  

Matt

> ---
>  drivers/gpu/drm/xe/Makefile               |   2 +
>  drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h |  44 +++
>  drivers/gpu/drm/xe/xe_device.c            |   5 +
>  drivers/gpu/drm/xe/xe_device_types.h      |   6 +
>  drivers/gpu/drm/xe/xe_pci.c               |   2 +
>  drivers/gpu/drm/xe/xe_pci_types.h         |   1 +
>  drivers/gpu/drm/xe/xe_sysctrl.c           |  62 ++++
>  drivers/gpu/drm/xe/xe_sysctrl.h           |  18 +
>  drivers/gpu/drm/xe/xe_sysctrl_mailbox.c   | 409 ++++++++++++++++++++++
>  drivers/gpu/drm/xe/xe_sysctrl_mailbox.h   |  77 ++++
>  drivers/gpu/drm/xe/xe_sysctrl_types.h     |  23 ++
>  11 files changed, 649 insertions(+)
>  create mode 100644 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
>  create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.c
>  create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.h
>  create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
>  create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
>  create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h
> 
> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> index 2b20c79d7ec9..947fbcac65d5 100644
> --- a/drivers/gpu/drm/xe/Makefile
> +++ b/drivers/gpu/drm/xe/Makefile
> @@ -121,6 +121,8 @@ xe-y += xe_bb.o \
>  	xe_step.o \
>  	xe_survivability_mode.o \
>  	xe_sync.o \
> +	xe_sysctrl.o \
> +	xe_sysctrl_mailbox.o \
>  	xe_tile.o \
>  	xe_tile_sysfs.o \
>  	xe_tlb_inval.o \
> diff --git a/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> new file mode 100644
> index 000000000000..6627a9c32c4f
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_SYSCTRL_REGS_H_
> +#define _XE_SYSCTRL_REGS_H_
> +
> +#include "xe_regs.h"
> +
> +#define SYSCTRL_BASE_OFFSET		0xDB000
> +#define SYSCTRL_BASE			(SOC_BASE + SYSCTRL_BASE_OFFSET)
> +#define SYSCTRL_MAILBOX_INDEX		0x03
> +#define SC_BAR_LENGTH			0x1000
> +
> +#define SC_MB_CTRL			XE_REG(SYSCTRL_BASE + 0x10)
> +#define   SC_MB_CTRL_RUN_BUSY		REG_BIT(31)
> +#define   SC_MB_CTRL_IRQ		REG_BIT(30)
> +#define   SC_MB_CTRL_RUN_BUSY_OUT	REG_BIT(29)
> +#define   SC_MB_CTRL_PARAM3_MASK	REG_GENMASK(28, 24)
> +#define   SC_MB_CTRL_PARAM2_MASK	REG_GENMASK(23, 16)
> +#define   SC_MB_CTRL_PARAM1_MASK	REG_GENMASK(15, 8)
> +#define   SC_MB_CTRL_COMMAND_MASK	REG_GENMASK(7, 0)
> +
> +#define SC_MB_DATA0			XE_REG(SYSCTRL_BASE + 0x14)
> +#define SC_MB_DATA1			XE_REG(SYSCTRL_BASE + 0x18)
> +#define SC_MB_DATA2			XE_REG(SYSCTRL_BASE + 0x1C)
> +#define SC_MB_DATA3			XE_REG(SYSCTRL_BASE + 0x20)
> +
> +#define MKHI_FRAME_PHASE		REG_BIT(24)
> +#define MKHI_FRAME_CURRENT_MASK		REG_GENMASK(21, 16)
> +#define MKHI_FRAME_TOTAL_MASK		REG_GENMASK(13, 8)
> +#define MKHI_FRAME_COMMAND_MASK		REG_GENMASK(7, 0)
> +
> +#define SC_MB_FRAME_SIZE		16
> +#define SC_MB_MAX_FRAMES		64
> +#define SC_MB_MAX_MESSAGE_SIZE		(SC_MB_FRAME_SIZE * SC_MB_MAX_FRAMES)
> +#define SC_MKHI_COMMAND			5
> +
> +#define SC_MB_DEFAULT_TIMEOUT_MS	500
> +#define SC_MB_RETRY_TIMEOUT_MS		20
> +#define SC_MB_POLL_INTERVAL_US		100
> +
> +#endif /* _XE_SYSCTRL_REGS_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index e101d290b2a6..805d48dd954d 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -66,6 +66,7 @@
>  #include "xe_survivability_mode.h"
>  #include "xe_sriov.h"
>  #include "xe_svm.h"
> +#include "xe_sysctrl.h"
>  #include "xe_tile.h"
>  #include "xe_ttm_stolen_mgr.h"
>  #include "xe_ttm_sys_mgr.h"
> @@ -1032,6 +1033,10 @@ int xe_device_probe(struct xe_device *xe)
>  	if (err)
>  		goto err_unregister_display;
>  
> +	err = xe_sysctrl_init(xe);
> +	if (err)
> +		goto err_unregister_display;
> +
>  	err = xe_device_sysfs_init(xe);
>  	if (err)
>  		goto err_unregister_display;
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index a85be9ba175e..6295b2c35d4a 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -29,6 +29,7 @@
>  #include "xe_sriov_vf_ccs_types.h"
>  #include "xe_step_types.h"
>  #include "xe_survivability_mode_types.h"
> +#include "xe_sysctrl_types.h"
>  #include "xe_tile_sriov_vf_types.h"
>  #include "xe_validation.h"
>  
> @@ -340,6 +341,8 @@ struct xe_device {
>  		u8 has_soc_remapper_telem:1;
>  		/** @info.has_sriov: Supports SR-IOV */
>  		u8 has_sriov:1;
> +		/** @info.has_sysctrl: Supports System Controller */
> +		u8 has_sysctrl:1;
>  		/** @info.has_usm: Device has unified shared memory support */
>  		u8 has_usm:1;
>  		/** @info.has_64bit_timestamp: Device supports 64-bit timestamps */
> @@ -606,6 +609,9 @@ struct xe_device {
>  	/** @heci_gsc: graphics security controller */
>  	struct xe_heci_gsc heci_gsc;
>  
> +	/** @sc: System Controller */
> +	struct xe_sysctrl sc;
> +
>  	/** @nvm: discrete graphics non-volatile memory */
>  	struct intel_dg_nvm_dev *nvm;
>  
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 91e0553a8163..b6dc3030b673 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -426,6 +426,7 @@ static const struct xe_device_desc cri_desc = {
>  	.has_soc_remapper_sysctrl = true,
>  	.has_soc_remapper_telem = true,
>  	.has_sriov = true,
> +	.has_sysctrl = true,
>  	.max_gt_per_tile = 2,
>  	.require_force_probe = true,
>  	.va_bits = 57,
> @@ -701,6 +702,7 @@ static int xe_info_init_early(struct xe_device *xe,
>  	xe->info.has_soc_remapper_telem = desc->has_soc_remapper_telem;
>  	xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
>  		desc->has_sriov;
> +	xe->info.has_sysctrl = desc->has_sysctrl;
>  	xe->info.has_mem_copy_instr = desc->has_mem_copy_instr;
>  	xe->info.skip_guc_pc = desc->skip_guc_pc;
>  	xe->info.skip_mtcfg = desc->skip_mtcfg;
> diff --git a/drivers/gpu/drm/xe/xe_pci_types.h b/drivers/gpu/drm/xe/xe_pci_types.h
> index 5f20f56571d1..53e44a32883d 100644
> --- a/drivers/gpu/drm/xe/xe_pci_types.h
> +++ b/drivers/gpu/drm/xe/xe_pci_types.h
> @@ -56,6 +56,7 @@ struct xe_device_desc {
>  	u8 has_soc_remapper_sysctrl:1;
>  	u8 has_soc_remapper_telem:1;
>  	u8 has_sriov:1;
> +	u8 has_sysctrl:1;
>  	u8 needs_scratch:1;
>  	u8 skip_guc_pc:1;
>  	u8 skip_mtcfg:1;
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl.c b/drivers/gpu/drm/xe/xe_sysctrl.c
> new file mode 100644
> index 000000000000..e0e7b0ecf2bf
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl.c
> @@ -0,0 +1,62 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#include <drm/drm_managed.h>
> +#include <linux/device.h>
> +#include <linux/mutex.h>
> +
> +#include "regs/xe_sysctrl_regs.h"
> +#include "xe_device.h"
> +#include "xe_printk.h"
> +#include "xe_soc_remapper.h"
> +#include "xe_sysctrl.h"
> +#include "xe_sysctrl_mailbox.h"
> +#include "xe_sysctrl_types.h"
> +
> +static void xe_sysctrl_fini(void *arg)
> +{
> +	struct xe_sysctrl *sc = arg;
> +	struct xe_device *xe = sc_to_xe(sc);
> +
> +	if (!xe->soc_remapper.set_sysctrl_region)
> +		return;
> +
> +	xe->soc_remapper.set_sysctrl_region(xe, 0);
> +}
> +
> +/**
> + * xe_sysctrl_init - Initialize SC subsystem
> + * @xe: xe device instance
> + *
> + * Entry point for SC initialization, called from xe_device_probe().
> + * This function checks platform support and initializes the system controller.
> + *
> + * Return: 0 on success, error code on failure
> + */
> +int xe_sysctrl_init(struct xe_device *xe)
> +{
> +	struct xe_sysctrl *sc = &xe->sc;
> +	int ret;
> +
> +	if (!xe->info.has_sysctrl)
> +		return 0;
> +
> +	ret = devm_add_action_or_reset(xe->drm.dev, xe_sysctrl_fini, sc);
> +	if (ret)
> +		return ret;
> +
> +	if (!xe->soc_remapper.set_sysctrl_region)
> +		return -ENODEV;
> +
> +	xe->soc_remapper.set_sysctrl_region(xe, SYSCTRL_MAILBOX_INDEX);
> +
> +	ret = drmm_mutex_init(&xe->drm, &sc->cmd_lock);
> +	if (ret)
> +		return ret;
> +
> +	xe_sysctrl_mailbox_init(sc);
> +
> +	return 0;
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl.h b/drivers/gpu/drm/xe/xe_sysctrl.h
> new file mode 100644
> index 000000000000..fe90d6577d54
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_SYSCTRL_H_
> +#define _XE_SYSCTRL_H_
> +
> +struct xe_device;
> +
> +static inline struct xe_device *sc_to_xe(struct xe_sysctrl *sc)
> +{
> +	return container_of(sc, struct xe_device, sc);
> +}
> +
> +int xe_sysctrl_init(struct xe_device *xe);
> +
> +#endif /* _XE_SYSCTRL_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> new file mode 100644
> index 000000000000..940ea535da2e
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> @@ -0,0 +1,409 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/errno.h>
> +#include <linux/minmax.h>
> +#include <linux/mutex.h>
> +#include <linux/slab.h>
> +#include <linux/string.h>
> +#include <linux/types.h>
> +
> +#include "regs/xe_sysctrl_regs.h"
> +#include "xe_device.h"
> +#include "xe_mmio.h"
> +#include "xe_pm.h"
> +#include "xe_printk.h"
> +#include "xe_sysctrl.h"
> +#include "xe_sysctrl_mailbox.h"
> +#include "xe_sysctrl_types.h"
> +
> +static bool xe_sysctrl_mailbox_wait_bit_clear(struct xe_sysctrl *sc, u32 bit_mask,
> +					      unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	int ret;
> +
> +	ret = xe_mmio_wait32_not(mmio, SC_MB_CTRL, bit_mask, bit_mask,
> +				 timeout_ms * 1000, NULL, false);
> +
> +	return ret == 0;
> +}
> +
> +static bool xe_sysctrl_mailbox_wait_bit_set(struct xe_sysctrl *sc, u32 bit_mask,
> +					    unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	int ret;
> +
> +	ret = xe_mmio_wait32(mmio, SC_MB_CTRL, bit_mask, bit_mask,
> +			     timeout_ms * 1000, NULL, false);
> +
> +	return ret == 0;
> +}
> +
> +static int xe_sysctrl_mailbox_write_frame(struct xe_sysctrl *sc, const void *frame,
> +					  size_t len)
> +{
> +	static const struct xe_reg regs[] = {
> +		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
> +	};
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
> +	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
> +	u32 i;
> +
> +	memcpy(val, frame, len);
> +
> +	for (i = 0; i < dw; i++)
> +		xe_mmio_write32(mmio, regs[i], val[i]);
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_read_frame(struct xe_sysctrl *sc, void *frame,
> +					 size_t len)
> +{
> +	static const struct xe_reg regs[] = {
> +		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
> +	};
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
> +	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
> +	u32 i;
> +
> +	for (i = 0; i < dw; i++)
> +		val[i] = xe_mmio_read32(mmio, regs[i]);
> +
> +	memcpy(frame, val, len);
> +
> +	return 0;
> +}
> +
> +static void xe_sysctrl_mailbox_clear_response(struct xe_sysctrl *sc)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +
> +	xe_mmio_rmw32(mmio, SC_MB_CTRL, SC_MB_CTRL_RUN_BUSY_OUT, 0);
> +}
> +
> +static int xe_sysctrl_mailbox_prepare_command(struct xe_sysctrl *sc,
> +					      u8 group_id, u8 command,
> +					      const void *data_in, size_t data_in_len,
> +					      u8 **mbox_cmd, size_t *cmd_size)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> +	size_t size;
> +	u8 *buffer;
> +
> +	size = sizeof(*mkhi_hdr) + data_in_len;
> +	if (size > SC_MB_MAX_MESSAGE_SIZE) {
> +		xe_err(xe, "sysctrl: Message too large: %zu bytes\n", size);
> +		return -EINVAL;
> +	}
> +
> +	buffer = kmalloc(size, GFP_KERNEL);
> +	if (!buffer)
> +		return -ENOMEM;
> +
> +	mkhi_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)buffer;
> +	mkhi_hdr->data = cpu_to_le32(FIELD_PREP(MKHI_HDR_GROUP_ID_MASK, group_id) |
> +				     FIELD_PREP(MKHI_HDR_COMMAND_MASK, command & 0x7F) |
> +				     FIELD_PREP(MKHI_HDR_IS_RESPONSE, 0) |
> +				     FIELD_PREP(MKHI_HDR_RESERVED_MASK, 0) |
> +				     FIELD_PREP(MKHI_HDR_RESULT_MASK, 0));
> +
> +	if (data_in && data_in_len)
> +		memcpy(buffer + sizeof(*mkhi_hdr), data_in, data_in_len);
> +
> +	*mbox_cmd = buffer;
> +	*cmd_size = size;
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_send_frames(struct xe_sysctrl *sc, const u8 *mbox_cmd,
> +					  size_t cmd_size, unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 ctrl_reg, total_frames, frame;
> +	size_t bytes_sent, frame_size;
> +
> +	total_frames = DIV_ROUND_UP(cmd_size, SC_MB_FRAME_SIZE);
> +
> +	if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
> +		xe_err(xe, "sysctrl: Mailbox busy\n");
> +		return -EBUSY;
> +	}
> +
> +	sc->phase_bit ^= 1;
> +	bytes_sent = 0;
> +
> +	for (frame = 0; frame < total_frames; frame++) {
> +		frame_size = min(cmd_size - bytes_sent, (size_t)SC_MB_FRAME_SIZE);
> +
> +		if (xe_sysctrl_mailbox_write_frame(sc, mbox_cmd + bytes_sent, frame_size)) {
> +			xe_err(xe, "sysctrl: Failed to write frame %u\n", frame);
> +			sc->phase_bit ^= 1;
> +			return -EIO;
> +		}
> +
> +		ctrl_reg = SC_MB_CTRL_RUN_BUSY |
> +			   FIELD_PREP(MKHI_FRAME_CURRENT_MASK, frame) |
> +			   FIELD_PREP(MKHI_FRAME_TOTAL_MASK, total_frames - 1) |
> +			   FIELD_PREP(MKHI_FRAME_COMMAND_MASK, SC_MKHI_COMMAND) |
> +			   (sc->phase_bit ? MKHI_FRAME_PHASE : 0);
> +
> +		xe_mmio_write32(mmio, SC_MB_CTRL, ctrl_reg);
> +
> +		if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
> +			xe_err(xe, "sysctrl: Frame %u acknowledgment timeout\n", frame);
> +			return -ETIMEDOUT;
> +		}
> +
> +		bytes_sent += frame_size;
> +	}
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_process_first_frame(struct xe_sysctrl *sc,
> +						  const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
> +						  void *out,
> +						  size_t frame_size,
> +						  size_t *payload_bytes)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	u32 frame_data[4];
> +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *resp_hdr;
> +	size_t hdr_size = sizeof(*resp_hdr);
> +	size_t payload_size;
> +	int ret;
> +
> +	ret = xe_sysctrl_mailbox_read_frame(sc, frame_data, frame_size);
> +	if (ret)
> +		return ret;
> +
> +	resp_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)frame_data;
> +
> +	if (!XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(resp_hdr) ||
> +	    XE_SYSCTRL_MKHI_HDR_GROUP_ID(resp_hdr) != XE_SYSCTRL_MKHI_HDR_GROUP_ID(req) ||
> +	    XE_SYSCTRL_MKHI_HDR_COMMAND(resp_hdr) != XE_SYSCTRL_MKHI_HDR_COMMAND(req)) {
> +		xe_err(xe, "SC: Response header mismatch\n");
> +		return -EPROTO;
> +	}
> +
> +	if (XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr) != 0) {
> +		xe_err(xe, "SC: Firmware error: 0x%02lx\n",
> +		       XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr));
> +		return -EIO;
> +	}
> +
> +	payload_size = frame_size - hdr_size;
> +	if (payload_size > 0)
> +		memcpy(out, (u8 *)frame_data + hdr_size, payload_size);
> +
> +	*payload_bytes = payload_size;
> +
> +	xe_sysctrl_mailbox_clear_response(sc);
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_process_frame(struct xe_sysctrl *sc,
> +					    void *out, size_t frame_size,
> +					    unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	int ret;
> +
> +	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
> +		xe_err(xe, "sysctrl: Response frame timeout\n");
> +		return -ETIMEDOUT;
> +	}
> +
> +	ret = xe_sysctrl_mailbox_read_frame(sc, out, frame_size);
> +	if (ret)
> +		return ret;
> +
> +	xe_sysctrl_mailbox_clear_response(sc);
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_receive_frames(struct xe_sysctrl *sc,
> +					     const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
> +					     void *data_out, size_t data_out_len,
> +					     size_t *rdata_len, unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> +	u32 ctrl_reg, total_frames, frame;
> +	size_t hdr_size = sizeof(*mkhi_hdr);
> +	u8 *out = data_out;
> +	size_t received = 0;
> +	size_t frame_size;
> +	int ret = 0;
> +
> +	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
> +		xe_err(xe, "sysctrl: Response frame 0 timeout\n");
> +		return -ETIMEDOUT;
> +	}
> +
> +	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
> +	total_frames = FIELD_GET(MKHI_FRAME_TOTAL_MASK, ctrl_reg) + 1;
> +
> +	if (total_frames == 1)
> +		frame_size = min(hdr_size + data_out_len, (size_t)SC_MB_FRAME_SIZE);
> +	else
> +		frame_size = SC_MB_FRAME_SIZE;
> +
> +	ret = xe_sysctrl_mailbox_process_first_frame(sc, req, out, frame_size, &received);
> +	if (ret)
> +		return ret;
> +
> +	out += received;
> +
> +	for (frame = 1; frame < total_frames; frame++) {
> +		size_t remaining = data_out_len - received;
> +
> +		frame_size = min_t(size_t, remaining, SC_MB_FRAME_SIZE);
> +
> +		ret = xe_sysctrl_mailbox_process_frame(sc, out, frame_size, timeout_ms);
> +		if (ret)
> +			break;
> +
> +		received += frame_size;
> +		out += frame_size;
> +	}
> +
> +	*rdata_len = received;
> +
> +	return ret;
> +}
> +
> +static int xe_sysctrl_mailbox_send_command(struct xe_sysctrl *sc,
> +					   const u8 *mbox_cmd, size_t cmd_size,
> +					   void *data_out, size_t data_out_len,
> +					   size_t *rdata_len, unsigned int timeout_ms)
> +{
> +	const struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> +	size_t received;
> +	int ret;
> +
> +	ret = xe_sysctrl_mailbox_send_frames(sc, mbox_cmd, cmd_size, timeout_ms);
> +	if (ret)
> +		return ret;
> +
> +	if (!data_out || !rdata_len)
> +		return 0;
> +
> +	mkhi_hdr = (const struct xe_sysctrl_mailbox_mkhi_msg_hdr *)mbox_cmd;
> +
> +	ret = xe_sysctrl_mailbox_receive_frames(sc, mkhi_hdr, data_out, data_out_len,
> +						&received, timeout_ms);
> +	if (ret)
> +		return ret;
> +
> +	*rdata_len = received;
> +
> +	return 0;
> +}
> +
> +/**
> + * xe_sysctrl_send_command - Send command to System Controller via mailbox
> + * @handle: XE device handle
> + * @cmd_buffer: Pointer to xe_sysctrl_mailbox_command structure
> + * @rdata_len: Pointer to store actual response data size (can be NULL)
> + *
> + * Send a command to the System Controller using MKHI protocol. Handles
> + * command preparation, fragmentation, transmission, and response reception.
> + *
> + * Return: 0 on success, negative error code on failure
> + */
> +int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len)
> +{
> +	struct xe_device *xe = handle;
> +	struct xe_sysctrl *sc = &xe->sc;
> +	struct xe_sysctrl_mailbox_command *cmd = cmd_buffer;
> +	u8 *mbox_cmd = NULL;
> +	size_t cmd_size = 0;
> +	u8 group_id, command_code;
> +	int ret = 0;
> +
> +	if (!xe) {
> +		pr_err("sysctrl: Invalid device handle\n");
> +		return -EINVAL;
> +	}
> +
> +	if (!cmd) {
> +		xe_err(xe, "sysctrl: Invalid command buffer\n");
> +		return -EINVAL;
> +	}
> +
> +	if (!xe->info.has_sysctrl)
> +		return -ENODEV;
> +
> +	group_id = XE_SYSCTRL_APP_HDR_GROUP_ID(&cmd->header);
> +	command_code = XE_SYSCTRL_APP_HDR_COMMAND(&cmd->header);
> +
> +	if (!cmd->data_in && cmd->data_in_len) {
> +		xe_err(xe, "sysctrl: Invalid input parameters\n");
> +		return -EINVAL;
> +	}
> +
> +	if (!cmd->data_out && cmd->data_out_len) {
> +		xe_err(xe, "sysctrl: Invalid output parameters\n");
> +		return -EINVAL;
> +	}
> +
> +	might_sleep();
> +
> +	ret = xe_sysctrl_mailbox_prepare_command(sc, group_id, command_code,
> +						 cmd->data_in, cmd->data_in_len,
> +						 &mbox_cmd, &cmd_size);
> +	if (ret) {
> +		xe_err(xe, "sysctrl: Failed to prepare command: %d\n", ret);
> +		return ret;
> +	}
> +
> +	guard(xe_pm_runtime)(xe);
> +
> +	guard(mutex)(&sc->cmd_lock);
> +
> +	ret = xe_sysctrl_mailbox_send_command(sc, mbox_cmd, cmd_size,
> +					      cmd->data_out, cmd->data_out_len, rdata_len,
> +					      SC_MB_DEFAULT_TIMEOUT_MS);
> +	if (ret)
> +		xe_err(xe, "sysctrl: Mailbox command failed: %d\n", ret);
> +
> +	kfree(mbox_cmd);
> +
> +	return ret;
> +}
> +
> +/**
> + * xe_sysctrl_mailbox_init - Initialize the System Controller mailbox state
> + * @sc: System controller structure
> + */
> +void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 ctrl_reg;
> +
> +	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
> +	sc->phase_bit = (ctrl_reg & MKHI_FRAME_PHASE) ? 1 : 0;
> +
> +	xe_mmio_rmw32(mmio, SC_MB_CTRL, MKHI_FRAME_PHASE, 0);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> new file mode 100644
> index 000000000000..3e472418ebd0
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> @@ -0,0 +1,77 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef __XE_SYSCTRL_MAILBOX_H__
> +#define __XE_SYSCTRL_MAILBOX_H__
> +
> +#include <linux/bitfield.h>
> +#include <linux/types.h>
> +
> +struct xe_sysctrl;
> +
> +#define MKHI_HDR_GROUP_ID_MASK		GENMASK(7, 0)
> +#define MKHI_HDR_COMMAND_MASK		GENMASK(14, 8)
> +#define MKHI_HDR_IS_RESPONSE		BIT(15)
> +#define MKHI_HDR_RESERVED_MASK		GENMASK(23, 16)
> +#define MKHI_HDR_RESULT_MASK		GENMASK(31, 24)
> +
> +struct xe_sysctrl_mailbox_mkhi_msg_hdr {
> +	__le32 data;
> +} __packed;
> +
> +#define APP_HDR_GROUP_ID_MASK		GENMASK(7, 0)
> +#define APP_HDR_COMMAND_MASK		GENMASK(15, 8)
> +#define APP_HDR_VERSION_MASK		GENMASK(23, 16)
> +#define APP_HDR_RESERVED_MASK		GENMASK(31, 24)
> +
> +struct xe_sysctrl_mailbox_app_msg_hdr {
> +	__le32 data;
> +} __packed;
> +
> +#define XE_SYSCTRL_APP_HDR_GROUP_ID(hdr) \
> +	FIELD_GET(APP_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_APP_HDR_COMMAND(hdr) \
> +	FIELD_GET(APP_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_APP_HDR_VERSION(hdr) \
> +	FIELD_GET(APP_HDR_VERSION_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_GROUP_ID(hdr) \
> +	FIELD_GET(MKHI_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_COMMAND(hdr) \
> +	FIELD_GET(MKHI_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(hdr) \
> +	FIELD_GET(MKHI_HDR_IS_RESPONSE, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_RESULT(hdr) \
> +	FIELD_GET(MKHI_HDR_RESULT_MASK, le32_to_cpu((hdr)->data))
> +
> +/**
> + * struct xe_sysctrl_mailbox_command - System Controller mailbox command structure
> + */
> +struct xe_sysctrl_mailbox_command {
> +	/** @header: Application message header containing command information */
> +	struct xe_sysctrl_mailbox_app_msg_hdr header;
> +
> +	/** @data_in: Pointer to input payload data (can be NULL if no input data) */
> +	void *data_in;
> +
> +	/** @data_in_len: Size of input payload in bytes (0 if no input data) */
> +	size_t data_in_len;
> +
> +	/** @data_out: Pointer to output buffer for response data (can be NULL if no response) */
> +	void *data_out;
> +
> +	/** @data_out_len: Size of output buffer in bytes (0 if no response expected) */
> +	size_t data_out_len;
> +};
> +
> +void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc);
> +int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len);
> +
> +#endif /* __XE_SYSCTRL_MAILBOX_H__ */
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_types.h b/drivers/gpu/drm/xe/xe_sysctrl_types.h
> new file mode 100644
> index 000000000000..88a34967688b
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_types.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_SYSCTRL_TYPES_H_
> +#define _XE_SYSCTRL_TYPES_H_
> +
> +#include <linux/mutex.h>
> +#include <linux/types.h>
> +
> +/**
> + * struct xe_sysctrl - System Controller driver context
> + */
> +struct xe_sysctrl {
> +	/** @cmd_lock: Mutex protecting mailbox command operations */
> +	struct mutex cmd_lock;
> +
> +	/** @phase_bit: MKHI message boundary phase toggle bit */
> +	u32 phase_bit;
> +};
> +
> +#endif /* _XE_SYSCTRL_TYPES_H_ */
> -- 
> 2.43.0
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
  2026-01-02 16:54 ` [PATCH v2 1/1] " Anoop, Vijay
  2026-01-02 23:15   ` Matthew Brost
@ 2026-01-05  6:29   ` Riana Tauro
  2026-01-06 18:37   ` Umesh Nerlige Ramappa
  2 siblings, 0 replies; 8+ messages in thread
From: Riana Tauro @ 2026-01-05  6:29 UTC (permalink / raw)
  To: Anoop, Vijay, intel-xe
  Cc: umesh.nerlige.ramappa, badal.nilawar, rodrigo.vivi,
	aravind.iddamsetty, ravi.kishore.koppuravuri, anshuman.gupta,
	matthew.d.roper, michael.j.ruhl, paul.e.luse, mohamed.mansoor.v,
	kam.nasim

Hi Anoop

On 1/2/2026 10:24 PM, Anoop, Vijay wrote:
> From: Anoop Vijay <anoop.c.vijay@intel.com>
> 
> Add a new system controller (sysctrl) component for Intel Xe3p dGPU
> platforms.
> 
> This component provides the foundational infrastructure for communication
> with the System Controller firmware using MKHI protocol over a mailbox
> interface.
> 
> Key features introduced:
>   - Detection and initialization of System Controller interface on Xe3p
>     dGPU platforms
>   - Mailbox communication with System Controller firmware
>   - Fragmented message transfer for large command payloads
> 
> This implementation establishes the base for future System Controller
> feature enablement and firmware command handling.

Cover letter is not required for a single patch.
Also had version diff so that it's easier for the reviewers to know what 
changed between versions since this is a big patch.

> 
> Signed-off-by: Anoop Vijay <anoop.c.vijay@intel.com>
> ---
>   drivers/gpu/drm/xe/Makefile               |   2 +
>   drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h |  44 +++
>   drivers/gpu/drm/xe/xe_device.c            |   5 +
>   drivers/gpu/drm/xe/xe_device_types.h      |   6 +
>   drivers/gpu/drm/xe/xe_pci.c               |   2 +
>   drivers/gpu/drm/xe/xe_pci_types.h         |   1 +
>   drivers/gpu/drm/xe/xe_sysctrl.c           |  62 ++++
>   drivers/gpu/drm/xe/xe_sysctrl.h           |  18 +
>   drivers/gpu/drm/xe/xe_sysctrl_mailbox.c   | 409 ++++++++++++++++++++++
>   drivers/gpu/drm/xe/xe_sysctrl_mailbox.h   |  77 ++++
>   drivers/gpu/drm/xe/xe_sysctrl_types.h     |  23 ++
>   11 files changed, 649 insertions(+)
>   create mode 100644 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
>   create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.c
>   create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.h
>   create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
>   create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
>   create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h
> 
> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> index 2b20c79d7ec9..947fbcac65d5 100644
> --- a/drivers/gpu/drm/xe/Makefile
> +++ b/drivers/gpu/drm/xe/Makefile
> @@ -121,6 +121,8 @@ xe-y += xe_bb.o \
>   	xe_step.o \
>   	xe_survivability_mode.o \
>   	xe_sync.o \
> +	xe_sysctrl.o \
> +	xe_sysctrl_mailbox.o \
>   	xe_tile.o \
>   	xe_tile_sysfs.o \
>   	xe_tlb_inval.o \
> diff --git a/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> new file mode 100644
> index 000000000000..6627a9c32c4f
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> @@ -0,0 +1,44 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_SYSCTRL_REGS_H_
> +#define _XE_SYSCTRL_REGS_H_
> +
> +#include "xe_regs.h"
> +
> +#define SYSCTRL_BASE_OFFSET		0xDB000
> +#define SYSCTRL_BASE			(SOC_BASE + SYSCTRL_BASE_OFFSET)
> +#define SYSCTRL_MAILBOX_INDEX		0x03
> +#define SC_BAR_LENGTH			0x1000

Maintain consistency. Either SYSCTRL or SC

> +
> +#define SC_MB_CTRL			XE_REG(SYSCTRL_BASE + 0x10)
> +#define   SC_MB_CTRL_RUN_BUSY		REG_BIT(31)
> +#define   SC_MB_CTRL_IRQ		REG_BIT(30)
> +#define   SC_MB_CTRL_RUN_BUSY_OUT	REG_BIT(29)
> +#define   SC_MB_CTRL_PARAM3_MASK	REG_GENMASK(28, 24)
> +#define   SC_MB_CTRL_PARAM2_MASK	REG_GENMASK(23, 16)
> +#define   SC_MB_CTRL_PARAM1_MASK	REG_GENMASK(15, 8)
> +#define   SC_MB_CTRL_COMMAND_MASK	REG_GENMASK(7, 0)
> +
> +#define SC_MB_DATA0			XE_REG(SYSCTRL_BASE + 0x14)
> +#define SC_MB_DATA1			XE_REG(SYSCTRL_BASE + 0x18)
> +#define SC_MB_DATA2			XE_REG(SYSCTRL_BASE + 0x1C)
> +#define SC_MB_DATA3			XE_REG(SYSCTRL_BASE + 0x20)
> +
> +#define MKHI_FRAME_PHASE		REG_BIT(24)
> +#define MKHI_FRAME_CURRENT_MASK		REG_GENMASK(21, 16)
> +#define MKHI_FRAME_TOTAL_MASK		REG_GENMASK(13, 8)
> +#define MKHI_FRAME_COMMAND_MASK		REG_GENMASK(7, 0)
> +
> +#define SC_MB_FRAME_SIZE		16
> +#define SC_MB_MAX_FRAMES		64
> +#define SC_MB_MAX_MESSAGE_SIZE		(SC_MB_FRAME_SIZE * SC_MB_MAX_FRAMES)
> +#define SC_MKHI_COMMAND			5
> +
> +#define SC_MB_DEFAULT_TIMEOUT_MS	500
> +#define SC_MB_RETRY_TIMEOUT_MS		20
> +#define SC_MB_POLL_INTERVAL_US		100
> +
> +#endif /* _XE_SYSCTRL_REGS_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index e101d290b2a6..805d48dd954d 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -66,6 +66,7 @@
>   #include "xe_survivability_mode.h"
>   #include "xe_sriov.h"
>   #include "xe_svm.h"
> +#include "xe_sysctrl.h"
>   #include "xe_tile.h"
>   #include "xe_ttm_stolen_mgr.h"
>   #include "xe_ttm_sys_mgr.h"
> @@ -1032,6 +1033,10 @@ int xe_device_probe(struct xe_device *xe)
>   	if (err)
>   		goto err_unregister_display;
>   
> +	err = xe_sysctrl_init(xe);
> +	if (err)
> +		goto err_unregister_display;
> +
>   	err = xe_device_sysfs_init(xe);
>   	if (err)
>   		goto err_unregister_display;
> diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> index a85be9ba175e..6295b2c35d4a 100644
> --- a/drivers/gpu/drm/xe/xe_device_types.h
> +++ b/drivers/gpu/drm/xe/xe_device_types.h
> @@ -29,6 +29,7 @@
>   #include "xe_sriov_vf_ccs_types.h"
>   #include "xe_step_types.h"
>   #include "xe_survivability_mode_types.h"
> +#include "xe_sysctrl_types.h"
>   #include "xe_tile_sriov_vf_types.h"
>   #include "xe_validation.h"
>   
> @@ -340,6 +341,8 @@ struct xe_device {
>   		u8 has_soc_remapper_telem:1;
>   		/** @info.has_sriov: Supports SR-IOV */
>   		u8 has_sriov:1;
> +		/** @info.has_sysctrl: Supports System Controller */
> +		u8 has_sysctrl:1;
>   		/** @info.has_usm: Device has unified shared memory support */
>   		u8 has_usm:1;
>   		/** @info.has_64bit_timestamp: Device supports 64-bit timestamps */
> @@ -606,6 +609,9 @@ struct xe_device {
>   	/** @heci_gsc: graphics security controller */
>   	struct xe_heci_gsc heci_gsc;
>   
> +	/** @sc: System Controller */
> +	struct xe_sysctrl sc;
> +
>   	/** @nvm: discrete graphics non-volatile memory */
>   	struct intel_dg_nvm_dev *nvm;
>   
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index 91e0553a8163..b6dc3030b673 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -426,6 +426,7 @@ static const struct xe_device_desc cri_desc = {
>   	.has_soc_remapper_sysctrl = true,
>   	.has_soc_remapper_telem = true,
>   	.has_sriov = true,
> +	.has_sysctrl = true,
>   	.max_gt_per_tile = 2,
>   	.require_force_probe = true,
>   	.va_bits = 57,
> @@ -701,6 +702,7 @@ static int xe_info_init_early(struct xe_device *xe,
>   	xe->info.has_soc_remapper_telem = desc->has_soc_remapper_telem;
>   	xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
>   		desc->has_sriov;
> +	xe->info.has_sysctrl = desc->has_sysctrl;
>   	xe->info.has_mem_copy_instr = desc->has_mem_copy_instr;
>   	xe->info.skip_guc_pc = desc->skip_guc_pc;
>   	xe->info.skip_mtcfg = desc->skip_mtcfg;
> diff --git a/drivers/gpu/drm/xe/xe_pci_types.h b/drivers/gpu/drm/xe/xe_pci_types.h
> index 5f20f56571d1..53e44a32883d 100644
> --- a/drivers/gpu/drm/xe/xe_pci_types.h
> +++ b/drivers/gpu/drm/xe/xe_pci_types.h
> @@ -56,6 +56,7 @@ struct xe_device_desc {
>   	u8 has_soc_remapper_sysctrl:1;
>   	u8 has_soc_remapper_telem:1;
>   	u8 has_sriov:1;
> +	u8 has_sysctrl:1;
>   	u8 needs_scratch:1;
>   	u8 skip_guc_pc:1;
>   	u8 skip_mtcfg:1;
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl.c b/drivers/gpu/drm/xe/xe_sysctrl.c
> new file mode 100644
> index 000000000000..e0e7b0ecf2bf
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl.c
> @@ -0,0 +1,62 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#include <drm/drm_managed.h>
> +#include <linux/device.h>
> +#include <linux/mutex.h>
> +
> +#include "regs/xe_sysctrl_regs.h"
> +#include "xe_device.h"
> +#include "xe_printk.h"
> +#include "xe_soc_remapper.h"
> +#include "xe_sysctrl.h"
> +#include "xe_sysctrl_mailbox.h"
> +#include "xe_sysctrl_types.h"

A short documentation of System controller would be helpful here.

> +
> +static void xe_sysctrl_fini(void *arg)
> +{
> +	struct xe_sysctrl *sc = arg;
> +	struct xe_device *xe = sc_to_xe(sc);
> +
> +	if (!xe->soc_remapper.set_sysctrl_region)
> +		return;
 > +> +	xe->soc_remapper.set_sysctrl_region(xe, 0);
> +}
> +
> +/**
> + * xe_sysctrl_init - Initialize SC subsystem
> + * @xe: xe device instance
> + *
> + * Entry point for SC initialization, called from xe_device_probe().
> + * This function checks platform support and initializes the system controller.
> + *
> + * Return: 0 on success, error code on failure
> + */
> +int xe_sysctrl_init(struct xe_device *xe)
> +{
> +	struct xe_sysctrl *sc = &xe->sc;
> +	int ret;
> +
> +	if (!xe->info.has_sysctrl)
> +		return 0;
> +
> +	ret = devm_add_action_or_reset(xe->drm.dev, xe_sysctrl_fini, sc);

Add this after set_sysctrl region.

> +	if (ret)
> +		return ret;
> +
> +	if (!xe->soc_remapper.set_sysctrl_region)
> +		return -ENODEV;
> +
> +	xe->soc_remapper.set_sysctrl_region(xe, SYSCTRL_MAILBOX_INDEX
> +
> +	ret = drmm_mutex_init(&xe->drm, &sc->cmd_lock);
> +	if (ret)
> +		return ret;
> +
> +	xe_sysctrl_mailbox_init(sc);
> +
> +	return 0;
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl.h b/drivers/gpu/drm/xe/xe_sysctrl.h
> new file mode 100644
> index 000000000000..fe90d6577d54
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl.h
> @@ -0,0 +1,18 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_SYSCTRL_H_
> +#define _XE_SYSCTRL_H_
> +
> +struct xe_device;
> +
> +static inline struct xe_device *sc_to_xe(struct xe_sysctrl *sc)
> +{
> +	return container_of(sc, struct xe_device, sc);
> +}
> +
> +int xe_sysctrl_init(struct xe_device *xe);
> +
> +#endif /* _XE_SYSCTRL_H_ */
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> new file mode 100644
> index 000000000000..940ea535da2e
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> @@ -0,0 +1,409 @@
> +// SPDX-License-Identifier: MIT
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#include <linux/bitfield.h>
> +#include <linux/errno.h>
> +#include <linux/minmax.h>
> +#include <linux/mutex.h>
> +#include <linux/slab.h>
> +#include <linux/string.h>
> +#include <linux/types.h>
> +
> +#include "regs/xe_sysctrl_regs.h"
> +#include "xe_device.h"
> +#include "xe_mmio.h"
> +#include "xe_pm.h"
> +#include "xe_printk.h"
> +#include "xe_sysctrl.h"
> +#include "xe_sysctrl_mailbox.h"
> +#include "xe_sysctrl_types.h"
> +
> +static bool xe_sysctrl_mailbox_wait_bit_clear(struct xe_sysctrl *sc, u32 bit_mask,
> +					      unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	int ret;
> +
> +	ret = xe_mmio_wait32_not(mmio, SC_MB_CTRL, bit_mask, bit_mask,
> +				 timeout_ms * 1000, NULL, false);
> +
> +	return ret == 0;
> +}
> +
> +static bool xe_sysctrl_mailbox_wait_bit_set(struct xe_sysctrl *sc, u32 bit_mask,
> +					    unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	int ret;
> +
> +	ret = xe_mmio_wait32(mmio, SC_MB_CTRL, bit_mask, bit_mask,
> +			     timeout_ms * 1000, NULL, false);
> +
> +	return ret == 0;
> +}
> +
> +static int xe_sysctrl_mailbox_write_frame(struct xe_sysctrl *sc, const void *frame,
> +					  size_t len)
> +{
> +	static const struct xe_reg regs[] = {
> +		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
> +	};
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
> +	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
> +	u32 i;
> +
> +	memcpy(val, frame, len);
> +
> +	for (i = 0; i < dw; i++)
> +		xe_mmio_write32(mmio, regs[i], val[i]);
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_read_frame(struct xe_sysctrl *sc, void *frame,
> +					 size_t len)
> +{
> +	static const struct xe_reg regs[] = {
> +		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
> +	};
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
> +	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
> +	u32 i;
> +
> +	for (i = 0; i < dw; i++)
> +		val[i] = xe_mmio_read32(mmio, regs[i]);
> +
> +	memcpy(frame, val, len);
> +
> +	return 0;
> +}
> +
> +static void xe_sysctrl_mailbox_clear_response(struct xe_sysctrl *sc)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +
> +	xe_mmio_rmw32(mmio, SC_MB_CTRL, SC_MB_CTRL_RUN_BUSY_OUT, 0);
> +}
> +
> +static int xe_sysctrl_mailbox_prepare_command(struct xe_sysctrl *sc,
> +					      u8 group_id, u8 command,
> +					      const void *data_in, size_t data_in_len,
> +					      u8 **mbox_cmd, size_t *cmd_size)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> +	size_t size;
> +	u8 *buffer;
> +
> +	size = sizeof(*mkhi_hdr) + data_in_len;
> +	if (size > SC_MB_MAX_MESSAGE_SIZE) {
> +		xe_err(xe, "sysctrl: Message too large: %zu bytes\n", size);
> +		return -EINVAL;
> +	}
> +
> +	buffer = kmalloc(size, GFP_KERNEL);
> +	if (!buffer)
> +		return -ENOMEM;
> +
> +	mkhi_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)buffer;
> +	mkhi_hdr->data = cpu_to_le32(FIELD_PREP(MKHI_HDR_GROUP_ID_MASK, group_id) |
> +				     FIELD_PREP(MKHI_HDR_COMMAND_MASK, command & 0x7F) |
> +				     FIELD_PREP(MKHI_HDR_IS_RESPONSE, 0) |
> +				     FIELD_PREP(MKHI_HDR_RESERVED_MASK, 0) |
> +				     FIELD_PREP(MKHI_HDR_RESULT_MASK, 0));
> +
> +	if (data_in && data_in_len)
> +		memcpy(buffer + sizeof(*mkhi_hdr), data_in, data_in_len);
> +
> +	*mbox_cmd = buffer;
> +	*cmd_size = size;
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_send_frames(struct xe_sysctrl *sc, const u8 *mbox_cmd,
> +					  size_t cmd_size, unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 ctrl_reg, total_frames, frame;
> +	size_t bytes_sent, frame_size;
> +
> +	total_frames = DIV_ROUND_UP(cmd_size, SC_MB_FRAME_SIZE);
> +
> +	if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
> +		xe_err(xe, "sysctrl: Mailbox busy\n");
> +		return -EBUSY;
> +	}
> +
> +	sc->phase_bit ^= 1;
> +	bytes_sent = 0;
> +
> +	for (frame = 0; frame < total_frames; frame++) {
> +		frame_size = min(cmd_size - bytes_sent, (size_t)SC_MB_FRAME_SIZE);
> +
> +		if (xe_sysctrl_mailbox_write_frame(sc, mbox_cmd + bytes_sent, frame_size)) {
> +			xe_err(xe, "sysctrl: Failed to write frame %u\n", frame);
> +			sc->phase_bit ^= 1;
> +			return -EIO;
> +		}
> +
> +		ctrl_reg = SC_MB_CTRL_RUN_BUSY |
> +			   FIELD_PREP(MKHI_FRAME_CURRENT_MASK, frame) |
> +			   FIELD_PREP(MKHI_FRAME_TOTAL_MASK, total_frames - 1) |
> +			   FIELD_PREP(MKHI_FRAME_COMMAND_MASK, SC_MKHI_COMMAND) |
> +			   (sc->phase_bit ? MKHI_FRAME_PHASE : 0);
> +
> +		xe_mmio_write32(mmio, SC_MB_CTRL, ctrl_reg);
> +
> +		if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
> +			xe_err(xe, "sysctrl: Frame %u acknowledgment timeout\n", frame);
> +			return -ETIMEDOUT;
> +		}
> +
> +		bytes_sent += frame_size;
> +	}
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_process_first_frame(struct xe_sysctrl *sc,
> +						  const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
> +						  void *out,
> +						  size_t frame_size,
> +						  size_t *payload_bytes)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	u32 frame_data[4];
> +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *resp_hdr;
> +	size_t hdr_size = sizeof(*resp_hdr);
> +	size_t payload_size;
> +	int ret;
> +
> +	ret = xe_sysctrl_mailbox_read_frame(sc, frame_data, frame_size);
> +	if (ret)
> +		return ret;
> +
> +	resp_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)frame_data;
> +
> +	if (!XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(resp_hdr) ||
> +	    XE_SYSCTRL_MKHI_HDR_GROUP_ID(resp_hdr) != XE_SYSCTRL_MKHI_HDR_GROUP_ID(req) ||
> +	    XE_SYSCTRL_MKHI_HDR_COMMAND(resp_hdr) != XE_SYSCTRL_MKHI_HDR_COMMAND(req)) {
> +		xe_err(xe, "SC: Response header mismatch\n");
> +		return -EPROTO;
> +	}
> +
> +	if (XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr) != 0) {
> +		xe_err(xe, "SC: Firmware error: 0x%02lx\n",
> +		       XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr));
> +		return -EIO;
> +	}
> +
> +	payload_size = frame_size - hdr_size;
> +	if (payload_size > 0)
> +		memcpy(out, (u8 *)frame_data + hdr_size, payload_size);
> +
> +	*payload_bytes = payload_size;
> +
> +	xe_sysctrl_mailbox_clear_response(sc);
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_process_frame(struct xe_sysctrl *sc,
> +					    void *out, size_t frame_size,
> +					    unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	int ret;
> +
> +	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
> +		xe_err(xe, "sysctrl: Response frame timeout\n");
> +		return -ETIMEDOUT;
> +	}
> +
> +	ret = xe_sysctrl_mailbox_read_frame(sc, out, frame_size);
> +	if (ret)
> +		return ret;
> +
> +	xe_sysctrl_mailbox_clear_response(sc);
> +
> +	return 0;
> +}
> +
> +static int xe_sysctrl_mailbox_receive_frames(struct xe_sysctrl *sc,
> +					     const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
> +					     void *data_out, size_t data_out_len,
> +					     size_t *rdata_len, unsigned int timeout_ms)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> +	u32 ctrl_reg, total_frames, frame;
> +	size_t hdr_size = sizeof(*mkhi_hdr);
> +	u8 *out = data_out;
> +	size_t received = 0;
> +	size_t frame_size;
> +	int ret = 0;
> +
> +	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
> +		xe_err(xe, "sysctrl: Response frame 0 timeout\n");
> +		return -ETIMEDOUT;
> +	}
> +
> +	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
> +	total_frames = FIELD_GET(MKHI_FRAME_TOTAL_MASK, ctrl_reg) + 1;
> +
> +	if (total_frames == 1)
> +		frame_size = min(hdr_size + data_out_len, (size_t)SC_MB_FRAME_SIZE);
> +	else
> +		frame_size = SC_MB_FRAME_SIZE;
> +
> +	ret = xe_sysctrl_mailbox_process_first_frame(sc, req, out, frame_size, &received);
> +	if (ret)
> +		return ret;
> +
> +	out += received;
> +
> +	for (frame = 1; frame < total_frames; frame++) {
> +		size_t remaining = data_out_len - received;
> +
> +		frame_size = min_t(size_t, remaining, SC_MB_FRAME_SIZE);
> +
> +		ret = xe_sysctrl_mailbox_process_frame(sc, out, frame_size, timeout_ms);
> +		if (ret)
> +			break;
> +
> +		received += frame_size;
> +		out += frame_size;
> +	}
> +
> +	*rdata_len = received;
> +
> +	return ret;
> +}
> +
> +static int xe_sysctrl_mailbox_send_command(struct xe_sysctrl *sc,
> +					   const u8 *mbox_cmd, size_t cmd_size,
> +					   void *data_out, size_t data_out_len,
> +					   size_t *rdata_len, unsigned int timeout_ms)
> +{
> +	const struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> +	size_t received;
> +	int ret;
> +
> +	ret = xe_sysctrl_mailbox_send_frames(sc, mbox_cmd, cmd_size, timeout_ms);
> +	if (ret)
> +		return ret;
> +
> +	if (!data_out || !rdata_len)
> +		return 0;
> +
> +	mkhi_hdr = (const struct xe_sysctrl_mailbox_mkhi_msg_hdr *)mbox_cmd;
> +
> +	ret = xe_sysctrl_mailbox_receive_frames(sc, mkhi_hdr, data_out, data_out_len,
> +						&received, timeout_ms);
> +	if (ret)
> +		return ret;
> +
> +	*rdata_len = received;
> +
> +	return 0;
> +}
> +
> +/**
> + * xe_sysctrl_send_command - Send command to System Controller via mailbox
> + * @handle: XE device handle
> + * @cmd_buffer: Pointer to xe_sysctrl_mailbox_command structure
> + * @rdata_len: Pointer to store actual response data size (can be NULL)
> + *
> + * Send a command to the System Controller using MKHI protocol. Handles
> + * command preparation, fragmentation, transmission, and response reception.
> + *
> + * Return: 0 on success, negative error code on failure
> + */
> +int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len)
> +{
> +	struct xe_device *xe = handle;
> +	struct xe_sysctrl *sc = &xe->sc;
> +	struct xe_sysctrl_mailbox_command *cmd = cmd_buffer;
> +	u8 *mbox_cmd = NULL;
> +	size_t cmd_size = 0;
> +	u8 group_id, command_code;
> +	int ret = 0;
> +
> +	if (!xe) {
> +		pr_err("sysctrl: Invalid device handle\n");
> +		return -EINVAL;
> +	}
> +
> +	if (!cmd) {
> +		xe_err(xe, "sysctrl: Invalid command buffer\n");
> +		return -EINVAL;
> +	}
> +
> +	if (!xe->info.has_sysctrl)
> +		return -ENODEV;
> +
> +	group_id = XE_SYSCTRL_APP_HDR_GROUP_ID(&cmd->header);
> +	command_code = XE_SYSCTRL_APP_HDR_COMMAND(&cmd->header);
> +
> +	if (!cmd->data_in && cmd->data_in_len) {
> +		xe_err(xe, "sysctrl: Invalid input parameters\n");
> +		return -EINVAL;
> +	}
> +
> +	if (!cmd->data_out && cmd->data_out_len) {
> +		xe_err(xe, "sysctrl: Invalid output parameters\n");
> +		return -EINVAL;
> +	}
> +
> +	might_sleep();
> +
> +	ret = xe_sysctrl_mailbox_prepare_command(sc, group_id, command_code,
> +						 cmd->data_in, cmd->data_in_len,
> +						 &mbox_cmd, &cmd_size);
> +	if (ret) {
> +		xe_err(xe, "sysctrl: Failed to prepare command: %d\n", ret);
> +		return ret;
> +	}
> +
> +	guard(xe_pm_runtime)(xe);
> +
> +	guard(mutex)(&sc->cmd_lock);
> +
> +	ret = xe_sysctrl_mailbox_send_command(sc, mbox_cmd, cmd_size,
> +					      cmd->data_out, cmd->data_out_len, rdata_len,
> +					      SC_MB_DEFAULT_TIMEOUT_MS);
> +	if (ret)
> +		xe_err(xe, "sysctrl: Mailbox command failed: %d\n", ret);
> +
> +	kfree(mbox_cmd);
> +
> +	return ret;
> +}
> +
> +/**
> + * xe_sysctrl_mailbox_init - Initialize the System Controller mailbox state
> + * @sc: System controller structure
> + */

Missing description https://docs.kernel.org/doc-guide/kernel-doc.html

> +void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc)
> +{
> +	struct xe_device *xe = sc_to_xe(sc);
> +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +	u32 ctrl_reg;
> +
> +	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
> +	sc->phase_bit = (ctrl_reg & MKHI_FRAME_PHASE) ? 1 : 0;
> +
> +	xe_mmio_rmw32(mmio, SC_MB_CTRL, MKHI_FRAME_PHASE, 0);
> +}
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> new file mode 100644
> index 000000000000..3e472418ebd0
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> @@ -0,0 +1,77 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef __XE_SYSCTRL_MAILBOX_H__
> +#define __XE_SYSCTRL_MAILBOX_H__
> +
> +#include <linux/bitfield.h>
> +#include <linux/types.h>
> +
> +struct xe_sysctrl;
> +
> +#define MKHI_HDR_GROUP_ID_MASK		GENMASK(7, 0)
> +#define MKHI_HDR_COMMAND_MASK		GENMASK(14, 8)
> +#define MKHI_HDR_IS_RESPONSE		BIT(15)
> +#define MKHI_HDR_RESERVED_MASK		GENMASK(23, 16)
> +#define MKHI_HDR_RESULT_MASK		GENMASK(31, 24)
> +
> +struct xe_sysctrl_mailbox_mkhi_msg_hdr {
> +	__le32 data;
> +} __packed;
> +
> +#define APP_HDR_GROUP_ID_MASK		GENMASK(7, 0)
> +#define APP_HDR_COMMAND_MASK		GENMASK(15, 8)
> +#define APP_HDR_VERSION_MASK		GENMASK(23, 16)
> +#define APP_HDR_RESERVED_MASK		GENMASK(31, 24)
> +
> +struct xe_sysctrl_mailbox_app_msg_hdr {
> +	__le32 data;
> +} __packed;
> +
> +#define XE_SYSCTRL_APP_HDR_GROUP_ID(hdr) \
> +	FIELD_GET(APP_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_APP_HDR_COMMAND(hdr) \
> +	FIELD_GET(APP_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_APP_HDR_VERSION(hdr) \
> +	FIELD_GET(APP_HDR_VERSION_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_GROUP_ID(hdr) \
> +	FIELD_GET(MKHI_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_COMMAND(hdr) \
> +	FIELD_GET(MKHI_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(hdr) \
> +	FIELD_GET(MKHI_HDR_IS_RESPONSE, le32_to_cpu((hdr)->data))
> +
> +#define XE_SYSCTRL_MKHI_HDR_RESULT(hdr) \
> +	FIELD_GET(MKHI_HDR_RESULT_MASK, le32_to_cpu((hdr)->data))
> +
> +/**
> + * struct xe_sysctrl_mailbox_command - System Controller mailbox command structure
> + */
> +struct xe_sysctrl_mailbox_command {
> +	/** @header: Application message header containing command information */
> +	struct xe_sysctrl_mailbox_app_msg_hdr header;
> +
> +	/** @data_in: Pointer to input payload data (can be NULL if no input data) */
> +	void *data_in;
> +
> +	/** @data_in_len: Size of input payload in bytes (0 if no input data) */
> +	size_t data_in_len;
> +
> +	/** @data_out: Pointer to output buffer for response data (can be NULL if no response) */
> +	void *data_out;
> +
> +	/** @data_out_len: Size of output buffer in bytes (0 if no response expected) */
> +	size_t data_out_len;
> +};

structures are defined in _types.h

Thanks
Riana

> +
> +void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc);
> +int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len);
> +
> +#endif /* __XE_SYSCTRL_MAILBOX_H__ */
> diff --git a/drivers/gpu/drm/xe/xe_sysctrl_types.h b/drivers/gpu/drm/xe/xe_sysctrl_types.h
> new file mode 100644
> index 000000000000..88a34967688b
> --- /dev/null
> +++ b/drivers/gpu/drm/xe/xe_sysctrl_types.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: MIT */
> +/*
> + * Copyright © 2026 Intel Corporation
> + */
> +
> +#ifndef _XE_SYSCTRL_TYPES_H_
> +#define _XE_SYSCTRL_TYPES_H_
> +
> +#include <linux/mutex.h>
> +#include <linux/types.h>
> +
> +/**
> + * struct xe_sysctrl - System Controller driver context
> + */
> +struct xe_sysctrl {
> +	/** @cmd_lock: Mutex protecting mailbox command operations */
> +	struct mutex cmd_lock;
> +
> +	/** @phase_bit: MKHI message boundary phase toggle bit */
> +	u32 phase_bit;
> +};
> +
> +#endif /* _XE_SYSCTRL_TYPES_H_ */


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
  2026-01-02 16:54 ` [PATCH v2 1/1] " Anoop, Vijay
  2026-01-02 23:15   ` Matthew Brost
  2026-01-05  6:29   ` Riana Tauro
@ 2026-01-06 18:37   ` Umesh Nerlige Ramappa
  2026-01-07  1:24     ` Matthew Brost
  2 siblings, 1 reply; 8+ messages in thread
From: Umesh Nerlige Ramappa @ 2026-01-06 18:37 UTC (permalink / raw)
  To: Anoop, Vijay
  Cc: intel-xe, badal.nilawar, rodrigo.vivi, aravind.iddamsetty,
	riana.tauro, ravi.kishore.koppuravuri, anshuman.gupta,
	matthew.d.roper, michael.j.ruhl, paul.e.luse, mohamed.mansoor.v,
	kam.nasim

Hi Anoop,

Thanks for incorporating most of the comments here. I have a few more in 
this revision.

On Fri, Jan 02, 2026 at 08:54:50AM -0800, Anoop, Vijay wrote:
>From: Anoop Vijay <anoop.c.vijay@intel.com>
>
>Add a new system controller (sysctrl) component for Intel Xe3p dGPU
>platforms.
>
>This component provides the foundational infrastructure for communication
>with the System Controller firmware using MKHI protocol over a mailbox
>interface.
>
>Key features introduced:
> - Detection and initialization of System Controller interface on Xe3p
>   dGPU platforms
> - Mailbox communication with System Controller firmware
> - Fragmented message transfer for large command payloads

Let's break down the patches as Matt suggested.

>
>This implementation establishes the base for future System Controller
>feature enablement and firmware command handling.
>
>Signed-off-by: Anoop Vijay <anoop.c.vijay@intel.com>
>---
> drivers/gpu/drm/xe/Makefile               |   2 +
> drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h |  44 +++
> drivers/gpu/drm/xe/xe_device.c            |   5 +
> drivers/gpu/drm/xe/xe_device_types.h      |   6 +
> drivers/gpu/drm/xe/xe_pci.c               |   2 +
> drivers/gpu/drm/xe/xe_pci_types.h         |   1 +
> drivers/gpu/drm/xe/xe_sysctrl.c           |  62 ++++
> drivers/gpu/drm/xe/xe_sysctrl.h           |  18 +
> drivers/gpu/drm/xe/xe_sysctrl_mailbox.c   | 409 ++++++++++++++++++++++
> drivers/gpu/drm/xe/xe_sysctrl_mailbox.h   |  77 ++++
> drivers/gpu/drm/xe/xe_sysctrl_types.h     |  23 ++
> 11 files changed, 649 insertions(+)
> create mode 100644 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.c
> create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.h
> create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h
>
>diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
>index 2b20c79d7ec9..947fbcac65d5 100644
>--- a/drivers/gpu/drm/xe/Makefile
>+++ b/drivers/gpu/drm/xe/Makefile
>@@ -121,6 +121,8 @@ xe-y += xe_bb.o \
> 	xe_step.o \
> 	xe_survivability_mode.o \
> 	xe_sync.o \
>+	xe_sysctrl.o \
>+	xe_sysctrl_mailbox.o \
> 	xe_tile.o \
> 	xe_tile_sysfs.o \
> 	xe_tlb_inval.o \
>diff --git a/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
>new file mode 100644
>index 000000000000..6627a9c32c4f
>--- /dev/null
>+++ b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
>@@ -0,0 +1,44 @@
>+/* SPDX-License-Identifier: MIT */
>+/*
>+ * Copyright © 2026 Intel Corporation
>+ */
>+
>+#ifndef _XE_SYSCTRL_REGS_H_
>+#define _XE_SYSCTRL_REGS_H_
>+
>+#include "xe_regs.h"
>+
>+#define SYSCTRL_BASE_OFFSET		0xDB000
>+#define SYSCTRL_BASE			(SOC_BASE + SYSCTRL_BASE_OFFSET)
>+#define SYSCTRL_MAILBOX_INDEX		0x03
>+#define SC_BAR_LENGTH			0x1000
>+
>+#define SC_MB_CTRL			XE_REG(SYSCTRL_BASE + 0x10)
>+#define   SC_MB_CTRL_RUN_BUSY		REG_BIT(31)
>+#define   SC_MB_CTRL_IRQ		REG_BIT(30)
>+#define   SC_MB_CTRL_RUN_BUSY_OUT	REG_BIT(29)
>+#define   SC_MB_CTRL_PARAM3_MASK	REG_GENMASK(28, 24)
>+#define   SC_MB_CTRL_PARAM2_MASK	REG_GENMASK(23, 16)
>+#define   SC_MB_CTRL_PARAM1_MASK	REG_GENMASK(15, 8)
>+#define   SC_MB_CTRL_COMMAND_MASK	REG_GENMASK(7, 0)
>+
>+#define SC_MB_DATA0			XE_REG(SYSCTRL_BASE + 0x14)
>+#define SC_MB_DATA1			XE_REG(SYSCTRL_BASE + 0x18)
>+#define SC_MB_DATA2			XE_REG(SYSCTRL_BASE + 0x1C)
>+#define SC_MB_DATA3			XE_REG(SYSCTRL_BASE + 0x20)
>+
>+#define MKHI_FRAME_PHASE		REG_BIT(24)
>+#define MKHI_FRAME_CURRENT_MASK		REG_GENMASK(21, 16)
>+#define MKHI_FRAME_TOTAL_MASK		REG_GENMASK(13, 8)
>+#define MKHI_FRAME_COMMAND_MASK		REG_GENMASK(7, 0)
>+
>+#define SC_MB_FRAME_SIZE		16
>+#define SC_MB_MAX_FRAMES		64
>+#define SC_MB_MAX_MESSAGE_SIZE		(SC_MB_FRAME_SIZE * SC_MB_MAX_FRAMES)
>+#define SC_MKHI_COMMAND			5
>+
>+#define SC_MB_DEFAULT_TIMEOUT_MS	500
>+#define SC_MB_RETRY_TIMEOUT_MS		20
>+#define SC_MB_POLL_INTERVAL_US		100

1)
I missed this the last time. Can we change SC to SYSCTRL here for 
everything? I see that for the mailbox, you are using SC_MB, but at the end 
of the day SC still means SYSCTRL and consistently using the same name helps 
readability.

2)
The MKHI_FRAME definitions can move to the xe_sysctrl_mailbox.c since that's 
the only code accessing it. See more comments below.


>+
>+#endif /* _XE_SYSCTRL_REGS_H_ */
>diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
>index e101d290b2a6..805d48dd954d 100644
>--- a/drivers/gpu/drm/xe/xe_device.c
>+++ b/drivers/gpu/drm/xe/xe_device.c
>@@ -66,6 +66,7 @@
> #include "xe_survivability_mode.h"
> #include "xe_sriov.h"
> #include "xe_svm.h"
>+#include "xe_sysctrl.h"
> #include "xe_tile.h"
> #include "xe_ttm_stolen_mgr.h"
> #include "xe_ttm_sys_mgr.h"
>@@ -1032,6 +1033,10 @@ int xe_device_probe(struct xe_device *xe)
> 	if (err)
> 		goto err_unregister_display;
>
>+	err = xe_sysctrl_init(xe);
>+	if (err)
>+		goto err_unregister_display;
>+
> 	err = xe_device_sysfs_init(xe);
> 	if (err)
> 		goto err_unregister_display;
>diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
>index a85be9ba175e..6295b2c35d4a 100644
>--- a/drivers/gpu/drm/xe/xe_device_types.h
>+++ b/drivers/gpu/drm/xe/xe_device_types.h
>@@ -29,6 +29,7 @@
> #include "xe_sriov_vf_ccs_types.h"
> #include "xe_step_types.h"
> #include "xe_survivability_mode_types.h"
>+#include "xe_sysctrl_types.h"
> #include "xe_tile_sriov_vf_types.h"
> #include "xe_validation.h"
>
>@@ -340,6 +341,8 @@ struct xe_device {
> 		u8 has_soc_remapper_telem:1;
> 		/** @info.has_sriov: Supports SR-IOV */
> 		u8 has_sriov:1;
>+		/** @info.has_sysctrl: Supports System Controller */
>+		u8 has_sysctrl:1;
> 		/** @info.has_usm: Device has unified shared memory support */
> 		u8 has_usm:1;
> 		/** @info.has_64bit_timestamp: Device supports 64-bit timestamps */
>@@ -606,6 +609,9 @@ struct xe_device {
> 	/** @heci_gsc: graphics security controller */
> 	struct xe_heci_gsc heci_gsc;
>
>+	/** @sc: System Controller */
>+	struct xe_sysctrl sc;
>+
> 	/** @nvm: discrete graphics non-volatile memory */
> 	struct intel_dg_nvm_dev *nvm;
>
>diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
>index 91e0553a8163..b6dc3030b673 100644
>--- a/drivers/gpu/drm/xe/xe_pci.c
>+++ b/drivers/gpu/drm/xe/xe_pci.c
>@@ -426,6 +426,7 @@ static const struct xe_device_desc cri_desc = {
> 	.has_soc_remapper_sysctrl = true,
> 	.has_soc_remapper_telem = true,
> 	.has_sriov = true,
>+	.has_sysctrl = true,
> 	.max_gt_per_tile = 2,
> 	.require_force_probe = true,
> 	.va_bits = 57,
>@@ -701,6 +702,7 @@ static int xe_info_init_early(struct xe_device *xe,
> 	xe->info.has_soc_remapper_telem = desc->has_soc_remapper_telem;
> 	xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
> 		desc->has_sriov;
>+	xe->info.has_sysctrl = desc->has_sysctrl;
> 	xe->info.has_mem_copy_instr = desc->has_mem_copy_instr;
> 	xe->info.skip_guc_pc = desc->skip_guc_pc;
> 	xe->info.skip_mtcfg = desc->skip_mtcfg;
>diff --git a/drivers/gpu/drm/xe/xe_pci_types.h b/drivers/gpu/drm/xe/xe_pci_types.h
>index 5f20f56571d1..53e44a32883d 100644
>--- a/drivers/gpu/drm/xe/xe_pci_types.h
>+++ b/drivers/gpu/drm/xe/xe_pci_types.h
>@@ -56,6 +56,7 @@ struct xe_device_desc {
> 	u8 has_soc_remapper_sysctrl:1;
> 	u8 has_soc_remapper_telem:1;
> 	u8 has_sriov:1;
>+	u8 has_sysctrl:1;
> 	u8 needs_scratch:1;
> 	u8 skip_guc_pc:1;
> 	u8 skip_mtcfg:1;
>diff --git a/drivers/gpu/drm/xe/xe_sysctrl.c b/drivers/gpu/drm/xe/xe_sysctrl.c
>new file mode 100644
>index 000000000000..e0e7b0ecf2bf
>--- /dev/null
>+++ b/drivers/gpu/drm/xe/xe_sysctrl.c
>@@ -0,0 +1,62 @@
>+// SPDX-License-Identifier: MIT
>+/*
>+ * Copyright © 2026 Intel Corporation
>+ */
>+
>+#include <drm/drm_managed.h>
>+#include <linux/device.h>
>+#include <linux/mutex.h>
>+
>+#include "regs/xe_sysctrl_regs.h"
>+#include "xe_device.h"
>+#include "xe_printk.h"
>+#include "xe_soc_remapper.h"
>+#include "xe_sysctrl.h"
>+#include "xe_sysctrl_mailbox.h"
>+#include "xe_sysctrl_types.h"
>+
>+static void xe_sysctrl_fini(void *arg)
>+{
>+	struct xe_sysctrl *sc = arg;
>+	struct xe_device *xe = sc_to_xe(sc);

Instead of using sc_to_xe here, just pass the xe as arg.
>+
>+	if (!xe->soc_remapper.set_sysctrl_region)
>+		return;
>+
>+	xe->soc_remapper.set_sysctrl_region(xe, 0);
>+}
>+
>+/**
>+ * xe_sysctrl_init - Initialize SC subsystem
>+ * @xe: xe device instance
>+ *
>+ * Entry point for SC initialization, called from xe_device_probe().
>+ * This function checks platform support and initializes the system controller.
>+ *
>+ * Return: 0 on success, error code on failure
>+ */
>+int xe_sysctrl_init(struct xe_device *xe)
>+{
>+	struct xe_sysctrl *sc = &xe->sc;
>+	int ret;
>+
>+	if (!xe->info.has_sysctrl)
>+		return 0;
>+
>+	ret = devm_add_action_or_reset(xe->drm.dev, xe_sysctrl_fini, sc);
>+	if (ret)
>+		return ret;
>+
>+	if (!xe->soc_remapper.set_sysctrl_region)
>+		return -ENODEV;
>+
>+	xe->soc_remapper.set_sysctrl_region(xe, SYSCTRL_MAILBOX_INDEX);
>+
>+	ret = drmm_mutex_init(&xe->drm, &sc->cmd_lock);
>+	if (ret)
>+		return ret;
>+
>+	xe_sysctrl_mailbox_init(sc);
>+
>+	return 0;
>+}
>diff --git a/drivers/gpu/drm/xe/xe_sysctrl.h b/drivers/gpu/drm/xe/xe_sysctrl.h
>new file mode 100644
>index 000000000000..fe90d6577d54
>--- /dev/null
>+++ b/drivers/gpu/drm/xe/xe_sysctrl.h
>@@ -0,0 +1,18 @@
>+/* SPDX-License-Identifier: MIT */
>+/*
>+ * Copyright © 2026 Intel Corporation
>+ */
>+
>+#ifndef _XE_SYSCTRL_H_
>+#define _XE_SYSCTRL_H_
>+
>+struct xe_device;
>+
>+static inline struct xe_device *sc_to_xe(struct xe_sysctrl *sc)
>+{
>+	return container_of(sc, struct xe_device, sc);
>+}

I would move this to the xe_sysctrl_mailbox.c. Also compile fails here due 
to missing struct xe_sysctrl declaration.

>+
>+int xe_sysctrl_init(struct xe_device *xe);
>+
>+#endif /* _XE_SYSCTRL_H_ */
>diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
>new file mode 100644
>index 000000000000..940ea535da2e
>--- /dev/null
>+++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
>@@ -0,0 +1,409 @@
>+// SPDX-License-Identifier: MIT
>+/*
>+ * Copyright © 2026 Intel Corporation
>+ */
>+
>+#include <linux/bitfield.h>
>+#include <linux/errno.h>
>+#include <linux/minmax.h>
>+#include <linux/mutex.h>
>+#include <linux/slab.h>
>+#include <linux/string.h>
>+#include <linux/types.h>
>+
>+#include "regs/xe_sysctrl_regs.h"
>+#include "xe_device.h"
>+#include "xe_mmio.h"
>+#include "xe_pm.h"
>+#include "xe_printk.h"
>+#include "xe_sysctrl.h"
>+#include "xe_sysctrl_mailbox.h"
>+#include "xe_sysctrl_types.h"
>+
>+static bool xe_sysctrl_mailbox_wait_bit_clear(struct xe_sysctrl *sc, u32 bit_mask,
>+					      unsigned int timeout_ms)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+	int ret;
>+
>+	ret = xe_mmio_wait32_not(mmio, SC_MB_CTRL, bit_mask, bit_mask,
>+				 timeout_ms * 1000, NULL, false);
>+
>+	return ret == 0;
>+}
>+
>+static bool xe_sysctrl_mailbox_wait_bit_set(struct xe_sysctrl *sc, u32 bit_mask,
>+					    unsigned int timeout_ms)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+	int ret;
>+
>+	ret = xe_mmio_wait32(mmio, SC_MB_CTRL, bit_mask, bit_mask,
>+			     timeout_ms * 1000, NULL, false);
>+
>+	return ret == 0;
>+}
>+
>+static int xe_sysctrl_mailbox_write_frame(struct xe_sysctrl *sc, const void *frame,
>+					  size_t len)
>+{
>+	static const struct xe_reg regs[] = {
>+		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
>+	};
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
>+	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
>+	u32 i;
>+
>+	memcpy(val, frame, len);
>+
>+	for (i = 0; i < dw; i++)
>+		xe_mmio_write32(mmio, regs[i], val[i]);
>+
>+	return 0;
>+}
>+
>+static int xe_sysctrl_mailbox_read_frame(struct xe_sysctrl *sc, void *frame,
>+					 size_t len)
>+{
>+	static const struct xe_reg regs[] = {
>+		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
>+	};
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
>+	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
>+	u32 i;
>+
>+	for (i = 0; i < dw; i++)
>+		val[i] = xe_mmio_read32(mmio, regs[i]);
>+
>+	memcpy(frame, val, len);
>+
>+	return 0;
>+}
>+
>+static void xe_sysctrl_mailbox_clear_response(struct xe_sysctrl *sc)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+
>+	xe_mmio_rmw32(mmio, SC_MB_CTRL, SC_MB_CTRL_RUN_BUSY_OUT, 0);
>+}
>+
>+static int xe_sysctrl_mailbox_prepare_command(struct xe_sysctrl *sc,
>+					      u8 group_id, u8 command,
>+					      const void *data_in, size_t data_in_len,
>+					      u8 **mbox_cmd, size_t *cmd_size)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
>+	size_t size;
>+	u8 *buffer;
>+
>+	size = sizeof(*mkhi_hdr) + data_in_len;
>+	if (size > SC_MB_MAX_MESSAGE_SIZE) {
>+		xe_err(xe, "sysctrl: Message too large: %zu bytes\n", size);
>+		return -EINVAL;
>+	}
>+
>+	buffer = kmalloc(size, GFP_KERNEL);
>+	if (!buffer)
>+		return -ENOMEM;
>+
>+	mkhi_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)buffer;
>+	mkhi_hdr->data = cpu_to_le32(FIELD_PREP(MKHI_HDR_GROUP_ID_MASK, group_id) |
>+				     FIELD_PREP(MKHI_HDR_COMMAND_MASK, command & 0x7F) |
>+				     FIELD_PREP(MKHI_HDR_IS_RESPONSE, 0) |
>+				     FIELD_PREP(MKHI_HDR_RESERVED_MASK, 0) |
>+				     FIELD_PREP(MKHI_HDR_RESULT_MASK, 0));
>+
>+	if (data_in && data_in_len)
>+		memcpy(buffer + sizeof(*mkhi_hdr), data_in, data_in_len);
>+
>+	*mbox_cmd = buffer;
>+	*cmd_size = size;
>+
>+	return 0;
>+}

In all the functions above, you do not use the sc pointer at all, so  why 
not just pass xe to the functions? If you do that, then in most functions 
below you will not use sc pointer and you can do away with the sc_to_xe 
conversion altogether and pass xe everywhere. Note that you only need the sc 
object in

xe_sysctrl_init()
xe_sysctrl_mailbox_send_frames()
xe_sysctrl_mailbox_init()

>+
>+static int xe_sysctrl_mailbox_send_frames(struct xe_sysctrl *sc, const u8 *mbox_cmd,
>+					  size_t cmd_size, unsigned int timeout_ms)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+	u32 ctrl_reg, total_frames, frame;
>+	size_t bytes_sent, frame_size;
>+
>+	total_frames = DIV_ROUND_UP(cmd_size, SC_MB_FRAME_SIZE);
>+
>+	if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
>+		xe_err(xe, "sysctrl: Mailbox busy\n");
>+		return -EBUSY;
>+	}
>+
>+	sc->phase_bit ^= 1;
>+	bytes_sent = 0;
>+
>+	for (frame = 0; frame < total_frames; frame++) {
>+		frame_size = min(cmd_size - bytes_sent, (size_t)SC_MB_FRAME_SIZE);
>+
>+		if (xe_sysctrl_mailbox_write_frame(sc, mbox_cmd + bytes_sent, frame_size)) {
>+			xe_err(xe, "sysctrl: Failed to write frame %u\n", frame);
>+			sc->phase_bit ^= 1;
>+			return -EIO;
>+		}
>+
>+		ctrl_reg = SC_MB_CTRL_RUN_BUSY |
>+			   FIELD_PREP(MKHI_FRAME_CURRENT_MASK, frame) |
>+			   FIELD_PREP(MKHI_FRAME_TOTAL_MASK, total_frames - 1) |
>+			   FIELD_PREP(MKHI_FRAME_COMMAND_MASK, SC_MKHI_COMMAND) |
>+			   (sc->phase_bit ? MKHI_FRAME_PHASE : 0);
>+
>+		xe_mmio_write32(mmio, SC_MB_CTRL, ctrl_reg);
>+
>+		if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
>+			xe_err(xe, "sysctrl: Frame %u acknowledgment timeout\n", frame);
>+			return -ETIMEDOUT;
>+		}
>+
>+		bytes_sent += frame_size;
>+	}
>+
>+	return 0;
>+}
>+
>+static int xe_sysctrl_mailbox_process_first_frame(struct xe_sysctrl *sc,
>+						  const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
>+						  void *out,
>+						  size_t frame_size,
>+						  size_t *payload_bytes)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	u32 frame_data[4];
>+	struct xe_sysctrl_mailbox_mkhi_msg_hdr *resp_hdr;
>+	size_t hdr_size = sizeof(*resp_hdr);
>+	size_t payload_size;
>+	int ret;

I would rearrange the variables in decreasing line length. Not a coding 
guideline, but is generally advised to do so.

struct xe_sysctrl_mailbox_mkhi_msg_hdr *resp_hdr;
struct xe_device *xe = sc_to_xe(sc);
size_t hdr_size = sizeof(*resp_hdr);
size_t payload_size;
u32 frame_data[4];
int ret;

Also, please avoid hardcoded 4 in frame_data dimension. It could be 
frame_data[SC_MB_FRAME_SIZE / sizeof(u32)]

>+
>+	ret = xe_sysctrl_mailbox_read_frame(sc, frame_data, frame_size);
>+	if (ret)
>+		return ret;
>+
>+	resp_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)frame_data;
>+
>+	if (!XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(resp_hdr) ||
>+	    XE_SYSCTRL_MKHI_HDR_GROUP_ID(resp_hdr) != XE_SYSCTRL_MKHI_HDR_GROUP_ID(req) ||
>+	    XE_SYSCTRL_MKHI_HDR_COMMAND(resp_hdr) != XE_SYSCTRL_MKHI_HDR_COMMAND(req)) {
>+		xe_err(xe, "SC: Response header mismatch\n");
>+		return -EPROTO;
>+	}
>+
>+	if (XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr) != 0) {
>+		xe_err(xe, "SC: Firmware error: 0x%02lx\n",
>+		       XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr));
>+		return -EIO;
>+	}
>+
>+	payload_size = frame_size - hdr_size;
>+	if (payload_size > 0)
>+		memcpy(out, (u8 *)frame_data + hdr_size, payload_size);
>+
>+	*payload_bytes = payload_size;
>+
>+	xe_sysctrl_mailbox_clear_response(sc);
>+
>+	return 0;
>+}
>+
>+static int xe_sysctrl_mailbox_process_frame(struct xe_sysctrl *sc,
>+					    void *out, size_t frame_size,
>+					    unsigned int timeout_ms)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	int ret;
>+
>+	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
>+		xe_err(xe, "sysctrl: Response frame timeout\n");
>+		return -ETIMEDOUT;
>+	}
>+
>+	ret = xe_sysctrl_mailbox_read_frame(sc, out, frame_size);
>+	if (ret)
>+		return ret;
>+
>+	xe_sysctrl_mailbox_clear_response(sc);
>+
>+	return 0;
>+}
>+
>+static int xe_sysctrl_mailbox_receive_frames(struct xe_sysctrl *sc,
>+					     const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
>+					     void *data_out, size_t data_out_len,
>+					     size_t *rdata_len, unsigned int timeout_ms)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
>+	u32 ctrl_reg, total_frames, frame;
>+	size_t hdr_size = sizeof(*mkhi_hdr);
>+	u8 *out = data_out;
>+	size_t received = 0;
>+	size_t frame_size;
>+	int ret = 0;
>+
>+	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
>+		xe_err(xe, "sysctrl: Response frame 0 timeout\n");
>+		return -ETIMEDOUT;
>+	}
>+
>+	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
>+	total_frames = FIELD_GET(MKHI_FRAME_TOTAL_MASK, ctrl_reg) + 1;
>+
>+	if (total_frames == 1)
>+		frame_size = min(hdr_size + data_out_len, (size_t)SC_MB_FRAME_SIZE);
>+	else
>+		frame_size = SC_MB_FRAME_SIZE;
>+
>+	ret = xe_sysctrl_mailbox_process_first_frame(sc, req, out, frame_size, &received);
>+	if (ret)
>+		return ret;
>+
>+	out += received;
>+
>+	for (frame = 1; frame < total_frames; frame++) {
>+		size_t remaining = data_out_len - received;
>+
>+		frame_size = min_t(size_t, remaining, SC_MB_FRAME_SIZE);
>+
>+		ret = xe_sysctrl_mailbox_process_frame(sc, out, frame_size, timeout_ms);
>+		if (ret)
>+			break;
>+
>+		received += frame_size;
>+		out += frame_size;
>+	}

I fell there should be a simpler way to implement this function. I will get 
back if I can think of anything.

>+
>+	*rdata_len = received;
>+
>+	return ret;
>+}
>+
>+static int xe_sysctrl_mailbox_send_command(struct xe_sysctrl *sc,
>+					   const u8 *mbox_cmd, size_t cmd_size,
>+					   void *data_out, size_t data_out_len,
>+					   size_t *rdata_len, unsigned int timeout_ms)
>+{
>+	const struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
>+	size_t received;
>+	int ret;
>+
>+	ret = xe_sysctrl_mailbox_send_frames(sc, mbox_cmd, cmd_size, timeout_ms);
>+	if (ret)
>+		return ret;
>+
>+	if (!data_out || !rdata_len)
>+		return 0;
>+
>+	mkhi_hdr = (const struct xe_sysctrl_mailbox_mkhi_msg_hdr *)mbox_cmd;
>+
>+	ret = xe_sysctrl_mailbox_receive_frames(sc, mkhi_hdr, data_out, data_out_len,
>+						&received, timeout_ms);
>+	if (ret)
>+		return ret;
>+
>+	*rdata_len = received;
>+
>+	return 0;
>+}
>+
>+/**
>+ * xe_sysctrl_send_command - Send command to System Controller via mailbox
>+ * @handle: XE device handle
>+ * @cmd_buffer: Pointer to xe_sysctrl_mailbox_command structure
>+ * @rdata_len: Pointer to store actual response data size (can be NULL)
>+ *
>+ * Send a command to the System Controller using MKHI protocol. Handles
>+ * command preparation, fragmentation, transmission, and response reception.
>+ *
>+ * Return: 0 on success, negative error code on failure
>+ */
>+int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len)
>+{
>+	struct xe_device *xe = handle;
>+	struct xe_sysctrl *sc = &xe->sc;
>+	struct xe_sysctrl_mailbox_command *cmd = cmd_buffer;
>+	u8 *mbox_cmd = NULL;
>+	size_t cmd_size = 0;
>+	u8 group_id, command_code;
>+	int ret = 0;
>+
>+	if (!xe) {
>+		pr_err("sysctrl: Invalid device handle\n");
>+		return -EINVAL;
>+	}
>+
>+	if (!cmd) {
>+		xe_err(xe, "sysctrl: Invalid command buffer\n");
>+		return -EINVAL;
>+	}
>+
>+	if (!xe->info.has_sysctrl)
>+		return -ENODEV;
>+
>+	group_id = XE_SYSCTRL_APP_HDR_GROUP_ID(&cmd->header);
>+	command_code = XE_SYSCTRL_APP_HDR_COMMAND(&cmd->header);
>+
>+	if (!cmd->data_in && cmd->data_in_len) {
>+		xe_err(xe, "sysctrl: Invalid input parameters\n");
>+		return -EINVAL;
>+	}
>+
>+	if (!cmd->data_out && cmd->data_out_len) {
>+		xe_err(xe, "sysctrl: Invalid output parameters\n");
>+		return -EINVAL;
>+	}
>+
>+	might_sleep();
>+
>+	ret = xe_sysctrl_mailbox_prepare_command(sc, group_id, command_code,
>+						 cmd->data_in, cmd->data_in_len,
>+						 &mbox_cmd, &cmd_size);
>+	if (ret) {
>+		xe_err(xe, "sysctrl: Failed to prepare command: %d\n", ret);
>+		return ret;
>+	}
>+
>+	guard(xe_pm_runtime)(xe);
>+
>+	guard(mutex)(&sc->cmd_lock);
>+
>+	ret = xe_sysctrl_mailbox_send_command(sc, mbox_cmd, cmd_size,
>+					      cmd->data_out, cmd->data_out_len, rdata_len,
>+					      SC_MB_DEFAULT_TIMEOUT_MS);
>+	if (ret)
>+		xe_err(xe, "sysctrl: Mailbox command failed: %d\n", ret);
>+
>+	kfree(mbox_cmd);
>+
>+	return ret;
>+}
>+
>+/**
>+ * xe_sysctrl_mailbox_init - Initialize the System Controller mailbox state
>+ * @sc: System controller structure
>+ */
>+void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc)
>+{
>+	struct xe_device *xe = sc_to_xe(sc);
>+	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
>+	u32 ctrl_reg;
>+
>+	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
>+	sc->phase_bit = (ctrl_reg & MKHI_FRAME_PHASE) ? 1 : 0;
>+
>+	xe_mmio_rmw32(mmio, SC_MB_CTRL, MKHI_FRAME_PHASE, 0);
>+}
>diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
>new file mode 100644
>index 000000000000..3e472418ebd0
>--- /dev/null
>+++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
>@@ -0,0 +1,77 @@
>+/* SPDX-License-Identifier: MIT */
>+/*
>+ * Copyright © 2026 Intel Corporation
>+ */
>+
>+#ifndef __XE_SYSCTRL_MAILBOX_H__
>+#define __XE_SYSCTRL_MAILBOX_H__
>+
>+#include <linux/bitfield.h>
>+#include <linux/types.h>
>+
>+struct xe_sysctrl;
>+
>+#define MKHI_HDR_GROUP_ID_MASK		GENMASK(7, 0)
>+#define MKHI_HDR_COMMAND_MASK		GENMASK(14, 8)
>+#define MKHI_HDR_IS_RESPONSE		BIT(15)
>+#define MKHI_HDR_RESERVED_MASK		GENMASK(23, 16)
>+#define MKHI_HDR_RESULT_MASK		GENMASK(31, 24)

Same comment as (2) above. If the MKHI defines are solely used by 
xe_sysctrl_mailbox.c, then you can just move them there. I assume that the 
app is only using the APP_HDR and is not concerned with the underlying 
protocol/transport.

>+
>+struct xe_sysctrl_mailbox_mkhi_msg_hdr {
>+	__le32 data;
>+} __packed;
>+
>+#define APP_HDR_GROUP_ID_MASK		GENMASK(7, 0)
>+#define APP_HDR_COMMAND_MASK		GENMASK(15, 8)
>+#define APP_HDR_VERSION_MASK		GENMASK(23, 16)
>+#define APP_HDR_RESERVED_MASK		GENMASK(31, 24)
>+
>+struct xe_sysctrl_mailbox_app_msg_hdr {
>+	__le32 data;
>+} __packed;
>+
>+#define XE_SYSCTRL_APP_HDR_GROUP_ID(hdr) \
>+	FIELD_GET(APP_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
>+
>+#define XE_SYSCTRL_APP_HDR_COMMAND(hdr) \
>+	FIELD_GET(APP_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
>+
>+#define XE_SYSCTRL_APP_HDR_VERSION(hdr) \
>+	FIELD_GET(APP_HDR_VERSION_MASK, le32_to_cpu((hdr)->data))
>+
>+#define XE_SYSCTRL_MKHI_HDR_GROUP_ID(hdr) \
>+	FIELD_GET(MKHI_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
>+
>+#define XE_SYSCTRL_MKHI_HDR_COMMAND(hdr) \
>+	FIELD_GET(MKHI_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
>+
>+#define XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(hdr) \
>+	FIELD_GET(MKHI_HDR_IS_RESPONSE, le32_to_cpu((hdr)->data))
>+
>+#define XE_SYSCTRL_MKHI_HDR_RESULT(hdr) \
>+	FIELD_GET(MKHI_HDR_RESULT_MASK, le32_to_cpu((hdr)->data))

Same here. MKHI defines can move to the C file. Either that or the APP api 
can be moved to a separate header - xe_sysctrl_mailbox_api.h.

Regards,
Umesh

>+
>+/**
>+ * struct xe_sysctrl_mailbox_command - System Controller mailbox command structure
>+ */
>+struct xe_sysctrl_mailbox_command {
>+	/** @header: Application message header containing command information */
>+	struct xe_sysctrl_mailbox_app_msg_hdr header;
>+
>+	/** @data_in: Pointer to input payload data (can be NULL if no input data) */
>+	void *data_in;
>+
>+	/** @data_in_len: Size of input payload in bytes (0 if no input data) */
>+	size_t data_in_len;
>+
>+	/** @data_out: Pointer to output buffer for response data (can be NULL if no response) */
>+	void *data_out;
>+
>+	/** @data_out_len: Size of output buffer in bytes (0 if no response expected) */
>+	size_t data_out_len;
>+};
>+
>+void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc);
>+int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len);
>+
>+#endif /* __XE_SYSCTRL_MAILBOX_H__ */
>diff --git a/drivers/gpu/drm/xe/xe_sysctrl_types.h b/drivers/gpu/drm/xe/xe_sysctrl_types.h
>new file mode 100644
>index 000000000000..88a34967688b
>--- /dev/null
>+++ b/drivers/gpu/drm/xe/xe_sysctrl_types.h
>@@ -0,0 +1,23 @@
>+/* SPDX-License-Identifier: MIT */
>+/*
>+ * Copyright © 2026 Intel Corporation
>+ */
>+
>+#ifndef _XE_SYSCTRL_TYPES_H_
>+#define _XE_SYSCTRL_TYPES_H_
>+
>+#include <linux/mutex.h>
>+#include <linux/types.h>
>+
>+/**
>+ * struct xe_sysctrl - System Controller driver context
>+ */
>+struct xe_sysctrl {
>+	/** @cmd_lock: Mutex protecting mailbox command operations */
>+	struct mutex cmd_lock;
>+
>+	/** @phase_bit: MKHI message boundary phase toggle bit */
>+	u32 phase_bit;
>+};
>+
>+#endif /* _XE_SYSCTRL_TYPES_H_ */
>-- 
>2.43.0
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms
  2026-01-06 18:37   ` Umesh Nerlige Ramappa
@ 2026-01-07  1:24     ` Matthew Brost
  0 siblings, 0 replies; 8+ messages in thread
From: Matthew Brost @ 2026-01-07  1:24 UTC (permalink / raw)
  To: Umesh Nerlige Ramappa
  Cc: Anoop, Vijay, intel-xe, badal.nilawar, rodrigo.vivi,
	aravind.iddamsetty, riana.tauro, ravi.kishore.koppuravuri,
	anshuman.gupta, matthew.d.roper, michael.j.ruhl, paul.e.luse,
	mohamed.mansoor.v, kam.nasim

On Tue, Jan 06, 2026 at 10:37:46AM -0800, Umesh Nerlige Ramappa wrote:
> Hi Anoop,
> 
> Thanks for incorporating most of the comments here. I have a few more in
> this revision.
> 
> On Fri, Jan 02, 2026 at 08:54:50AM -0800, Anoop, Vijay wrote:
> > From: Anoop Vijay <anoop.c.vijay@intel.com>
> > 
> > Add a new system controller (sysctrl) component for Intel Xe3p dGPU
> > platforms.
> > 
> > This component provides the foundational infrastructure for communication
> > with the System Controller firmware using MKHI protocol over a mailbox
> > interface.
> > 
> > Key features introduced:
> > - Detection and initialization of System Controller interface on Xe3p
> >   dGPU platforms
> > - Mailbox communication with System Controller firmware
> > - Fragmented message transfer for large command payloads
> 
> Let's break down the patches as Matt suggested.
> 
> > 
> > This implementation establishes the base for future System Controller
> > feature enablement and firmware command handling.
> > 
> > Signed-off-by: Anoop Vijay <anoop.c.vijay@intel.com>
> > ---
> > drivers/gpu/drm/xe/Makefile               |   2 +
> > drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h |  44 +++
> > drivers/gpu/drm/xe/xe_device.c            |   5 +
> > drivers/gpu/drm/xe/xe_device_types.h      |   6 +
> > drivers/gpu/drm/xe/xe_pci.c               |   2 +
> > drivers/gpu/drm/xe/xe_pci_types.h         |   1 +
> > drivers/gpu/drm/xe/xe_sysctrl.c           |  62 ++++
> > drivers/gpu/drm/xe/xe_sysctrl.h           |  18 +
> > drivers/gpu/drm/xe/xe_sysctrl_mailbox.c   | 409 ++++++++++++++++++++++
> > drivers/gpu/drm/xe/xe_sysctrl_mailbox.h   |  77 ++++
> > drivers/gpu/drm/xe/xe_sysctrl_types.h     |  23 ++
> > 11 files changed, 649 insertions(+)
> > create mode 100644 drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> > create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.c
> > create mode 100644 drivers/gpu/drm/xe/xe_sysctrl.h
> > create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> > create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> > create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h
> > 
> > diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> > index 2b20c79d7ec9..947fbcac65d5 100644
> > --- a/drivers/gpu/drm/xe/Makefile
> > +++ b/drivers/gpu/drm/xe/Makefile
> > @@ -121,6 +121,8 @@ xe-y += xe_bb.o \
> > 	xe_step.o \
> > 	xe_survivability_mode.o \
> > 	xe_sync.o \
> > +	xe_sysctrl.o \
> > +	xe_sysctrl_mailbox.o \
> > 	xe_tile.o \
> > 	xe_tile_sysfs.o \
> > 	xe_tlb_inval.o \
> > diff --git a/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> > new file mode 100644
> > index 000000000000..6627a9c32c4f
> > --- /dev/null
> > +++ b/drivers/gpu/drm/xe/regs/xe_sysctrl_regs.h
> > @@ -0,0 +1,44 @@
> > +/* SPDX-License-Identifier: MIT */
> > +/*
> > + * Copyright © 2026 Intel Corporation
> > + */
> > +
> > +#ifndef _XE_SYSCTRL_REGS_H_
> > +#define _XE_SYSCTRL_REGS_H_
> > +
> > +#include "xe_regs.h"
> > +
> > +#define SYSCTRL_BASE_OFFSET		0xDB000
> > +#define SYSCTRL_BASE			(SOC_BASE + SYSCTRL_BASE_OFFSET)
> > +#define SYSCTRL_MAILBOX_INDEX		0x03
> > +#define SC_BAR_LENGTH			0x1000
> > +
> > +#define SC_MB_CTRL			XE_REG(SYSCTRL_BASE + 0x10)
> > +#define   SC_MB_CTRL_RUN_BUSY		REG_BIT(31)
> > +#define   SC_MB_CTRL_IRQ		REG_BIT(30)
> > +#define   SC_MB_CTRL_RUN_BUSY_OUT	REG_BIT(29)
> > +#define   SC_MB_CTRL_PARAM3_MASK	REG_GENMASK(28, 24)
> > +#define   SC_MB_CTRL_PARAM2_MASK	REG_GENMASK(23, 16)
> > +#define   SC_MB_CTRL_PARAM1_MASK	REG_GENMASK(15, 8)
> > +#define   SC_MB_CTRL_COMMAND_MASK	REG_GENMASK(7, 0)
> > +
> > +#define SC_MB_DATA0			XE_REG(SYSCTRL_BASE + 0x14)
> > +#define SC_MB_DATA1			XE_REG(SYSCTRL_BASE + 0x18)
> > +#define SC_MB_DATA2			XE_REG(SYSCTRL_BASE + 0x1C)
> > +#define SC_MB_DATA3			XE_REG(SYSCTRL_BASE + 0x20)
> > +
> > +#define MKHI_FRAME_PHASE		REG_BIT(24)
> > +#define MKHI_FRAME_CURRENT_MASK		REG_GENMASK(21, 16)
> > +#define MKHI_FRAME_TOTAL_MASK		REG_GENMASK(13, 8)
> > +#define MKHI_FRAME_COMMAND_MASK		REG_GENMASK(7, 0)
> > +
> > +#define SC_MB_FRAME_SIZE		16
> > +#define SC_MB_MAX_FRAMES		64
> > +#define SC_MB_MAX_MESSAGE_SIZE		(SC_MB_FRAME_SIZE * SC_MB_MAX_FRAMES)
> > +#define SC_MKHI_COMMAND			5
> > +
> > +#define SC_MB_DEFAULT_TIMEOUT_MS	500
> > +#define SC_MB_RETRY_TIMEOUT_MS		20
> > +#define SC_MB_POLL_INTERVAL_US		100
> 
> 1)
> I missed this the last time. Can we change SC to SYSCTRL here for
> everything? I see that for the mailbox, you are using SC_MB, but at the end
> of the day SC still means SYSCTRL and consistently using the same name helps
> readability.
> 
> 2)
> The MKHI_FRAME definitions can move to the xe_sysctrl_mailbox.c since that's
> the only code accessing it. See more comments below.
> 
> 
> > +
> > +#endif /* _XE_SYSCTRL_REGS_H_ */
> > diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> > index e101d290b2a6..805d48dd954d 100644
> > --- a/drivers/gpu/drm/xe/xe_device.c
> > +++ b/drivers/gpu/drm/xe/xe_device.c
> > @@ -66,6 +66,7 @@
> > #include "xe_survivability_mode.h"
> > #include "xe_sriov.h"
> > #include "xe_svm.h"
> > +#include "xe_sysctrl.h"
> > #include "xe_tile.h"
> > #include "xe_ttm_stolen_mgr.h"
> > #include "xe_ttm_sys_mgr.h"
> > @@ -1032,6 +1033,10 @@ int xe_device_probe(struct xe_device *xe)
> > 	if (err)
> > 		goto err_unregister_display;
> > 
> > +	err = xe_sysctrl_init(xe);
> > +	if (err)
> > +		goto err_unregister_display;
> > +
> > 	err = xe_device_sysfs_init(xe);
> > 	if (err)
> > 		goto err_unregister_display;
> > diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
> > index a85be9ba175e..6295b2c35d4a 100644
> > --- a/drivers/gpu/drm/xe/xe_device_types.h
> > +++ b/drivers/gpu/drm/xe/xe_device_types.h
> > @@ -29,6 +29,7 @@
> > #include "xe_sriov_vf_ccs_types.h"
> > #include "xe_step_types.h"
> > #include "xe_survivability_mode_types.h"
> > +#include "xe_sysctrl_types.h"
> > #include "xe_tile_sriov_vf_types.h"
> > #include "xe_validation.h"
> > 
> > @@ -340,6 +341,8 @@ struct xe_device {
> > 		u8 has_soc_remapper_telem:1;
> > 		/** @info.has_sriov: Supports SR-IOV */
> > 		u8 has_sriov:1;
> > +		/** @info.has_sysctrl: Supports System Controller */
> > +		u8 has_sysctrl:1;
> > 		/** @info.has_usm: Device has unified shared memory support */
> > 		u8 has_usm:1;
> > 		/** @info.has_64bit_timestamp: Device supports 64-bit timestamps */
> > @@ -606,6 +609,9 @@ struct xe_device {
> > 	/** @heci_gsc: graphics security controller */
> > 	struct xe_heci_gsc heci_gsc;
> > 
> > +	/** @sc: System Controller */
> > +	struct xe_sysctrl sc;
> > +
> > 	/** @nvm: discrete graphics non-volatile memory */
> > 	struct intel_dg_nvm_dev *nvm;
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> > index 91e0553a8163..b6dc3030b673 100644
> > --- a/drivers/gpu/drm/xe/xe_pci.c
> > +++ b/drivers/gpu/drm/xe/xe_pci.c
> > @@ -426,6 +426,7 @@ static const struct xe_device_desc cri_desc = {
> > 	.has_soc_remapper_sysctrl = true,
> > 	.has_soc_remapper_telem = true,
> > 	.has_sriov = true,
> > +	.has_sysctrl = true,
> > 	.max_gt_per_tile = 2,
> > 	.require_force_probe = true,
> > 	.va_bits = 57,
> > @@ -701,6 +702,7 @@ static int xe_info_init_early(struct xe_device *xe,
> > 	xe->info.has_soc_remapper_telem = desc->has_soc_remapper_telem;
> > 	xe->info.has_sriov = xe_configfs_primary_gt_allowed(to_pci_dev(xe->drm.dev)) &&
> > 		desc->has_sriov;
> > +	xe->info.has_sysctrl = desc->has_sysctrl;
> > 	xe->info.has_mem_copy_instr = desc->has_mem_copy_instr;
> > 	xe->info.skip_guc_pc = desc->skip_guc_pc;
> > 	xe->info.skip_mtcfg = desc->skip_mtcfg;
> > diff --git a/drivers/gpu/drm/xe/xe_pci_types.h b/drivers/gpu/drm/xe/xe_pci_types.h
> > index 5f20f56571d1..53e44a32883d 100644
> > --- a/drivers/gpu/drm/xe/xe_pci_types.h
> > +++ b/drivers/gpu/drm/xe/xe_pci_types.h
> > @@ -56,6 +56,7 @@ struct xe_device_desc {
> > 	u8 has_soc_remapper_sysctrl:1;
> > 	u8 has_soc_remapper_telem:1;
> > 	u8 has_sriov:1;
> > +	u8 has_sysctrl:1;
> > 	u8 needs_scratch:1;
> > 	u8 skip_guc_pc:1;
> > 	u8 skip_mtcfg:1;
> > diff --git a/drivers/gpu/drm/xe/xe_sysctrl.c b/drivers/gpu/drm/xe/xe_sysctrl.c
> > new file mode 100644
> > index 000000000000..e0e7b0ecf2bf
> > --- /dev/null
> > +++ b/drivers/gpu/drm/xe/xe_sysctrl.c
> > @@ -0,0 +1,62 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2026 Intel Corporation
> > + */
> > +
> > +#include <drm/drm_managed.h>
> > +#include <linux/device.h>
> > +#include <linux/mutex.h>
> > +
> > +#include "regs/xe_sysctrl_regs.h"
> > +#include "xe_device.h"
> > +#include "xe_printk.h"
> > +#include "xe_soc_remapper.h"
> > +#include "xe_sysctrl.h"
> > +#include "xe_sysctrl_mailbox.h"
> > +#include "xe_sysctrl_types.h"
> > +
> > +static void xe_sysctrl_fini(void *arg)
> > +{
> > +	struct xe_sysctrl *sc = arg;
> > +	struct xe_device *xe = sc_to_xe(sc);
> 
> Instead of using sc_to_xe here, just pass the xe as arg.
> > +
> > +	if (!xe->soc_remapper.set_sysctrl_region)
> > +		return;
> > +
> > +	xe->soc_remapper.set_sysctrl_region(xe, 0);
> > +}
> > +
> > +/**
> > + * xe_sysctrl_init - Initialize SC subsystem
> > + * @xe: xe device instance
> > + *
> > + * Entry point for SC initialization, called from xe_device_probe().
> > + * This function checks platform support and initializes the system controller.
> > + *
> > + * Return: 0 on success, error code on failure
> > + */
> > +int xe_sysctrl_init(struct xe_device *xe)
> > +{
> > +	struct xe_sysctrl *sc = &xe->sc;
> > +	int ret;
> > +
> > +	if (!xe->info.has_sysctrl)
> > +		return 0;
> > +
> > +	ret = devm_add_action_or_reset(xe->drm.dev, xe_sysctrl_fini, sc);
> > +	if (ret)
> > +		return ret;
> > +
> > +	if (!xe->soc_remapper.set_sysctrl_region)
> > +		return -ENODEV;
> > +
> > +	xe->soc_remapper.set_sysctrl_region(xe, SYSCTRL_MAILBOX_INDEX);
> > +
> > +	ret = drmm_mutex_init(&xe->drm, &sc->cmd_lock);
> > +	if (ret)
> > +		return ret;
> > +
> > +	xe_sysctrl_mailbox_init(sc);
> > +
> > +	return 0;
> > +}
> > diff --git a/drivers/gpu/drm/xe/xe_sysctrl.h b/drivers/gpu/drm/xe/xe_sysctrl.h
> > new file mode 100644
> > index 000000000000..fe90d6577d54
> > --- /dev/null
> > +++ b/drivers/gpu/drm/xe/xe_sysctrl.h
> > @@ -0,0 +1,18 @@
> > +/* SPDX-License-Identifier: MIT */
> > +/*
> > + * Copyright © 2026 Intel Corporation
> > + */
> > +
> > +#ifndef _XE_SYSCTRL_H_
> > +#define _XE_SYSCTRL_H_
> > +
> > +struct xe_device;
> > +
> > +static inline struct xe_device *sc_to_xe(struct xe_sysctrl *sc)
> > +{
> > +	return container_of(sc, struct xe_device, sc);
> > +}
> 
> I would move this to the xe_sysctrl_mailbox.c. Also compile fails here due
> to missing struct xe_sysctrl declaration.
> 
> > +
> > +int xe_sysctrl_init(struct xe_device *xe);
> > +
> > +#endif /* _XE_SYSCTRL_H_ */
> > diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> > new file mode 100644
> > index 000000000000..940ea535da2e
> > --- /dev/null
> > +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.c
> > @@ -0,0 +1,409 @@
> > +// SPDX-License-Identifier: MIT
> > +/*
> > + * Copyright © 2026 Intel Corporation
> > + */
> > +
> > +#include <linux/bitfield.h>
> > +#include <linux/errno.h>
> > +#include <linux/minmax.h>
> > +#include <linux/mutex.h>
> > +#include <linux/slab.h>
> > +#include <linux/string.h>
> > +#include <linux/types.h>
> > +
> > +#include "regs/xe_sysctrl_regs.h"
> > +#include "xe_device.h"
> > +#include "xe_mmio.h"
> > +#include "xe_pm.h"
> > +#include "xe_printk.h"
> > +#include "xe_sysctrl.h"
> > +#include "xe_sysctrl_mailbox.h"
> > +#include "xe_sysctrl_types.h"
> > +
> > +static bool xe_sysctrl_mailbox_wait_bit_clear(struct xe_sysctrl *sc, u32 bit_mask,
> > +					      unsigned int timeout_ms)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +	int ret;
> > +
> > +	ret = xe_mmio_wait32_not(mmio, SC_MB_CTRL, bit_mask, bit_mask,
> > +				 timeout_ms * 1000, NULL, false);
> > +
> > +	return ret == 0;
> > +}
> > +
> > +static bool xe_sysctrl_mailbox_wait_bit_set(struct xe_sysctrl *sc, u32 bit_mask,
> > +					    unsigned int timeout_ms)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +	int ret;
> > +
> > +	ret = xe_mmio_wait32(mmio, SC_MB_CTRL, bit_mask, bit_mask,
> > +			     timeout_ms * 1000, NULL, false);
> > +
> > +	return ret == 0;
> > +}
> > +
> > +static int xe_sysctrl_mailbox_write_frame(struct xe_sysctrl *sc, const void *frame,
> > +					  size_t len)
> > +{
> > +	static const struct xe_reg regs[] = {
> > +		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
> > +	};
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
> > +	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
> > +	u32 i;
> > +
> > +	memcpy(val, frame, len);
> > +
> > +	for (i = 0; i < dw; i++)
> > +		xe_mmio_write32(mmio, regs[i], val[i]);
> > +
> > +	return 0;
> > +}
> > +
> > +static int xe_sysctrl_mailbox_read_frame(struct xe_sysctrl *sc, void *frame,
> > +					 size_t len)
> > +{
> > +	static const struct xe_reg regs[] = {
> > +		SC_MB_DATA0, SC_MB_DATA1, SC_MB_DATA2, SC_MB_DATA3
> > +	};
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +	u32 val[SC_MB_FRAME_SIZE / sizeof(u32)] = {0};
> > +	u32 dw = DIV_ROUND_UP(len, sizeof(u32));
> > +	u32 i;
> > +
> > +	for (i = 0; i < dw; i++)
> > +		val[i] = xe_mmio_read32(mmio, regs[i]);
> > +
> > +	memcpy(frame, val, len);
> > +
> > +	return 0;
> > +}
> > +
> > +static void xe_sysctrl_mailbox_clear_response(struct xe_sysctrl *sc)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +
> > +	xe_mmio_rmw32(mmio, SC_MB_CTRL, SC_MB_CTRL_RUN_BUSY_OUT, 0);
> > +}
> > +
> > +static int xe_sysctrl_mailbox_prepare_command(struct xe_sysctrl *sc,
> > +					      u8 group_id, u8 command,
> > +					      const void *data_in, size_t data_in_len,
> > +					      u8 **mbox_cmd, size_t *cmd_size)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> > +	size_t size;
> > +	u8 *buffer;
> > +
> > +	size = sizeof(*mkhi_hdr) + data_in_len;
> > +	if (size > SC_MB_MAX_MESSAGE_SIZE) {
> > +		xe_err(xe, "sysctrl: Message too large: %zu bytes\n", size);
> > +		return -EINVAL;
> > +	}
> > +
> > +	buffer = kmalloc(size, GFP_KERNEL);
> > +	if (!buffer)
> > +		return -ENOMEM;
> > +
> > +	mkhi_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)buffer;
> > +	mkhi_hdr->data = cpu_to_le32(FIELD_PREP(MKHI_HDR_GROUP_ID_MASK, group_id) |
> > +				     FIELD_PREP(MKHI_HDR_COMMAND_MASK, command & 0x7F) |
> > +				     FIELD_PREP(MKHI_HDR_IS_RESPONSE, 0) |
> > +				     FIELD_PREP(MKHI_HDR_RESERVED_MASK, 0) |
> > +				     FIELD_PREP(MKHI_HDR_RESULT_MASK, 0));
> > +
> > +	if (data_in && data_in_len)
> > +		memcpy(buffer + sizeof(*mkhi_hdr), data_in, data_in_len);
> > +
> > +	*mbox_cmd = buffer;
> > +	*cmd_size = size;
> > +
> > +	return 0;
> > +}
> 
> In all the functions above, you do not use the sc pointer at all, so  why
> not just pass xe to the functions? If you do that, then in most functions
> below you will not use sc pointer and you can do away with the sc_to_xe
> conversion altogether and pass xe everywhere. Note that you only need the sc
> object in
> 
> xe_sysctrl_init()
> xe_sysctrl_mailbox_send_frames()
> xe_sysctrl_mailbox_init()
> 
> > +
> > +static int xe_sysctrl_mailbox_send_frames(struct xe_sysctrl *sc, const u8 *mbox_cmd,
> > +					  size_t cmd_size, unsigned int timeout_ms)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +	u32 ctrl_reg, total_frames, frame;
> > +	size_t bytes_sent, frame_size;
> > +
> > +	total_frames = DIV_ROUND_UP(cmd_size, SC_MB_FRAME_SIZE);
> > +
> > +	if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
> > +		xe_err(xe, "sysctrl: Mailbox busy\n");
> > +		return -EBUSY;
> > +	}
> > +
> > +	sc->phase_bit ^= 1;
> > +	bytes_sent = 0;
> > +
> > +	for (frame = 0; frame < total_frames; frame++) {
> > +		frame_size = min(cmd_size - bytes_sent, (size_t)SC_MB_FRAME_SIZE);
> > +
> > +		if (xe_sysctrl_mailbox_write_frame(sc, mbox_cmd + bytes_sent, frame_size)) {
> > +			xe_err(xe, "sysctrl: Failed to write frame %u\n", frame);
> > +			sc->phase_bit ^= 1;
> > +			return -EIO;
> > +		}
> > +
> > +		ctrl_reg = SC_MB_CTRL_RUN_BUSY |
> > +			   FIELD_PREP(MKHI_FRAME_CURRENT_MASK, frame) |
> > +			   FIELD_PREP(MKHI_FRAME_TOTAL_MASK, total_frames - 1) |
> > +			   FIELD_PREP(MKHI_FRAME_COMMAND_MASK, SC_MKHI_COMMAND) |
> > +			   (sc->phase_bit ? MKHI_FRAME_PHASE : 0);
> > +
> > +		xe_mmio_write32(mmio, SC_MB_CTRL, ctrl_reg);
> > +
> > +		if (!xe_sysctrl_mailbox_wait_bit_clear(sc, SC_MB_CTRL_RUN_BUSY, timeout_ms)) {
> > +			xe_err(xe, "sysctrl: Frame %u acknowledgment timeout\n", frame);
> > +			return -ETIMEDOUT;
> > +		}
> > +
> > +		bytes_sent += frame_size;
> > +	}
> > +
> > +	return 0;
> > +}
> > +
> > +static int xe_sysctrl_mailbox_process_first_frame(struct xe_sysctrl *sc,
> > +						  const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
> > +						  void *out,
> > +						  size_t frame_size,
> > +						  size_t *payload_bytes)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	u32 frame_data[4];
> > +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *resp_hdr;
> > +	size_t hdr_size = sizeof(*resp_hdr);
> > +	size_t payload_size;
> > +	int ret;
> 
> I would rearrange the variables in decreasing line length. Not a coding
> guideline, but is generally advised to do so.
> 
> struct xe_sysctrl_mailbox_mkhi_msg_hdr *resp_hdr;
> struct xe_device *xe = sc_to_xe(sc);
> size_t hdr_size = sizeof(*resp_hdr);
> size_t payload_size;
> u32 frame_data[4];
> int ret;
> 
> Also, please avoid hardcoded 4 in frame_data dimension. It could be
> frame_data[SC_MB_FRAME_SIZE / sizeof(u32)]
> 
> > +
> > +	ret = xe_sysctrl_mailbox_read_frame(sc, frame_data, frame_size);
> > +	if (ret)
> > +		return ret;
> > +
> > +	resp_hdr = (struct xe_sysctrl_mailbox_mkhi_msg_hdr *)frame_data;
> > +
> > +	if (!XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(resp_hdr) ||
> > +	    XE_SYSCTRL_MKHI_HDR_GROUP_ID(resp_hdr) != XE_SYSCTRL_MKHI_HDR_GROUP_ID(req) ||
> > +	    XE_SYSCTRL_MKHI_HDR_COMMAND(resp_hdr) != XE_SYSCTRL_MKHI_HDR_COMMAND(req)) {
> > +		xe_err(xe, "SC: Response header mismatch\n");
> > +		return -EPROTO;
> > +	}
> > +
> > +	if (XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr) != 0) {
> > +		xe_err(xe, "SC: Firmware error: 0x%02lx\n",
> > +		       XE_SYSCTRL_MKHI_HDR_RESULT(resp_hdr));
> > +		return -EIO;
> > +	}
> > +
> > +	payload_size = frame_size - hdr_size;
> > +	if (payload_size > 0)
> > +		memcpy(out, (u8 *)frame_data + hdr_size, payload_size);
> > +
> > +	*payload_bytes = payload_size;
> > +
> > +	xe_sysctrl_mailbox_clear_response(sc);
> > +
> > +	return 0;
> > +}
> > +
> > +static int xe_sysctrl_mailbox_process_frame(struct xe_sysctrl *sc,
> > +					    void *out, size_t frame_size,
> > +					    unsigned int timeout_ms)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	int ret;
> > +
> > +	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
> > +		xe_err(xe, "sysctrl: Response frame timeout\n");
> > +		return -ETIMEDOUT;
> > +	}
> > +
> > +	ret = xe_sysctrl_mailbox_read_frame(sc, out, frame_size);
> > +	if (ret)
> > +		return ret;
> > +
> > +	xe_sysctrl_mailbox_clear_response(sc);
> > +
> > +	return 0;
> > +}
> > +
> > +static int xe_sysctrl_mailbox_receive_frames(struct xe_sysctrl *sc,
> > +					     const struct xe_sysctrl_mailbox_mkhi_msg_hdr *req,
> > +					     void *data_out, size_t data_out_len,
> > +					     size_t *rdata_len, unsigned int timeout_ms)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +	struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> > +	u32 ctrl_reg, total_frames, frame;
> > +	size_t hdr_size = sizeof(*mkhi_hdr);
> > +	u8 *out = data_out;
> > +	size_t received = 0;
> > +	size_t frame_size;
> > +	int ret = 0;
> > +
> > +	if (!xe_sysctrl_mailbox_wait_bit_set(sc, SC_MB_CTRL_RUN_BUSY_OUT, timeout_ms)) {
> > +		xe_err(xe, "sysctrl: Response frame 0 timeout\n");
> > +		return -ETIMEDOUT;
> > +	}
> > +
> > +	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
> > +	total_frames = FIELD_GET(MKHI_FRAME_TOTAL_MASK, ctrl_reg) + 1;
> > +
> > +	if (total_frames == 1)
> > +		frame_size = min(hdr_size + data_out_len, (size_t)SC_MB_FRAME_SIZE);
> > +	else
> > +		frame_size = SC_MB_FRAME_SIZE;
> > +
> > +	ret = xe_sysctrl_mailbox_process_first_frame(sc, req, out, frame_size, &received);
> > +	if (ret)
> > +		return ret;
> > +
> > +	out += received;
> > +
> > +	for (frame = 1; frame < total_frames; frame++) {
> > +		size_t remaining = data_out_len - received;
> > +
> > +		frame_size = min_t(size_t, remaining, SC_MB_FRAME_SIZE);
> > +
> > +		ret = xe_sysctrl_mailbox_process_frame(sc, out, frame_size, timeout_ms);
> > +		if (ret)
> > +			break;
> > +
> > +		received += frame_size;
> > +		out += frame_size;
> > +	}
> 
> I fell there should be a simpler way to implement this function. I will get
> back if I can think of anything.
> 
> > +
> > +	*rdata_len = received;
> > +
> > +	return ret;
> > +}
> > +
> > +static int xe_sysctrl_mailbox_send_command(struct xe_sysctrl *sc,
> > +					   const u8 *mbox_cmd, size_t cmd_size,
> > +					   void *data_out, size_t data_out_len,
> > +					   size_t *rdata_len, unsigned int timeout_ms)
> > +{
> > +	const struct xe_sysctrl_mailbox_mkhi_msg_hdr *mkhi_hdr;
> > +	size_t received;
> > +	int ret;
> > +
> > +	ret = xe_sysctrl_mailbox_send_frames(sc, mbox_cmd, cmd_size, timeout_ms);
> > +	if (ret)
> > +		return ret;
> > +
> > +	if (!data_out || !rdata_len)
> > +		return 0;
> > +
> > +	mkhi_hdr = (const struct xe_sysctrl_mailbox_mkhi_msg_hdr *)mbox_cmd;
> > +
> > +	ret = xe_sysctrl_mailbox_receive_frames(sc, mkhi_hdr, data_out, data_out_len,
> > +						&received, timeout_ms);
> > +	if (ret)
> > +		return ret;
> > +
> > +	*rdata_len = received;
> > +
> > +	return 0;
> > +}
> > +
> > +/**
> > + * xe_sysctrl_send_command - Send command to System Controller via mailbox
> > + * @handle: XE device handle
> > + * @cmd_buffer: Pointer to xe_sysctrl_mailbox_command structure
> > + * @rdata_len: Pointer to store actual response data size (can be NULL)
> > + *
> > + * Send a command to the System Controller using MKHI protocol. Handles
> > + * command preparation, fragmentation, transmission, and response reception.
> > + *
> > + * Return: 0 on success, negative error code on failure
> > + */
> > +int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len)
> > +{
> > +	struct xe_device *xe = handle;
> > +	struct xe_sysctrl *sc = &xe->sc;
> > +	struct xe_sysctrl_mailbox_command *cmd = cmd_buffer;
> > +	u8 *mbox_cmd = NULL;
> > +	size_t cmd_size = 0;
> > +	u8 group_id, command_code;
> > +	int ret = 0;
> > +
> > +	if (!xe) {
> > +		pr_err("sysctrl: Invalid device handle\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (!cmd) {
> > +		xe_err(xe, "sysctrl: Invalid command buffer\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (!xe->info.has_sysctrl)
> > +		return -ENODEV;
> > +
> > +	group_id = XE_SYSCTRL_APP_HDR_GROUP_ID(&cmd->header);
> > +	command_code = XE_SYSCTRL_APP_HDR_COMMAND(&cmd->header);
> > +
> > +	if (!cmd->data_in && cmd->data_in_len) {
> > +		xe_err(xe, "sysctrl: Invalid input parameters\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	if (!cmd->data_out && cmd->data_out_len) {
> > +		xe_err(xe, "sysctrl: Invalid output parameters\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	might_sleep();
> > +
> > +	ret = xe_sysctrl_mailbox_prepare_command(sc, group_id, command_code,
> > +						 cmd->data_in, cmd->data_in_len,
> > +						 &mbox_cmd, &cmd_size);
> > +	if (ret) {
> > +		xe_err(xe, "sysctrl: Failed to prepare command: %d\n", ret);
> > +		return ret;
> > +	}
> > +
> > +	guard(xe_pm_runtime)(xe);
> > +
> > +	guard(mutex)(&sc->cmd_lock);
> > +
> > +	ret = xe_sysctrl_mailbox_send_command(sc, mbox_cmd, cmd_size,
> > +					      cmd->data_out, cmd->data_out_len, rdata_len,
> > +					      SC_MB_DEFAULT_TIMEOUT_MS);
> > +	if (ret)
> > +		xe_err(xe, "sysctrl: Mailbox command failed: %d\n", ret);
> > +
> > +	kfree(mbox_cmd);
> > +
> > +	return ret;
> > +}
> > +
> > +/**
> > + * xe_sysctrl_mailbox_init - Initialize the System Controller mailbox state
> > + * @sc: System controller structure
> > + */
> > +void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc)
> > +{
> > +	struct xe_device *xe = sc_to_xe(sc);
> > +	struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> > +	u32 ctrl_reg;
> > +
> > +	ctrl_reg = xe_mmio_read32(mmio, SC_MB_CTRL);
> > +	sc->phase_bit = (ctrl_reg & MKHI_FRAME_PHASE) ? 1 : 0;
> > +
> > +	xe_mmio_rmw32(mmio, SC_MB_CTRL, MKHI_FRAME_PHASE, 0);
> > +}
> > diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> > new file mode 100644
> > index 000000000000..3e472418ebd0
> > --- /dev/null
> > +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h
> > @@ -0,0 +1,77 @@
> > +/* SPDX-License-Identifier: MIT */
> > +/*
> > + * Copyright © 2026 Intel Corporation
> > + */
> > +
> > +#ifndef __XE_SYSCTRL_MAILBOX_H__
> > +#define __XE_SYSCTRL_MAILBOX_H__
> > +
> > +#include <linux/bitfield.h>
> > +#include <linux/types.h>
> > +
> > +struct xe_sysctrl;
> > +
> > +#define MKHI_HDR_GROUP_ID_MASK		GENMASK(7, 0)
> > +#define MKHI_HDR_COMMAND_MASK		GENMASK(14, 8)
> > +#define MKHI_HDR_IS_RESPONSE		BIT(15)
> > +#define MKHI_HDR_RESERVED_MASK		GENMASK(23, 16)
> > +#define MKHI_HDR_RESULT_MASK		GENMASK(31, 24)
> 
> Same comment as (2) above. If the MKHI defines are solely used by
> xe_sysctrl_mailbox.c, then you can just move them there. I assume that the
> app is only using the APP_HDR and is not concerned with the underlying
> protocol/transport.
> 
> > +
> > +struct xe_sysctrl_mailbox_mkhi_msg_hdr {
> > +	__le32 data;
> > +} __packed;
> > +
> > +#define APP_HDR_GROUP_ID_MASK		GENMASK(7, 0)
> > +#define APP_HDR_COMMAND_MASK		GENMASK(15, 8)
> > +#define APP_HDR_VERSION_MASK		GENMASK(23, 16)
> > +#define APP_HDR_RESERVED_MASK		GENMASK(31, 24)
> > +
> > +struct xe_sysctrl_mailbox_app_msg_hdr {
> > +	__le32 data;
> > +} __packed;
> > +
> > +#define XE_SYSCTRL_APP_HDR_GROUP_ID(hdr) \
> > +	FIELD_GET(APP_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
> > +
> > +#define XE_SYSCTRL_APP_HDR_COMMAND(hdr) \
> > +	FIELD_GET(APP_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
> > +
> > +#define XE_SYSCTRL_APP_HDR_VERSION(hdr) \
> > +	FIELD_GET(APP_HDR_VERSION_MASK, le32_to_cpu((hdr)->data))
> > +
> > +#define XE_SYSCTRL_MKHI_HDR_GROUP_ID(hdr) \
> > +	FIELD_GET(MKHI_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data))
> > +
> > +#define XE_SYSCTRL_MKHI_HDR_COMMAND(hdr) \
> > +	FIELD_GET(MKHI_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data))
> > +
> > +#define XE_SYSCTRL_MKHI_HDR_IS_RESPONSE(hdr) \
> > +	FIELD_GET(MKHI_HDR_IS_RESPONSE, le32_to_cpu((hdr)->data))
> > +
> > +#define XE_SYSCTRL_MKHI_HDR_RESULT(hdr) \
> > +	FIELD_GET(MKHI_HDR_RESULT_MASK, le32_to_cpu((hdr)->data))
> 
> Same here. MKHI defines can move to the C file. Either that or the APP api
> can be moved to a separate header - xe_sysctrl_mailbox_api.h.
> 
> Regards,
> Umesh
> 
> > +
> > +/**
> > + * struct xe_sysctrl_mailbox_command - System Controller mailbox command structure
> > + */
> > +struct xe_sysctrl_mailbox_command {
> > +	/** @header: Application message header containing command information */
> > +	struct xe_sysctrl_mailbox_app_msg_hdr header;
> > +
> > +	/** @data_in: Pointer to input payload data (can be NULL if no input data) */
> > +	void *data_in;
> > +
> > +	/** @data_in_len: Size of input payload in bytes (0 if no input data) */
> > +	size_t data_in_len;
> > +
> > +	/** @data_out: Pointer to output buffer for response data (can be NULL if no response) */
> > +	void *data_out;
> > +
> > +	/** @data_out_len: Size of output buffer in bytes (0 if no response expected) */
> > +	size_t data_out_len;
> > +};
> > +
> > +void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc);
> > +int xe_sysctrl_send_command(void *handle, void *cmd_buffer, size_t *rdata_len);

The above function looks to be unused too.

Also why 'void *handle' rather than xe_device or xe_sysctrl?

Matt

> > +
> > +#endif /* __XE_SYSCTRL_MAILBOX_H__ */
> > diff --git a/drivers/gpu/drm/xe/xe_sysctrl_types.h b/drivers/gpu/drm/xe/xe_sysctrl_types.h
> > new file mode 100644
> > index 000000000000..88a34967688b
> > --- /dev/null
> > +++ b/drivers/gpu/drm/xe/xe_sysctrl_types.h
> > @@ -0,0 +1,23 @@
> > +/* SPDX-License-Identifier: MIT */
> > +/*
> > + * Copyright © 2026 Intel Corporation
> > + */
> > +
> > +#ifndef _XE_SYSCTRL_TYPES_H_
> > +#define _XE_SYSCTRL_TYPES_H_
> > +
> > +#include <linux/mutex.h>
> > +#include <linux/types.h>
> > +
> > +/**
> > + * struct xe_sysctrl - System Controller driver context
> > + */
> > +struct xe_sysctrl {
> > +	/** @cmd_lock: Mutex protecting mailbox command operations */
> > +	struct mutex cmd_lock;
> > +
> > +	/** @phase_bit: MKHI message boundary phase toggle bit */
> > +	u32 phase_bit;
> > +};
> > +
> > +#endif /* _XE_SYSCTRL_TYPES_H_ */
> > -- 
> > 2.43.0
> > 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-01-07  1:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-02 16:54 [PATCH v2 0/1] drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms Anoop, Vijay
2026-01-02 16:54 ` [PATCH v2 1/1] " Anoop, Vijay
2026-01-02 23:15   ` Matthew Brost
2026-01-05  6:29   ` Riana Tauro
2026-01-06 18:37   ` Umesh Nerlige Ramappa
2026-01-07  1:24     ` Matthew Brost
2026-01-02 17:01 ` ✗ CI.checkpatch: warning for drm/xe/sysctrl: Add system controller component for Xe3p dGPU platforms (rev2) Patchwork
2026-01-02 17:02 ` ✓ CI.KUnit: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox