From b15a952c52a6825376d3e7f6c1bf5c886c6d8b74 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 12:06:00 +0200 Subject: Adding debian version 5.10.209-2. Signed-off-by: Daniel Baumann --- .../0054-drm-ttm-Replace-kmap_atomic-usage.patch | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 debian/patches-rt/0054-drm-ttm-Replace-kmap_atomic-usage.patch (limited to 'debian/patches-rt/0054-drm-ttm-Replace-kmap_atomic-usage.patch') diff --git a/debian/patches-rt/0054-drm-ttm-Replace-kmap_atomic-usage.patch b/debian/patches-rt/0054-drm-ttm-Replace-kmap_atomic-usage.patch new file mode 100644 index 000000000..3043aa642 --- /dev/null +++ b/debian/patches-rt/0054-drm-ttm-Replace-kmap_atomic-usage.patch @@ -0,0 +1,74 @@ +From 818c332a89ac4310c59f7ad122bdb4a6e0aac518 Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner +Date: Tue, 3 Nov 2020 10:27:43 +0100 +Subject: [PATCH 054/323] drm/ttm: Replace kmap_atomic() usage +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz + +There is no reason to disable pagefaults and preemption as a side effect of +kmap_atomic_prot(). + +Use kmap_local_page_prot() instead and document the reasoning for the +mapping usage with the given pgprot. + +Remove the NULL pointer check for the map. These functions return a valid +address for valid pages and the return was bogus anyway as it would have +left preemption and pagefaults disabled. + +Signed-off-by: Thomas Gleixner +Cc: Christian Koenig +Cc: Huang Rui +Cc: David Airlie +Cc: Daniel Vetter +Cc: dri-devel@lists.freedesktop.org +Signed-off-by: Sebastian Andrzej Siewior +--- + drivers/gpu/drm/ttm/ttm_bo_util.c | 20 ++++++++++++-------- + 1 file changed, 12 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c +index 1968df9743fc..79b9c883431a 100644 +--- a/drivers/gpu/drm/ttm/ttm_bo_util.c ++++ b/drivers/gpu/drm/ttm/ttm_bo_util.c +@@ -181,13 +181,15 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src, + return -ENOMEM; + + src = (void *)((unsigned long)src + (page << PAGE_SHIFT)); +- dst = kmap_atomic_prot(d, prot); +- if (!dst) +- return -ENOMEM; ++ /* ++ * 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); + + memcpy_fromio(dst, src, PAGE_SIZE); + +- kunmap_atomic(dst); ++ kunmap_local(dst); + + return 0; + } +@@ -203,13 +205,15 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, + return -ENOMEM; + + dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT)); +- src = kmap_atomic_prot(s, prot); +- if (!src) +- return -ENOMEM; ++ /* ++ * 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); + + memcpy_toio(dst, src, PAGE_SIZE); + +- kunmap_atomic(src); ++ kunmap_local(src); + + return 0; + } +-- +2.43.0 + -- cgit v1.2.3