bmips: remove linux 5.10 compatibility
[openwrt/staging/ldir.git] / target / linux / bmips / patches-5.15 / 202-mips-bmips-disable-ARCH_HAS_SYNC_DMA_FOR_CPU_ALL.patch
1 From 84c06b4a1dfa3e021fdbcafaff8cebfdec462402 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
3 Date: Tue, 23 Feb 2021 10:39:48 +0100
4 Subject: [PATCH] mips: bmips: disable ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Enabling this option causes kernel panics on BCM6358 with EHCI/OHCI:
10 [ 3.881739] usb 1-1: new high-speed USB device number 2 using ehci-platform
11 [ 3.895011] Reserved instruction in kernel code[#1]:
12 [ 3.900113] CPU: 0 PID: 1 Comm: init Not tainted 5.10.16 #0
13 [ 3.905829] $ 0 : 00000000 10008700 00000000 77d94060
14 [ 3.911238] $ 4 : 7fd1f088 00000000 81431cac 81431ca0
15 [ 3.916641] $ 8 : 00000000 ffffefff 8075cd34 00000000
16 [ 3.922043] $12 : 806f8d40 f3e812b7 00000000 000d9aaa
17 [ 3.927446] $16 : 7fd1f068 7fd1f080 7ff559b8 81428470
18 [ 3.932848] $20 : 00000000 00000000 55590000 77d70000
19 [ 3.938251] $24 : 00000018 00000010
20 [ 3.943655] $28 : 81430000 81431e60 81431f28 800157fc
21 [ 3.949058] Hi : 00000000
22 [ 3.952013] Lo : 00000000
23 [ 3.955019] epc : 80015808 setup_sigcontext+0x54/0x24c
24 [ 3.960464] ra : 800157fc setup_sigcontext+0x48/0x24c
25 [ 3.965913] Status: 10008703 KERNEL EXL IE
26 [ 3.970216] Cause : 00800028 (ExcCode 0a)
27 [ 3.974340] PrId : 0002a010 (Broadcom BMIPS4350)
28 [ 3.979170] Modules linked in: ohci_platform ohci_hcd fsl_mph_dr_of ehci_platform ehci_fsl ehci_hcd gpio_button_hotplug usbcore nls_base usb_common
29 [ 3.992907] Process init (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=77e22ec8)
30 [ 4.000776] Stack : 81431ef4 7fd1f080 81431f28 81428470 7fd1f068 81431edc 7ff559b8 81428470
31 [ 4.009467] 81431f28 7fd1f080 55590000 77d70000 77d5498c 80015c70 806f0000 8063ae74
32 [ 4.018149] 08100002 81431f28 0000000a 08100002 81431f28 0000000a 77d6b418 00000003
33 [ 4.026831] ffffffff 80016414 80080734 81431ecc 81431ecc 00000001 00000000 04000000
34 [ 4.035512] 77d54874 00000000 00000000 00000000 00000000 00000012 00000002 00000000
35 [ 4.044196] ...
36 [ 4.046706] Call Trace:
37 [ 4.049238] [<80015808>] setup_sigcontext+0x54/0x24c
38 [ 4.054356] [<80015c70>] setup_frame+0xdc/0x124
39 [ 4.059015] [<80016414>] do_notify_resume+0x1dc/0x288
40 [ 4.064207] [<80011b50>] work_notifysig+0x10/0x18
41 [ 4.069036]
42 [ 4.070538] Code: 8fc300b4 00001025 26240008 <ac820000> ac830004 3c048063 0c0228aa 24846a00 26240010
43 [ 4.080686]
44 [ 4.082517] ---[ end trace 22a8edb41f5f983b ]---
45 [ 4.087374] Kernel panic - not syncing: Fatal exception
46 [ 4.092753] Rebooting in 1 seconds..
47
48 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
49 ---
50 arch/mips/Kconfig | 1 -
51 1 file changed, 1 deletion(-)
52
53 --- a/arch/mips/Kconfig
54 +++ b/arch/mips/Kconfig
55 @@ -264,7 +264,6 @@ config ATH79
56 config BMIPS_GENERIC
57 bool "Broadcom Generic BMIPS kernel"
58 select ARCH_HAS_RESET_CONTROLLER
59 - select ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
60 select ARCH_HAS_PHYS_TO_DMA
61 select BOOT_RAW
62 select NO_EXCEPT_FILL
63 --- a/arch/mips/bmips/dma.c
64 +++ b/arch/mips/bmips/dma.c
65 @@ -64,6 +64,7 @@ phys_addr_t dma_to_phys(struct device *d
66 return dma_addr;
67 }
68
69 +#ifdef CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL
70 void arch_sync_dma_for_cpu_all(void)
71 {
72 void __iomem *cbr = BMIPS_GET_CBR();
73 @@ -79,6 +80,7 @@ void arch_sync_dma_for_cpu_all(void)
74 __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG);
75 __raw_readl(cbr + BMIPS_RAC_CONFIG);
76 }
77 +#endif /* CONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL */
78
79 static int __init bmips_init_dma_ranges(void)
80 {