Hi all,
Today's linux-next merge of the drm tree got a conflict in:
drivers/gpu/drm/xe/xe_gt_ccs_mode.c
between commit:
65d046b2d8e0d ("drm/xe: Fix missing runtime PM reference in ccs_mode_store")
from the origin tree and commit:
9b5e995e61290 ("drm/xe: Mutual exclusivity between CCS-mode and PF")
from the drm tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/gpu/drm/xe/xe_gt_ccs_mode.c
index 03c1862ba497a,b35be36b0eaa2..0000000000000
--- a/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
+++ b/drivers/gpu/drm/xe/xe_gt_ccs_mode.c
@@@ -12,8 -12,8 +12,9 @@@
#include "xe_gt_printk.h"
#include "xe_gt_sysfs.h"
#include "xe_mmio.h"
+#include "xe_pm.h"
#include "xe_sriov.h"
+ #include "xe_sriov_pf.h"
static void __xe_gt_apply_ccs_mode(struct xe_gt *gt, u32 num_engines)
{
@@@ -147,15 -145,29 +146,30 @@@ ccs_mode_store(struct device *kdev, str
return -EBUSY;
}
- if (gt->ccs_mode != num_engines) {
- 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);
+ if (gt->ccs_mode == num_engines)
+ return count;
+
+ /*
+ * Changing default CCS mode is only allowed when there
+ * are no VFs. Try to lockdown PF to find out.
+ */
+ if (gt_ccs_mode_default(gt) && IS_SRIOV_PF(xe)) {
+ ret = xe_sriov_pf_lockdown(xe);
+ if (ret) {
+ xe_gt_dbg(gt, "Can't change CCS Mode: VFs are enabled\n");
+ return ret;
+ }
}
- mutex_unlock(&xe->drm.filelist_mutex);
+ 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);
+
+ /* We may end PF lockdown once CCS mode is default again */
+ if (gt_ccs_mode_default(gt) && IS_SRIOV_PF(xe))
+ xe_sriov_pf_end_lockdown(xe);
return count;
}
© 2016 - 2026 Red Hat, Inc.