balena-allwinner/layers/meta-balena-allwinner/recipes-kernel/linux/linux-mainline/armbian/0125-drm-lima-Fix-lima-cache-creation.patch
Vicentiu Galanopulo 7d5f1dbda1 recipes-kernel/linux: Remove unused patches and householding
Some patches were part of other linux-mainline
kernel versions but are not anymore part of the
current 4.19.76.

Move 0001-Enable-uart3-for-NanoPi-Neo-Air-used-by-BT.patch
in linux-mainline_4.19.76.bbappend to avoid error
patching file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts
Hunk #2 FAILED at 162.
1 out of 2 hunks FAILED -- rejects in file arch/arm/boot/dts/sun8i-h3-nanopi-neo-air.dts

Place all patches from Armbian in a separate directory and do all the Balena specific
operations in linux-mainline_%.bbappend only.

Changelog-entry: Remove unused patches and cleanup
Signed-off-by: Vicentiu Galanopulo <vicentiu@balena.io>
2019-10-14 09:43:01 +02:00

56 lines
2 KiB
Diff

From 491af9a7e7ccddb1c3045c7f9cd2990f6d22154f Mon Sep 17 00:00:00 2001
From: Andreas Baierl <ichgeh@imkreisrum.de>
Date: Tue, 16 Oct 2018 03:19:20 -0400
Subject: [PATCH 125/146] drm/lima: Fix lima cache creation
Due to the kernel merge of the hardened usercopy patch set
we have to whitelist the memory area which is used for
copy_from_user actions. Otherwise lima fails with an abort
and segmentation fault.
This is necessary on systems with CONFIG_HARDENED_USERCOPY enabled.
It was tested on a Cubieboard 1, Allwinner A10.
Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de>
---
drivers/gpu/drm/lima/lima_gp.c | 5 +++--
drivers/gpu/drm/lima/lima_pp.c | 5 +++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/lima/lima_gp.c b/drivers/gpu/drm/lima/lima_gp.c
index 706652cb1741..6c902648e5cd 100644
--- a/drivers/gpu/drm/lima/lima_gp.c
+++ b/drivers/gpu/drm/lima/lima_gp.c
@@ -245,9 +245,10 @@ int lima_gp_pipe_init(struct lima_device *dev)
struct lima_sched_pipe *pipe = dev->pipe + lima_pipe_gp;
if (!lima_gp_task_slab) {
- lima_gp_task_slab = kmem_cache_create(
+ lima_gp_task_slab = kmem_cache_create_usercopy(
"lima_gp_task", sizeof(struct lima_sched_task) + frame_size,
- 0, SLAB_HWCACHE_ALIGN, NULL);
+ 0, SLAB_HWCACHE_ALIGN, sizeof(struct lima_sched_task),
+ frame_size, NULL);
if (!lima_gp_task_slab)
return -ENOMEM;
}
diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c
index 3355895ceeba..502190d1bf3f 100644
--- a/drivers/gpu/drm/lima/lima_pp.c
+++ b/drivers/gpu/drm/lima/lima_pp.c
@@ -383,9 +383,10 @@ int lima_pp_pipe_init(struct lima_device *dev)
frame_size = sizeof(struct drm_lima_m450_pp_frame);
if (!lima_pp_task_slab) {
- lima_pp_task_slab = kmem_cache_create(
+ lima_pp_task_slab = kmem_cache_create_usercopy(
"lima_pp_task", sizeof(struct lima_sched_task) + frame_size,
- 0, SLAB_HWCACHE_ALIGN, NULL);
+ 0, SLAB_HWCACHE_ALIGN, sizeof(struct lima_sched_task),
+ frame_size, NULL);
if (!lima_pp_task_slab)
return -ENOMEM;
}
--
2.17.1