-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto update to lts2023-ubuntu v6.6.36-240710T031018Z
Source of patches: eed53fa20 Kernel update 240710T031018Z Signed-off-by: sys_oak <[email protected]>
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
kernel-patches/patches/0001-drm-i915-guc-invalidate-tlb-only-if-guc-submission-is-.drm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
From 4a129142a97f831bbe99a8f9f94921db80d2d885 Mon Sep 17 00:00:00 2001 | ||
From: Junxiao Chang <[email protected]> | ||
Date: Mon, 8 Jul 2024 08:25:39 +0800 | ||
Subject: [PATCH] drm/i915/guc: invalidate tlb only if guc submission is | ||
enabled | ||
MIME-Version: 1.0 | ||
Content-Type: text/plain; charset=UTF-8 | ||
Content-Transfer-Encoding: 8bit | ||
|
||
xa_alloc for guc tlb_lookup is initialized in guc submission. For | ||
some platform which guc submission is not enabled by default, | ||
xa_alloc for guc tlb_lookup might crash kernel. | ||
|
||
Signed-off-by: Krystian Garliński <[email protected]> | ||
Signed-off-by: Junxiao Chang <[email protected]> | ||
--- | ||
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | 8 +++++++- | ||
1 file changed, 7 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | ||
index a84c717981d0..bd524fa3e2a4 100644 | ||
--- a/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | ||
+++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c | ||
@@ -1983,7 +1983,7 @@ static int number_mlrc_guc_id(struct intel_guc *guc); | ||
bool intel_guc_tlb_invalidation_is_available(struct intel_guc *guc) | ||
{ | ||
return HAS_GUC_TLB_INVALIDATION(guc_to_gt(guc)->i915) && | ||
- intel_guc_is_ready(guc); | ||
+ intel_guc_is_ready(guc) && guc_submission_initialized(guc); | ||
} | ||
|
||
static int init_tlb_lookup(struct intel_guc *guc) | ||
@@ -4906,6 +4906,12 @@ static int guc_send_invalidate_tlb(struct intel_guc *guc, | ||
if (!intel_gt_is_enabled(gt)) | ||
return -EINVAL; | ||
|
||
+ /* If guc submission is not initialized, guc tlb lookup couldn't be | ||
+ * accessed either. | ||
+ */ | ||
+ if (!guc_submission_initialized(guc)) | ||
+ return -EINVAL; | ||
+ | ||
init_waitqueue_head(&_wq.wq); | ||
|
||
if (xa_alloc_cyclic_irq(&guc->tlb_lookup, &seqno, wq, | ||
-- | ||
2.34.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters