Miouyouyou / RockMyy

Build scripts and patches used to cross-compile 5.6-rcX kernels for RK3288 boards
MIT License
32 stars 8 forks source link

Multiples issues with kernel 4.20-rc1 #10

Closed Miouyouyou closed 4 years ago

Miouyouyou commented 5 years ago

It seems that the new patches applied to kernel 4.20-rc1 generate issues with the Mali Kernel Driver and the dwmmc.

While the Mali Blob might have some issues with a new "deprecated" option added to the Framebuffer driver, that is not enabled in the new configuration, the DWMMC seems very weird.

[    7.924058] ------------[ cut here ]------------
[    7.929425] WARNING: CPU: 0 PID: 667 at drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:1911 kbase_mmap+0x90c/0x988 [mali_kbase]
[    7.931540] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[    7.942364] Modules linked in: mali_kbase r8723bs(C) rockchip_rga snd_soc_simple_card snd_soc_simple_card_utils dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto
[    7.961956] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    7.972671] CPU: 0 PID: 667 Comm: Xorg Tainted: G         C        4.20.0-rc1-RockMyyX2 #3
[    7.981905] Hardware name: Rockchip (Device Tree)
[    7.984954] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    7.987168] [<c010f8d8>] (unwind_backtrace) from [<c010b958>] (show_stack+0x10/0x14)
[    8.003194] [<c010b958>] (show_stack) from [<c0d024ac>] (dump_stack+0x70/0x8c)
[    8.011267] [<c0d024ac>] (dump_stack) from [<c011fafc>] (__warn+0xdc/0xfc)
[    8.018950] [<c011fafc>] (__warn) from [<c011fbdc>] (warn_slowpath_null+0x38/0x44)
[    8.027470] [<c011fbdc>] (warn_slowpath_null) from [<bf0f153c>] (kbase_mmap+0x90c/0x988 [mali_kbase])
[    8.037840] [<bf0f153c>] (kbase_mmap [mali_kbase]) from [<c02160bc>] (mmap_region+0x21c/0x4fc)
[    8.047465] [<c02160bc>] (mmap_region) from [<c0216764>] (do_mmap+0x3c8/0x414)
[    8.055537] [<c0216764>] (do_mmap) from [<c02038c8>] (vm_mmap_pgoff+0x98/0xc8)
[    8.063607] [<c02038c8>] (vm_mmap_pgoff) from [<c02147f8>] (ksys_mmap_pgoff+0x78/0x90)
[    8.072453] [<c02147f8>] (ksys_mmap_pgoff) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[    8.081491] Exception stack(0xed0fbfa8 to 0xed0fbff0)
[    8.087132] bfa0:                   0000000b 00000041 00000000 00001000 00000003 00000001
[    8.096269] bfc0: 0000000b 00000041 00041000 000000c0 00001000 0117b968 00001000 00000003
[    8.105404] bfe0: 000000c0 bedb97d4 b6bf2885 b6b78af6
[    8.111122] ---[ end trace 4f039dee8593c3aa ]---
[    8.116297] mali ffa30000.gpu: mmap failed 256
[    8.121393] mali ffa30000.gpu: Zone mismatch: 0 != 0
[    8.126966] mali ffa30000.gpu: !(tmp->flags & KBASE_REG_FREE): tmp->start_pfn=0xb65eb tmp->flags=0x604e tmp->nr_pages=0x1 gpu_pfn=0xb65eb nr_pages=0x1
[    8.139954] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.149436] mali ffa30000.gpu: in function kbase_add_va_region (8e0478ab, d45b9222, 0xb65eb000, 0x1, 0x1)
[    8.160153] mali ffa30000.gpu: drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:2146
[    8.166727] rk_gmac-dwmac ff290000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[    8.168654] ------------[ cut here ]------------
[    8.183489] WARNING: CPU: 0 PID: 667 at drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:2148 kbase_mmap+0x618/0x988 [mali_kbase]
[    8.195957] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.203731] Modules linked in: mali_kbase r8723bs(C) rockchip_rga snd_soc_simple_card snd_soc_simple_card_utils dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto
[    8.215957] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.227480] CPU: 0 PID: 667 Comm: Xorg Tainted: G        WC        4.20.0-rc1-RockMyyX2 #3
[    8.236712] Hardware name: Rockchip (Device Tree)
[    8.239956] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.241972] [<c010f8d8>] (unwind_backtrace) from [<c010b958>] (show_stack+0x10/0x14)
[    8.258000] [<c010b958>] (show_stack) from [<c0d024ac>] (dump_stack+0x70/0x8c)
[    8.266072] [<c0d024ac>] (dump_stack) from [<c011fafc>] (__warn+0xdc/0xfc)
[    8.273755] [<c011fafc>] (__warn) from [<c011fbdc>] (warn_slowpath_null+0x38/0x44)
[    8.282273] [<c011fbdc>] (warn_slowpath_null) from [<bf0f1248>] (kbase_mmap+0x618/0x988 [mali_kbase])
[    8.292638] [<bf0f1248>] (kbase_mmap [mali_kbase]) from [<c02160bc>] (mmap_region+0x21c/0x4fc)
[    8.302262] [<c02160bc>] (mmap_region) from [<c0216764>] (do_mmap+0x3c8/0x414)
[    8.310333] [<c0216764>] (do_mmap) from [<c02038c8>] (vm_mmap_pgoff+0x98/0xc8)
[    8.318403] [<c02038c8>] (vm_mmap_pgoff) from [<c02147f8>] (ksys_mmap_pgoff+0x78/0x90)
[    8.327249] [<c02147f8>] (ksys_mmap_pgoff) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[    8.336287] Exception stack(0xed0fbfa8 to 0xed0fbff0)
[    8.341927] bfa0:                   0000000b 00000041 00000000 00001000 00000003 00000001
[    8.351064] bfc0: 0000000b 00000041 00041000 000000c0 00001000 0117b968 00001000 00000003
[    8.360200] bfe0: 000000c0 bedb978c b6bf2885 b6b78af6
[    8.365885] ---[ end trace 4f039dee8593c3ab ]---
[    8.371062] mali ffa30000.gpu: mmap failed -12
[    8.376079] mali ffa30000.gpu: Zone mismatch: 0 != 0
[    8.381642] mali ffa30000.gpu: !(tmp->flags & KBASE_REG_FREE): tmp->start_pfn=0xb65eb tmp->flags=0x604e tmp->nr_pages=0x1 gpu_pfn=0xb65eb nr_pages=0x1
[    8.393957] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.404118] mali ffa30000.gpu: in function kbase_add_va_region (8e0478ab, d45b9222, 0xb65eb000, 0x1, 0x1)
[    8.414827] mali ffa30000.gpu: drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:2146
[    8.423312] ------------[ cut here ]------------
[    8.428542] WARNING: CPU: 0 PID: 667 at drivers/gpu/arm/midgard/mali_kbase_mem_linux.c:2148 kbase_mmap+0x618/0x988 [mali_kbase]
[    8.440957] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.448782] Modules linked in: mali_kbase r8723bs(C) rockchip_rga snd_soc_simple_card snd_soc_simple_card_utils dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto
[    8.460957] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.472533] CPU: 0 PID: 667 Comm: Xorg Tainted: G        WC        4.20.0-rc1-RockMyyX2 #3
[    8.481765] Hardware name: Rockchip (Device Tree)
[    8.484958] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[    8.487023] [<c010f8d8>] (unwind_backtrace) from [<c010b958>] (show_stack+0x10/0x14)
[    8.503052] [<c010b958>] (show_stack) from [<c0d024ac>] (dump_stack+0x70/0x8c)
[    8.511124] [<c0d024ac>] (dump_stack) from [<c011fafc>] (__warn+0xdc/0xfc)
[    8.518805] [<c011fafc>] (__warn) from [<c011fbdc>] (warn_slowpath_null+0x38/0x44)
[    8.527322] [<c011fbdc>] (warn_slowpath_null) from [<bf0f1248>] (kbase_mmap+0x618/0x988 [mali_kbase])
[    8.537687] [<bf0f1248>] (kbase_mmap [mali_kbase]) from [<c02160bc>] (mmap_region+0x21c/0x4fc)
[    8.547311] [<c02160bc>] (mmap_region) from [<c0216764>] (do_mmap+0x3c8/0x414)
[    8.555381] [<c0216764>] (do_mmap) from [<c02038c8>] (vm_mmap_pgoff+0x98/0xc8)
[    8.563451] [<c02038c8>] (vm_mmap_pgoff) from [<c02147f8>] (ksys_mmap_pgoff+0x78/0x90)
[    8.572296] [<c02147f8>] (ksys_mmap_pgoff) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[    8.581334] Exception stack(0xed0fbfa8 to 0xed0fbff0)
[    8.586974] bfa0:                   0000000b 00000041 00000000 00001000 00000003 00000001
[    8.596111] bfc0: 0000000b 00000041 00041000 000000c0 00001000 0117b968 00001000 00000003
[    8.605247] bfe0: 000000c0 bedb978c b6bf2885 b6b78af6
[    8.610941] ---[ end trace 4f039dee8593c3ac ]---
[    8.616114] mali ffa30000.gpu: mmap failed -12
Miouyouyou commented 5 years ago

