summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2022-10-17 21:05:24 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2022-10-17 21:05:24 +0800
commitd6b10984202c80af0f3ab6b464f0a30ed6c912b6 (patch)
tree43fbe3482be4689d344ae5c60f63feb538da0615
parentcb69dad46de2c128cd8ab735f90256b9a68f28d7 (diff)
downloadomap-modules-d6b10984202c80af0f3ab6b464f0a30ed6c912b6.tar.gz
patchsets: use new workaround for the arm_dma_ops removal problem
but still has the exception report like the following, maybe it's the reason why pvr_invalidate_range cause boot failure: [ 9.411468] pvrsrvkm: loading out-of-tree module taints kernel. [ 9.421203] ueventd: LoadWithAliases was unable to load of:Ntarget-moduleT(null)Cti,sysc-omap2Cti,sysc [ 9.436553] ueventd: LoadWithAliases was unable to load of:Ntarget-moduleT(null)Cti,sysc-omap4Cti,sysc [ 9.446075] ueventd: LoadWithAliases was unable to load of:NmmuT(null)Cti,dra7-dsp-iommu [ 9.446899] ------------[ cut here ]------------ [ 9.454498] ueventd: Loading module /vendor/lib/modules/display-connector.ko with args '' [ 9.458862] WARNING: CPU: 1 PID: 144 at mm/vmalloc.c:2825 vmap+0x160/0x168 [ 9.474151] Modules linked in: pvrsrvkm(O+) [ 9.478363] CPU: 1 PID: 144 Comm: ueventd Tainted: G O 6.0.0-02961-ga602c9fc8f69-dirty #1 [ 9.478363] Hardware name: Generic DRA74X (Flattened Device Tree) [ 9.478393] unwind_backtrace from show_stack+0x10/0x14 [ 9.495849] show_stack from dump_stack_lvl+0x48/0x54 [ 9.495880] dump_stack_lvl from __warn+0x94/0x184 [ 9.495880] __warn from warn_slowpath_fmt+0xac/0xc8 [ 9.495880] warn_slowpath_fmt from vmap+0x160/0x168 [ 9.507263] vmap from NewVMallocLinuxMemArea+0x170/0x268 [pvrsrvkm] [ 9.520111] NewVMallocLinuxMemArea [pvrsrvkm] from OSAllocPages_Impl+0x34/0xe4 [pvrsrvkm] [ 9.529907] OSAllocPages_Impl [pvrsrvkm] from MMU_Initialise+0x15c/0x290 [pvrsrvkm] [ 9.541625] MMU_Initialise [pvrsrvkm] from BM_CreateContext+0x100/0x284 [pvrsrvkm] [ 9.553680] BM_CreateContext [pvrsrvkm] from DevInitSGXPart1+0xd4/0x178 [pvrsrvkm] [ 9.568450] DevInitSGXPart1 [pvrsrvkm] from PVRSRVInitialiseDevice+0x7c/0xac [pvrsrvkm] [ 9.581665] PVRSRVInitialiseDevice [pvrsrvkm] from SysInitialise+0x4f4/0x52c [pvrsrvkm] [ 9.595764] SysInitialise [pvrsrvkm] from PVRSRVDriverProbe+0x30/0x44 [pvrsrvkm] [ 9.647308] PVRSRVDriverProbe [pvrsrvkm] from platform_probe+0x98/0xc0 [ 9.654052] platform_probe from really_probe+0x134/0x33c [ 9.659484] really_probe from __driver_probe_device+0xb0/0xe4 [ 9.665344] __driver_probe_device from driver_probe_device+0x40/0x1b8 [ 9.671905] driver_probe_device from __driver_attach+0x134/0x1dc [ 9.678039] __driver_attach from bus_for_each_dev+0x80/0xb4 [ 9.683715] bus_for_each_dev from bus_add_driver+0x10c/0x200 [ 9.689514] bus_add_driver from driver_register+0x84/0x12c [ 9.695098] driver_register from init_module+0x7c/0xf00 [pvrsrvkm] [ 9.701477] init_module [pvrsrvkm] from do_one_initcall+0xbc/0x2a0 [ 9.707885] do_one_initcall from do_init_module+0x4c/0x1c4 [ 9.713470] do_init_module from load_module+0x181c/0x19f4 [ 9.718994] load_module from sys_finit_module+0xcc/0xf8 [ 9.724334] sys_finit_module from ret_fast_syscall+0x0/0x4c [ 9.730010] Exception stack(0xe726dfa8 to 0xe726dff0) [ 9.735107] dfa0: ffffffff 00000000 00000005 beb11b41 00000000 00000000 [ 9.743316] dfc0: ffffffff 00000000 00000000 0000017b b58c04e4 00000000 b6c0eea8 beb11b41 [ 9.751525] dfe0: beb11b38 beb11b28 005efe47 b63be60c [ 9.756713] ---[ end trace 0000000000000000 ]--- Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org> Change-Id: I1e1dfb9d964f163c4a56c23bc55afc2db3596ed2
-rw-r--r--patchsets/0001-arm_dma_ops-simplied-workaround-with-only-sync_singl.patch74
-rwxr-xr-xpatchsets/apply.sh38
2 files changed, 96 insertions, 16 deletions
diff --git a/patchsets/0001-arm_dma_ops-simplied-workaround-with-only-sync_singl.patch b/patchsets/0001-arm_dma_ops-simplied-workaround-with-only-sync_singl.patch
new file mode 100644
index 0000000..983f64a
--- /dev/null
+++ b/patchsets/0001-arm_dma_ops-simplied-workaround-with-only-sync_singl.patch
@@ -0,0 +1,74 @@
+From b66881341425f8fc903efe5c09fcd764ee88aaea Mon Sep 17 00:00:00 2001
+From: Yongqin Liu <yongqin.liu@linaro.org>
+Date: Mon, 17 Oct 2022 20:59:19 +0800
+Subject: [PATCH 1/1] arm_dma_ops: simplied workaround with only
+ sync_single_for_cpu
+
+so that to reduce the possibility of conflict
+
+Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
+Change-Id: I7968bd6d057c612c3ad14017172c4d033d63f676
+---
+ arch/arm/include/asm/dma-mapping.h | 23 +++++++++++++++++++++++
+ arch/arm/mm/dma-mapping.c | 15 +++++++++++++++
+ 2 files changed, 38 insertions(+)
+ create mode 100644 arch/arm/include/asm/dma-mapping.h
+
+diff --git a/arch/arm/include/asm/dma-mapping.h b/arch/arm/include/asm/dma-mapping.h
+new file mode 100644
+index 000000000000..c7c5c87c3358
+--- /dev/null
++++ b/arch/arm/include/asm/dma-mapping.h
+@@ -0,0 +1,23 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++#ifndef ASMARM_DMA_MAPPING_H
++#define ASMARM_DMA_MAPPING_H
++
++#ifdef __KERNEL__
++
++#include <linux/mm_types.h>
++#include <linux/scatterlist.h>
++
++#include <xen/xen.h>
++#include <asm/xen/hypervisor.h>
++
++extern const struct dma_map_ops arm_dma_ops;
++
++static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
++{
++ if (IS_ENABLED(CONFIG_MMU) && !IS_ENABLED(CONFIG_ARM_LPAE))
++ return &arm_dma_ops;
++ return NULL;
++}
++
++#endif /* __KERNEL__ */
++#endif
+diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
+index ef691a5720d2..68ce83d255c9 100644
+--- a/arch/arm/mm/dma-mapping.c
++++ b/arch/arm/mm/dma-mapping.c
+@@ -103,6 +103,21 @@ static struct arm_dma_buffer *arm_dma_buffer_find(void *virt)
+ * before transfers and delay cache invalidation until transfer completion.
+ *
+ */
++static void __dma_page_dev_to_cpu(struct page *, unsigned long,
++ size_t, enum dma_data_direction);
++
++static void arm_dma_sync_single_for_cpu(struct device *dev,
++ dma_addr_t handle, size_t size, enum dma_data_direction dir)
++{
++ unsigned int offset = handle & (PAGE_SIZE - 1);
++ struct page *page = phys_to_page(dma_to_phys(dev, handle-offset));
++ __dma_page_dev_to_cpu(page, offset, size, dir);
++}
++
++const struct dma_map_ops arm_dma_ops = {
++ .sync_single_for_cpu = arm_dma_sync_single_for_cpu,
++};
++EXPORT_SYMBOL(arm_dma_ops);
+
+ static void __dma_clear_buffer(struct page *page, size_t size, int coherent_flag)
+ {
+--
+2.25.1
+
diff --git a/patchsets/apply.sh b/patchsets/apply.sh
index d947dc0..a7c5384 100755
--- a/patchsets/apply.sh
+++ b/patchsets/apply.sh
@@ -13,19 +13,25 @@ git am "${dir_parent}/0001-Revert-drm-bridge_connector-enable-HPD-by-default-if.
git am "${dir_parent}/0002-Revert-drm-omapdrm-Do-no-allocate-non-scanout-GEMs-t.patch"
## for compiling errors on arm_dma_ops.sync_single_for_device
-git am "${dir_parent}/0001-Revert-dma-mapping-update-comment-after-dmabounce-re.patch"
-git am "${dir_parent}/0002-Revert-ARM-dma-mapping-merge-IOMMU-ops.patch"
-git am "${dir_parent}/0003-Revert-ARM-dma-mapping-consolidate-IOMMU-ops-callbac.patch"
-git am "${dir_parent}/0004-Revert-ARM-dma-mapping-drop-.dma_supported-for-IOMMU.patch"
-git am "${dir_parent}/0005-Revert-ARM-dma-mapping-use-dma-direct-unconditionall.patch"
-git am "${dir_parent}/0006-Revert-ARM-dma-mapping-use-dma_to_phys-phys_to_dma-i.patch"
-git am "${dir_parent}/0007-Revert-ARM-dma-mapping-mark-various-dma-mapping-rout.patch"
-git am "${dir_parent}/0001-Revert-ARM-Drop-CMDLINE_-dependency-on-ATAGS.patch"
-git am "${dir_parent}/0002-Revert-ARM-Drop-CMDLINE_FORCE-dependency-on-ARCH_MUL.patch"
-git am "${dir_parent}/0003-Revert-ARM-disallow-PCI-with-MMU-n-again.patch"
-git am "${dir_parent}/0004-Revert-ARM-footbridge-remove-custom-DMA-address-hand.patch"
-git am "${dir_parent}/0005-Revert-ARM-footbridge-move-isa-dma-support-into-foot.patch"
-git am "${dir_parent}/0006-Revert-ARM-footbridge-remove-addin-mode.patch"
-git am "${dir_parent}/0007-Revert-ARM-make-ARCH_MULTIPLATFORM-user-visible.patch"
-git am "${dir_parent}/0008-Revert-ARM-Kconfig-clean-up-platform-selection.patch"
-git am "${dir_parent}/0008-Revert-ARM-dma-mapping-use-the-generic-versions-of-d.patch"
+git am "${dir_parent}/0001-arm_dma_ops-simplied-workaround-with-only-sync_singl.patch"
+if false; then
+ # keep them here for debugging purpose
+ # base commit:
+ # 77fac2d171cb ("ANDROID: slab: remove __alloc_size attribute from __kmalloc_node_track_caller")
+ git am "${dir_parent}/0001-Revert-dma-mapping-update-comment-after-dmabounce-re.patch"
+ git am "${dir_parent}/0002-Revert-ARM-dma-mapping-merge-IOMMU-ops.patch"
+ git am "${dir_parent}/0003-Revert-ARM-dma-mapping-consolidate-IOMMU-ops-callbac.patch"
+ git am "${dir_parent}/0004-Revert-ARM-dma-mapping-drop-.dma_supported-for-IOMMU.patch"
+ git am "${dir_parent}/0005-Revert-ARM-dma-mapping-use-dma-direct-unconditionall.patch"
+ git am "${dir_parent}/0006-Revert-ARM-dma-mapping-use-dma_to_phys-phys_to_dma-i.patch"
+ git am "${dir_parent}/0007-Revert-ARM-dma-mapping-mark-various-dma-mapping-rout.patch"
+ git am "${dir_parent}/0001-Revert-ARM-Drop-CMDLINE_-dependency-on-ATAGS.patch"
+ git am "${dir_parent}/0002-Revert-ARM-Drop-CMDLINE_FORCE-dependency-on-ARCH_MUL.patch"
+ git am "${dir_parent}/0003-Revert-ARM-disallow-PCI-with-MMU-n-again.patch"
+ git am "${dir_parent}/0004-Revert-ARM-footbridge-remove-custom-DMA-address-hand.patch"
+ git am "${dir_parent}/0005-Revert-ARM-footbridge-move-isa-dma-support-into-foot.patch"
+ git am "${dir_parent}/0006-Revert-ARM-footbridge-remove-addin-mode.patch"
+ git am "${dir_parent}/0007-Revert-ARM-make-ARCH_MULTIPLATFORM-user-visible.patch"
+ git am "${dir_parent}/0008-Revert-ARM-Kconfig-clean-up-platform-selection.patch"
+ git am "${dir_parent}/0008-Revert-ARM-dma-mapping-use-the-generic-versions-of-d.patch"
+fi