diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2022-10-04 18:31:57 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2022-10-14 13:47:51 +0200 |
commit | 91962e8fc83b0e2e5a9024005e84a60a40e9ef40 (patch) | |
tree | b3f329b6a0f798ae44db2a3c274183997acdf054 | |
parent | b8f08f93792e28c0f04faca9978de908f17496f0 (diff) |
linux-toradex-mainline: fix data-mapping kernel crash
If a panel-dpi node does not have the data-mapping property defined an
uninitalized pointer is used with strcmp resulting in a kernel crash
during boot.
[ 6.509726] 8<--- cut here ---
[ 6.513351] Unable to handle kernel NULL pointer dereference at virtual address 00000013
[ 6.522189] [00000013] *pgd=00000000
[ 6.526111] Internal error: Oops: 5 [#1] SMP ARM
[ 6.530833] Modules linked in:
[ 6.533983] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.0.0-6.0.0-devel+git.4fe89d07dcc2 #1
[ 6.542483] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 6.548768] PC is at strcmp+0x0/0x34
[ 6.552449] LR is at panel_dpi_probe+0xc4/0x1f0
[ 6.557092] pc : [<c0640e50>] lr : [<c0760dc4>] psr: 60000013
[ 6.563470] sp : f083dcc0 ip : 00000001 fp : c15004d0
[ 6.568791] r10: 00000000 r9 : ef7f4d08 r8 : c2178000
[ 6.574115] r7 : c230b740 r6 : c256d100 r5 : 00000013 r4 : c256b4c0
[ 6.580757] r3 : 00000000 r2 : c2178000 r1 : c12bd7f0 r0 : 00000013
[ 6.587399] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 6.594659] Control: 10c5387d Table: 8000406a DAC: 00000051
[ 6.600507] Register r0 information: non-paged memory
[ 6.605676] Register r1 information: non-slab/vmalloc memory
[ 6.611457] Register r2 information: slab task_struct start c2178000 pointer offset 0
[ 6.619488] Register r3 information: NULL pointer
[ 6.624296] Register r4 information: slab kmalloc-128 start c256b480 pointer offset 64 size 128
[ 6.633208] Register r5 information: non-paged memory
[ 6.638367] Register r6 information: slab kmalloc-192 start c256d0c0 pointer offset 64 size 192
[ 6.647278] Register r7 information: slab kmalloc-256 start c230b700 pointer offset 64 size 256
[ 6.656191] Register r8 information: slab task_struct start c2178000 pointer offset 0
[ 6.664207] Register r9 information: non-slab/vmalloc memory
[ 6.669981] Register r10 information: NULL pointer
[ 6.674876] Register r11 information: non-slab/vmalloc memory
[ 6.680738] Register r12 information: non-paged memory
[ 6.685987] Process swapper/0 (pid: 1, stack limit = 0xaf192ddd)
[ 6.692202] Stack: (0xf083dcc0 to 0xf083e000)
[ 6.696672] dcc0: 00000000 c0e2f724 00000000 c12b606c 00000013 c0a01820 f083dd08 00000001
[ 6.705001] dce0: 00000000 c2178000 c17eea20 c0a06930 c230b7f4 c2178000 00000000 9fb7a78a
[ 6.713328] dd00: c230b740 c2112810 c1e74008 c2178000 00000000 c13c9e68 c1802000 c076116c
[ 6.721654] dd20: c21787a0 9fb7a78a c2178000 c2178000 c156455c f083dd50 2e266000 c1799dd4
[ 6.729980] dd40: 00000000 60000093 00000000 c018a198 00000001 00000080 00000000 00000001
[ 6.738303] dd60: c21787c0 c0e236f8 c2178000 c21787c0 00000001 c0181cac c2178000 c1799dd4
[ 6.746629] dd80: c2178000 c156455c c0e2f724 c17de9e0 a0000013 c0186f08 c0a0167c 00000001
[ 6.754952] dda0: 00000001 c2178000 c156a29c c021e0e8 a0000013 c1799dc4 a0000013 c1799dc4
[ 6.763277] ddc0: c0f7e79c c0e2f724 c0f7e860 9fb7a78a c0f7e79c 00000000 c2112810 c1766a80
[ 6.771602] dde0: 00000000 c17eea20 c13c9e68 c1802000 c15004d0 c079113c 00000000 c2112810
[ 6.779927] de00: c1766a80 00000000 c17eea20 c078e168 c21129bc c079e2c0 c2112810 c1766a80
[ 6.788250] de20: c2112810 00000000 c256b358 c078e534 c0f7e79c 9fb7a78a c0f7e860 c1e76200
[ 6.796577] de40: c2112810 c2112810 00000000 c256b358 c13c9e68 c078e6d4 c2112854 c2112810
[ 6.804900] de60: c1766a80 c2178000 c256b358 c078eedc 00000000 c1766a80 c078ee30 c2178000
[ 6.813226] de80: c256b358 c078c094 c20a98e4 c20a98b0 c2242054 9fb7a78a c20a98e4 c1766a80
[ 6.821550] dea0: c256b300 00000000 c1767dd8 c078d50c c12be0c8 c0e2f660 00000000 c1766a80
[ 6.829875] dec0: 00000000 c17ddb00 c1608fcc 00000000 c13c9e68 c078fe98 c2178000 c1532458
[ 6.838198] dee0: c17ddb00 c1532468 c2178000 c01022a4 c21f6067 c21f605a c21f6059 c014be00
[ 6.846523] df00: c2001300 c21f6000 00000129 c12f2658 c15004d0 00000000 c2178000 00000006
[ 6.854846] df20: 00000006 00000000 c2178000 c17ddb00 c1608fcc c1549870 c1549854 9fb7a78a
[ 6.863171] df40: c15638d4 00000007 c21f6000 c1549874 c1549854 c13c9e68 c1802000 c1501328
[ 6.871494] df60: 00000006 00000006 00000000 c15004d0 00000000 00000129 00000000 c1608f80
[ 6.879820] df80: c0e24474 00000000 00000000 00000000 00000000 00000000 00000000 c0e24488
[ 6.888142] dfa0: 00000000 c0e24474 00000000 c0100128 00000000 00000000 00000000 00000000
[ 6.896465] dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 6.904788] dfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 6.913110] strcmp from panel_dpi_probe+0xc4/0x1f0
[ 6.918132] panel_dpi_probe from panel_simple_probe+0x27c/0x604
[ 6.924279] panel_simple_probe from platform_probe+0x58/0xbc
[ 6.930162] platform_probe from really_probe+0xd8/0x410
Fixes: 3a16d8f ("linux-toradex-mainline: panel-dpi: reintroduce data-mapping")
Related-to: ELB-4682
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
(cherry picked from commit f6243dd1a7d5f5b060507a9a2e44ae9f147978fe)
-rw-r--r-- | recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch index 213f9f1..4da324c 100644 --- a/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch +++ b/recipes-kernel/linux/linux-toradex-mainline-git/0001-Revert-drm-panel-simple-drop-use-of-data-mapping-pro.patch @@ -10,6 +10,9 @@ Re-enable the data-mapping property which was already used in the In addition to the revert set bpc from the data-mapping value as a WARN_ON is printed if missing. +In addition to the revert have mapping pointing to the empty string to +prevent a kernel panic if data-mapping can not be read from the dt and +then an uninitialized pointer is used in strcmp. Upstream-Status: denied [Alternative solution being discused] https://lore.kernel.org/all/20220628181838.2031-1-max.oss.09@gmail.com/ @@ -26,7 +29,7 @@ index ff5e1a44c43a..f94dd09cf76f 100644 struct panel_desc *desc; unsigned int bus_flags; struct videomode vm; -+ const char *mapping; ++ const char *mapping = ""; int ret; np = dev->of_node; |