Enabling DRM_FBDEV_LEAK_PHYS_SMEM changes nothing...

Miouyouyou commented 5 years ago

The new "not-working" set of patches applied to v4.20 kernels is available here :

https://github.com/Miouyouyou/RockMyy/tree/v4.20-IsNotWorkingToo

Tonymac32 commented 5 years ago

Hmmm, there were a lot of notes about the phy clocks on the dwmmc rockchip, prior to these patches you got the errors while it parsed through invalid clock rates. Related maybe?

Miouyouyou commented 5 years ago

Ah, you mean the patches provided by the ASUS team on their 4.4 ? Or the invalid Clock rates in the dmesg ?

Come to say, that reminds me an old issue with eMMC on MiQi devices. I guess I could try to boot a MiQi with a 4.20 and see how it fares for the MMC.

Still, my biggest issue is the Mali kernel driver failing its mmap calls... It just break the entire OpenGL stack and X11 one too.

Tonymac32 commented 5 years ago

Right, let me poke around on the mmc stuff, I might be confusing some rk3328 stuff in the mix at the same time. Also, Tinker device tree patches will be a mess eventually (if not already) because they made a tinker.dtsi with individual dts's for the Tinker and "S"

Miouyouyou commented 5 years ago

Yeah... The DTSI thing... I know...

