From 6778948f9de86c3cfaf36725a7c87dcff9ba247f Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Mon, 11 Dec 2023 08:20:59 +0000
Subject: [PATCH] kernel_5.10 no rt

---
 kernel/drivers/gpu/drm/ttm/ttm_bo_util.c |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/kernel/drivers/gpu/drm/ttm/ttm_bo_util.c b/kernel/drivers/gpu/drm/ttm/ttm_bo_util.c
index 164b9a0..fb2a25f 100644
--- a/kernel/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/kernel/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -181,15 +181,13 @@
 		return -ENOMEM;
 
 	src = (void *)((unsigned long)src + (page << PAGE_SHIFT));
-	/*
-	 * Ensure that a highmem page is mapped with the correct
-	 * pgprot. For non highmem the mapping is already there.
-	 */
-	dst = kmap_local_page_prot(d, prot);
+	dst = kmap_atomic_prot(d, prot);
+	if (!dst)
+		return -ENOMEM;
 
 	memcpy_fromio(dst, src, PAGE_SIZE);
 
-	kunmap_local(dst);
+	kunmap_atomic(dst);
 
 	return 0;
 }
@@ -205,15 +203,13 @@
 		return -ENOMEM;
 
 	dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT));
-	/*
-	 * Ensure that a highmem page is mapped with the correct
-	 * pgprot. For non highmem the mapping is already there.
-	 */
-	src = kmap_local_page_prot(s, prot);
+	src = kmap_atomic_prot(s, prot);
+	if (!src)
+		return -ENOMEM;
 
 	memcpy_toio(dst, src, PAGE_SIZE);
 
-	kunmap_local(src);
+	kunmap_atomic(src);
 
 	return 0;
 }

--
Gitblit v1.6.2