bootlin / mali-driver

GNU General Public License v2.0
15 stars 8 forks source link

Fix build up to Linux 5.15 #1

Closed giuliobenetti closed 2 years ago

giuliobenetti commented 2 years ago

This patchset allows to build Mali Midgard driver r8p0 up to Linux 5.15. I still can't test it but it looks good to me, so I ask you to accept this PR.

Best regards

trombonebuster commented 2 years ago

Hello! I am testing your mali drivers on kernel 5.15. Everything builds fine with the kernel, but when running clinfo, I get this traceback. Do you have any idea why this may be happening?

[ 76.999795] Mali: In file: drivers/gpu/arm/bifrost_for_linux/mali_kbase_mem_linux.c line: 1762 function:kbase_cpu_vm_close [ 76.999832] map->count > 0 [ 77.000910] [ 77.001684] kernel BUG at drivers/gpu/arm/bifrost_for_linux/mali_kbase_mem_linux.c:1762! [ 77.002422] Internal error: Oops - BUG: 0 [#1] SMP [ 77.002872] Modules linked in: xt_conntrack xt_MASQUERADE nf_conntrack_netlink xt_addrtype iptable_filter iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 overlay autofs4 [ 77.004433] CPU: 4 PID: 798 Comm: clinfo Not tainted 5.15.0-rc7-1-rockchip-g180eca540ae0 #rockchip [ 77.005253] Hardware name: Vamrs RK3399 ZAKU (DT) [ 77.005687] pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 77.006329] pc : kbase_cpu_vm_close+0xa8/0x20c [ 77.006762] lr : kbase_cpu_vm_close+0xa8/0x20c [ 77.007177] sp : ffffffc012073cc0 [ 77.007485] x29: ffffffc012073cc0 x28: ffffff8012517a10 x27: ffffff80056253a8 [ 77.008156] x26: 0000000000000000 x25: 0000000000000001 x24: 0000007f8f11a000 [ 77.008827] x23: ffffff8005625958 x22: ffffff8012517a10 x21: ffffff8005625398 [ 77.009495] x20: 0000000000000000 x19: ffffff8016669280 x18: 0000000000000010 [ 77.010161] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 [ 77.010833] x14: ffffffc012073c38 x13: 0000000000000008 x12: 0000000000000020 [ 77.011502] x11: 00000000fffffff4 x10: ffffffc012073b7a x9 : 0000000005f5e0ff [ 77.012172] x8 : 0000000000000078 x7 : 000000000000000a x6 : 0000000000000030 [ 77.012840] x5 : 00000000ffffffff x4 : 0000000000000000 x3 : 0000000000000000 [ 77.013509] x2 : 0000000000000001 x1 : 0000000000000004 x0 : 0000000000000000 [ 77.014178] Call trace: [ 77.014414] kbase_cpu_vm_close+0xa8/0x20c [ 77.014802] remove_vma+0x38/0x5c [ 77.015133] do_munmap+0x22c/0x2d4 [ 77.015474] __vm_munmap+0x70/0xc8 [ 77.015799] arm64_sys_munmap+0x3c/0x4c [ 77.016177] invoke_syscall+0x88/0x118 [ 77.016536] el0_svc_common.constprop.4+0xb8/0xe4 [ 77.016976] do_el0_svc+0x80/0x9c [ 77.017294] el0_svc+0x1c/0x44 [ 77.017592] el0t_64_sync_handler+0x64/0x12c [ 77.017996] el0t_64_sync+0x16c/0x170 [ 77.018355] Code: b0004cc0 9114bc00 94174bb7 97fffc23 (d4210000) [ 77.018916] ---[ end trace b9d01d0313a12e9a ]---

giuliobenetti commented 2 years ago

Hi @trombonebuster, can you please tell me which SoC are you using?

giuliobenetti commented 2 years ago

Ah RK3399, now I’ve seen. What sounds strange to me is the path of driver: drivers/gpu/arm/bifrost_for_linux/mali_kbase_mem_linux.c

That “bifrost_for_linux”.

How have you built the driver? Have you built it like a module or have you tried copying it directly into kernel while changing its directory name?

Also the error on line 1762 of mali_kbase_mem_linux.c doesn’t have the call to kbase_cpu_vm_close().

So can you describe me how you’ve built the driver? As an external module or in another way? Using a build system?(i.e. Buildroot)

I’m going to reproduce the building soon to compare and debug. But I need to be sure to use the same sources.

Thank you!