Commit 7fa68b9f authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-xe-fixes-2025-02-06' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes



UAPI Changes:
 - OA uAPI related fixes (Ashutosh)

Driver Changes:
 - Fix SRIOV migration initialization (Michal)
 - Restore devcoredump to a sane state (Lucas)

Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Z6S9rI1ScT_5Aw6_@intel.com
parents e92e11b4 a9ab6591
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -51,6 +51,10 @@
/* Common to all OA units */
#define  OA_OACONTROL_REPORT_BC_MASK		REG_GENMASK(9, 9)
#define  OA_OACONTROL_COUNTER_SIZE_MASK		REG_GENMASK(8, 8)
#define  OAG_OACONTROL_USED_BITS \
	(OAG_OACONTROL_OA_PES_DISAG_EN | OAG_OACONTROL_OA_CCS_SELECT_MASK | \
	 OAG_OACONTROL_OA_COUNTER_SEL_MASK | OAG_OACONTROL_OA_COUNTER_ENABLE | \
	 OA_OACONTROL_REPORT_BC_MASK | OA_OACONTROL_COUNTER_SIZE_MASK)

#define OAG_OA_DEBUG XE_REG(0xdaf8, XE_REG_OPTION_MASKED)
#define  OAG_OA_DEBUG_DISABLE_MMIO_TRG			REG_BIT(14)
@@ -78,6 +82,8 @@
#define OAM_CONTEXT_CONTROL_OFFSET		(0x1bc)
#define OAM_CONTROL_OFFSET			(0x194)
#define  OAM_CONTROL_COUNTER_SEL_MASK		REG_GENMASK(3, 1)
#define  OAM_OACONTROL_USED_BITS \
	(OAM_CONTROL_COUNTER_SEL_MASK | OAG_OACONTROL_OA_COUNTER_ENABLE)
#define OAM_DEBUG_OFFSET			(0x198)
#define OAM_STATUS_OFFSET			(0x19c)
#define OAM_MMIO_TRG_OFFSET			(0x1d0)
+14 −26
Original line number Diff line number Diff line
@@ -119,11 +119,7 @@ static ssize_t __xe_devcoredump_read(char *buffer, size_t count,
	drm_puts(&p, "\n**** GuC CT ****\n");
	xe_guc_ct_snapshot_print(ss->guc.ct, &p);

	/*
	 * Don't add a new section header here because the mesa debug decoder
	 * tool expects the context information to be in the 'GuC CT' section.
	 */
	/* drm_puts(&p, "\n**** Contexts ****\n"); */
	drm_puts(&p, "\n**** Contexts ****\n");
	xe_guc_exec_queue_snapshot_print(ss->ge, &p);

	drm_puts(&p, "\n**** Job ****\n");
@@ -395,42 +391,34 @@ int xe_devcoredump_init(struct xe_device *xe)
/**
 * xe_print_blob_ascii85 - print a BLOB to some useful location in ASCII85
 *
 * The output is split to multiple lines because some print targets, e.g. dmesg
 * cannot handle arbitrarily long lines. Note also that printing to dmesg in
 * piece-meal fashion is not possible, each separate call to drm_puts() has a
 * line-feed automatically added! Therefore, the entire output line must be
 * constructed in a local buffer first, then printed in one atomic output call.
 * The output is split into multiple calls to drm_puts() because some print
 * targets, e.g. dmesg, cannot handle arbitrarily long lines. These targets may
 * add newlines, as is the case with dmesg: each drm_puts() call creates a
 * separate line.
 *
 * There is also a scheduler yield call to prevent the 'task has been stuck for
 * 120s' kernel hang check feature from firing when printing to a slow target
 * such as dmesg over a serial port.
 *
 * TODO: Add compression prior to the ASCII85 encoding to shrink huge buffers down.
 *
 * @p: the printer object to output to
 * @prefix: optional prefix to add to output string
 * @suffix: optional suffix to add at the end. 0 disables it and is
 *          not added to the output, which is useful when using multiple calls
 *          to dump data to @p
 * @blob: the Binary Large OBject to dump out
 * @offset: offset in bytes to skip from the front of the BLOB, must be a multiple of sizeof(u32)
 * @size: the size in bytes of the BLOB, must be a multiple of sizeof(u32)
 */
void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix, char suffix,
			   const void *blob, size_t offset, size_t size)
{
	const u32 *blob32 = (const u32 *)blob;
	char buff[ASCII85_BUFSZ], *line_buff;
	size_t line_pos = 0;

	/*
	 * Splitting blobs across multiple lines is not compatible with the mesa
	 * debug decoder tool. Note that even dropping the explicit '\n' below
	 * doesn't help because the GuC log is so big some underlying implementation
	 * still splits the lines at 512K characters. So just bail completely for
	 * the moment.
	 */
	return;

#define DMESG_MAX_LINE_LEN	800
#define MIN_SPACE		(ASCII85_BUFSZ + 2)		/* 85 + "\n\0" */
	/* Always leave space for the suffix char and the \0 */
#define MIN_SPACE		(ASCII85_BUFSZ + 2)	/* 85 + "<suffix>\0" */

	if (size & 3)
		drm_printf(p, "Size not word aligned: %zu", size);
@@ -462,7 +450,6 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
		line_pos += strlen(line_buff + line_pos);

		if ((line_pos + MIN_SPACE) >= DMESG_MAX_LINE_LEN) {
			line_buff[line_pos++] = '\n';
			line_buff[line_pos++] = 0;

			drm_puts(p, line_buff);
@@ -474,10 +461,11 @@ void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
		}
	}

	if (suffix)
		line_buff[line_pos++] = suffix;

	if (line_pos) {
		line_buff[line_pos++] = '\n';
		line_buff[line_pos++] = 0;

		drm_puts(p, line_buff);
	}

