Commit a6e77320 authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-xe-fixes-2026-03-19' of https://gitlab.freedesktop.org/drm/xe/kernel into drm-fixes



Driver Changes:
- A number of teardown fixes (Daniele, Matt Brost, Zhanjun, Ashutosh)
- Skip over non-leaf PTE for PRL generation  (Brian)
- Fix an unitialized variable (Umesh)
- Fix a missing runtime PM reference (Sanjay)

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

From: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/abxj4_dBHYBiSvDG@fedora
parents a15130d5 65d046b2
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -313,6 +313,8 @@ static void dev_fini_ggtt(void *arg)
{
	struct xe_ggtt *ggtt = arg;

	scoped_guard(mutex, &ggtt->lock)
		ggtt->flags &= ~XE_GGTT_FLAGS_ONLINE;
	drain_workqueue(ggtt->wq);
}

@@ -377,6 +379,7 @@ int xe_ggtt_init_early(struct xe_ggtt *ggtt)
	if (err)
		return err;

	ggtt->flags |= XE_GGTT_FLAGS_ONLINE;
	err = devm_add_action_or_reset(xe->drm.dev, dev_fini_ggtt, ggtt);
	if (err)
		return err;
@@ -410,13 +413,10 @@ static void xe_ggtt_initial_clear(struct xe_ggtt *ggtt)
static void ggtt_node_remove(struct xe_ggtt_node *node)
{
	struct xe_ggtt *ggtt = node->ggtt;
	struct xe_device *xe = tile_to_xe(ggtt->tile);
	bool bound;
	int idx;

	bound = drm_dev_enter(&xe->drm, &idx);

	mutex_lock(&ggtt->lock);
	bound = ggtt->flags & XE_GGTT_FLAGS_ONLINE;
	if (bound)
		xe_ggtt_clear(ggtt, node->base.start, node->base.size);
	drm_mm_remove_node(&node->base);
@@ -429,8 +429,6 @@ static void ggtt_node_remove(struct xe_ggtt_node *node)
	if (node->invalidate_on_remove)
		xe_ggtt_invalidate(ggtt);

	drm_dev_exit(idx);

free_node:
	xe_ggtt_node_fini(node);
}
+4 −1
Original line number Diff line number Diff line
@@ -29,10 +29,13 @@ struct xe_ggtt {
	u64 size;

#define XE_GGTT_FLAGS_64K       BIT(0)
#define XE_GGTT_FLAGS_ONLINE	BIT(1)
	/**
	 * @flags: Flags for this GGTT
	 * Acceptable flags:
	 * - %XE_GGTT_FLAGS_64K - if PTE size is 64K. Otherwise, regular is 4K.
	 * - %XE_GGTT_FLAGS_ONLINE - is GGTT online, protected by ggtt->lock
	 *   after init
	 */
	unsigned int flags;
	/** @scratch: Internal object allocation used as a scratch page */
+2 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include "xe_gt_printk.h"
#include "xe_gt_sysfs.h"
#include "xe_mmio.h"
#include "xe_pm.h"
#include "xe_sriov.h"

static void __xe_gt_apply_ccs_mode(struct xe_gt *gt, u32 num_engines)
@@ -150,6 +151,7 @@ ccs_mode_store(struct device *kdev, struct device_attribute *attr,
		xe_gt_info(gt, "Setting compute mode to %d\n", num_engines);
		gt->ccs_mode = num_engines;
		xe_gt_record_user_engines(gt);
		guard(xe_pm_runtime)(xe);
		xe_gt_reset(gt);
	}

+27 −5
Original line number Diff line number Diff line
@@ -1124,14 +1124,14 @@ static int guc_wait_ucode(struct xe_guc *guc)
	struct xe_guc_pc *guc_pc = &gt->uc.guc.pc;
	u32 before_freq, act_freq, cur_freq;
	u32 status = 0, tries = 0;
	int load_result, ret;
	ktime_t before;
	u64 delta_ms;
	int ret;

	before_freq = xe_guc_pc_get_act_freq(guc_pc);
	before = ktime_get();

	ret = poll_timeout_us(ret = guc_load_done(gt, &status, &tries), ret,
	ret = poll_timeout_us(load_result = guc_load_done(gt, &status, &tries), load_result,
			      10 * USEC_PER_MSEC,
			      GUC_LOAD_TIMEOUT_SEC * USEC_PER_SEC, false);

@@ -1139,7 +1139,7 @@ static int guc_wait_ucode(struct xe_guc *guc)
	act_freq = xe_guc_pc_get_act_freq(guc_pc);
	cur_freq = xe_guc_pc_get_cur_freq_fw(guc_pc);

	if (ret) {
	if (ret || load_result <= 0) {
		xe_gt_err(gt, "load failed: status = 0x%08X, time = %lldms, freq = %dMHz (req %dMHz)\n",
			  status, delta_ms, xe_guc_pc_get_act_freq(guc_pc),
			  xe_guc_pc_get_cur_freq_fw(guc_pc));
@@ -1347,15 +1347,37 @@ int xe_guc_enable_communication(struct xe_guc *guc)
	return 0;
}

int xe_guc_suspend(struct xe_guc *guc)
/**
 * xe_guc_softreset() - Soft reset GuC
 * @guc: The GuC object
 *
 * Send soft reset command to GuC through mmio send.
 *
 * Return: 0 if success, otherwise error code
 */
int xe_guc_softreset(struct xe_guc *guc)
{
	struct xe_gt *gt = guc_to_gt(guc);
	u32 action[] = {
		XE_GUC_ACTION_CLIENT_SOFT_RESET,
	};
	int ret;

	if (!xe_uc_fw_is_running(&guc->fw))
		return 0;

	ret = xe_guc_mmio_send(guc, action, ARRAY_SIZE(action));
	if (ret)
		return ret;

	return 0;
}

int xe_guc_suspend(struct xe_guc *guc)
{
	struct xe_gt *gt = guc_to_gt(guc);
	int ret;

	ret = xe_guc_softreset(guc);
	if (ret) {
		xe_gt_err(gt, "GuC suspend failed: %pe\n", ERR_PTR(ret));
		return ret;
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ int xe_guc_opt_in_features_enable(struct xe_guc *guc);
void xe_guc_runtime_suspend(struct xe_guc *guc);
void xe_guc_runtime_resume(struct xe_guc *guc);
int xe_guc_suspend(struct xe_guc *guc);
int xe_guc_softreset(struct xe_guc *guc);
void xe_guc_notify(struct xe_guc *guc);
int xe_guc_auth_huc(struct xe_guc *guc, u32 rsa_addr);
int xe_guc_mmio_send(struct xe_guc *guc, const u32 *request, u32 len);
Loading