https://github.com/Miouyouyou/RockMyy/commit/4a45ba77b816ee4bfde7671a3708b168bd44c2b9#diff-97fc3bf5342e28205680e1ca202fcf8c

... I had to rewrite like ~10 patches, one by one, due to these modifications.

I like how the tinker.dts content is now like "I'm a Tinkerboard. The End."

Tonymac32 commented 5 years ago

Yep...

Tonymac32 commented 5 years ago

I noticed a SERDEV situation on hci-3wire got backported to 4.4, I need to check that out as I can't seem to follow the bluetooth discussion properly

Tonymac32 commented 5 years ago

https://patchwork.kernel.org/cover/10553793/

Miouyouyou commented 5 years ago

I've been able to "kind of" fix the Mali issues, but it's a more a kludge than anything, and some problems still remain.

It seems that the switch to vmf_insert_pfn was done through multiple Linux versions. Now, the NVIDIA drivers seem to be impacted by the same bug, so I'll take a look at other kernel drivers that still use old ABI and see how people fixed their issue with these drivers.

Meanwhile, the ALSA drivers are now dropping this during the boot sequence :

[   12.550485] ------------[ cut here ]------------
[   12.555656] kernel BUG at ./include/linux/dma-mapping.h:327!
[   12.561983] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[   12.564945] dwmmc_rockchip ff0c0000.dwmmc: Unexpected interrupt latency
[   12.568505] Modules linked in: r8723bs(C) mali_kbase snd_soc_simple_card snd_soc_simple_card_utils rockchip_rga dw_hdmi_cec v4l2_mem2mem videobuf2_dma_sg rk_crypto
[   12.592223] CPU: 0 PID: 1598 Comm: alsa-sink-ff890 Tainted: G         C        4.20.0-rc2-RockMyyX2 #1
[   12.602627] Hardware name: Rockchip (Device Tree)
[   12.607887] PC is at pl330_prep_slave_fifo+0x78/0x10c
[   12.613530] LR is at 0xc145e564
[   12.617033] pc : [<c07012bc>]    lr : [<c145e564>]    psr: 20010093
[   12.624032] sp : eadc5e40  ip : 40000000  fp : 0202f700
[   12.629864] r10: 00000001  r9 : 00000000  r8 : c0e0144c
[   12.635696] r7 : 00000002  r6 : 00000000  r5 : ef033800  r4 : eeac0000
[   12.642985] r3 : c145e564  r2 : 0000000c  r1 : 00000000  r0 : 00000001
[   12.650276] Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
[   12.651927] dwmmc_rockchip ff0d0000.dwmmc: Unexpected interrupt latency
[   12.658335] Control: 10c5387d  Table: 2ac9006a  DAC: 00000051
[   12.672134] Process alsa-sink-ff890 (pid: 1598, stack limit = 0x2c06a11e)
[   12.679716] Stack: (0xeadc5e40 to 0xeadc6000)
[   12.684580] 5e40: eeac0000 00000001 00001138 00000000 000044e0 eeac0000 eea66c18 00001138
[   12.693717] 5e60: 2cd38000 c0702898 00001138 00000000 eac3a7c0 ef23b600 c070282c 00000003
[   12.702853] 5e80: ee0f3a00 00000036 0202f700 c0a48d24 00000001 00000003 ed4b7c40 edece800
[   12.711981] 5ea0: ef23b600 00000001 edecedcc c0a74db4 ef23b600 00000003 c0ee5728 00000000
[   12.721118] 5ec0: eac3a640 00000023 00000036 c0a4049c 00004142 02050878 ef23b600 eac25d00
[   12.730254] 5ee0: eac3a640 c0a430e0 006200ca 00000004 b5d0c000 eac92d70 eac92d70 2cd3c707
[   12.739390] 5f00: 00000000 02050878 ecd728e8 eac25d00 00004142 02050878 00000023 c02421dc
[   12.748518] 5f20: 02050878 c0242900 00000055 ed7dd780 0000080f ad0fc950 ece15200 c01132b0
[   12.757655] 5f40: c130a488 00000000 00000001 00000000 ece15248 00000800 00000000 000000f0
[   12.766792] 5f60: eac25d00 c024c938 00000000 eac25d00 eac25d01 00004142 02050878 00000023
[   12.775928] 5f80: 00000036 c02430e8 020511f0 adb4d000 00000000 00000036 c0101204 eadc4000
[   12.785065] 5fa0: 00000036 c0101000 020511f0 adb4d000 00000023 00004142 02050878 02050878
[   12.794201] 5fc0: 020511f0 adb4d000 00000000 00000036 00000000 00000001 adaa1000 0202f700
[   12.803337] 5fe0: adb4d100 ad0feca4 adae1df3 b6cbae06 20010030 00000023 00000000 00000000
[   12.812480] [<c07012bc>] (pl330_prep_slave_fifo) from [<c0702898>] (pl330_prep_dma_cyclic+0x6c/0x1f0)
[   12.822788] [<c0702898>] (pl330_prep_dma_cyclic) from [<c0a48d24>] (snd_dmaengine_pcm_trigger+0xc4/0x170)
[   12.833485] [<c0a48d24>] (snd_dmaengine_pcm_trigger) from [<c0a74db4>] (soc_pcm_trigger+0xec/0x128)
[   12.843597] [<c0a74db4>] (soc_pcm_trigger) from [<c0a4049c>] (snd_pcm_action_single+0x38/0x64)
[   12.853221] [<c0a4049c>] (snd_pcm_action_single) from [<c0a430e0>] (snd_pcm_ioctl+0x824/0xf6c)
[   12.862848] [<c0a430e0>] (snd_pcm_ioctl) from [<c02421dc>] (vfs_ioctl+0x28/0x3c)
[   12.871114] [<c02421dc>] (vfs_ioctl) from [<c0242900>] (do_vfs_ioctl+0x84/0x81c)
[   12.879377] [<c0242900>] (do_vfs_ioctl) from [<c02430e8>] (ksys_ioctl+0x50/0x6c)
[   12.887642] [<c02430e8>] (ksys_ioctl) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[   12.896194] Exception stack(0xeadc5fa8 to 0xeadc5ff0)
[   12.901834] 5fa0:                   020511f0 adb4d000 00000023 00004142 02050878 02050878
[   12.910970] 5fc0: 020511f0 adb4d000 00000000 00000036 00000000 00000001 adaa1000 0202f700
[   12.920095] 5fe0: adb4d100 ad0feca4 adae1df3 b6cbae06
[   12.925738] Code: e1a00626 ebe84905 e3500000 0a000001 (e7f001f2) 
[   12.932543] ---[ end trace 16d29d6dead4fbbb ]---
Miouyouyou commented 4 years ago

These issues are not relevant anymore. Closing up.