+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ static inline int xe_devcoredump_init(struct xe_device *xe)
}
#endif

void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix,
void xe_print_blob_ascii85(struct drm_printer *p, const char *prefix, char suffix,
			   const void *blob, size_t offset, size_t size);

#endif
+3 −1
Original line number Diff line number Diff line
@@ -532,8 +532,10 @@ static int all_fw_domain_init(struct xe_gt *gt)
	if (IS_SRIOV_PF(gt_to_xe(gt)) && !xe_gt_is_media_type(gt))
		xe_lmtt_init_hw(&gt_to_tile(gt)->sriov.pf.lmtt);

	if (IS_SRIOV_PF(gt_to_xe(gt)))
	if (IS_SRIOV_PF(gt_to_xe(gt))) {
		xe_gt_sriov_pf_init(gt);
		xe_gt_sriov_pf_init_hw(gt);
	}

	xe_force_wake_put(gt_to_fw(gt), fw_ref);

+13 −1
Original line number Diff line number Diff line
@@ -68,6 +68,19 @@ int xe_gt_sriov_pf_init_early(struct xe_gt *gt)
	return 0;
}

/**
 * xe_gt_sriov_pf_init - Prepare SR-IOV PF data structures on PF.
 * @gt: the &xe_gt to initialize
 *
 * Late one-time initialization of the PF data.
 *
 * Return: 0 on success or a negative error code on failure.
 */
int xe_gt_sriov_pf_init(struct xe_gt *gt)
{
	return xe_gt_sriov_pf_migration_init(gt);
}

static bool pf_needs_enable_ggtt_guest_update(struct xe_device *xe)
{
	return GRAPHICS_VERx100(xe) == 1200;
@@ -90,7 +103,6 @@ void xe_gt_sriov_pf_init_hw(struct xe_gt *gt)
		pf_enable_ggtt_guest_update(gt);

	xe_gt_sriov_pf_service_update(gt);
	xe_gt_sriov_pf_migration_init(gt);
}

static u32 pf_get_vf_regs_stride(struct xe_device *xe)
Loading