[Openpvrsgx-devgroup] [PATCH] Update pvrsgx 1.14.3759903 to latest kernel
Lucas Fryzek
lucas.fryzek at hazeco.xyz
Sat Nov 13 05:26:05 CET 2021
> Hi Lucas,
>
>> Am 12.11.2021 um 13:53 schrieb Lucas Fryzek
>> <lucas.fryzek at hazeco.xyz>:
>>
>> Incorporate fixes from the pvrsgx 1.17.4948957 driver to the
>> 1.14.3759903 driver to allow it to build on the latest 5.15 kernel
>> version
>> ---
>> .../services4/srvkm/env/linux/dmabuf.c | 3 +-
>> .../eurasia_km/services4/srvkm/env/linux/mm.c | 56 +++++++++
>> .../services4/srvkm/env/linux/mmap.c | 19 ++++
>> .../services4/srvkm/env/linux/module.c | 4 +
>> .../services4/srvkm/env/linux/mutils.h | 6 +
>> .../services4/srvkm/env/linux/osfunc.c | 106
>> +++++++++++++-----
>> .../services4/srvkm/env/linux/private_data.h | 3 +
>> .../services4/srvkm/env/linux/proc.c | 11 ++
>> .../services4/srvkm/env/linux/pvr_bridge_k.c | 4 +
>> .../services4/srvkm/env/linux/pvr_drm.h | 3 +
>> .../services4/srvkm/env/linux/pvr_uaccess.h | 4 +-
>> .../services4/system/sgx_jz4780/sysconfig.h | 3 +
>> 12 files changed, 193 insertions(+), 29 deletions(-)
>
> excellent!
>
> I have added an #ifndef SYS_SGX_DEV_NAME to
> .../services4/system/sgx_jz4780/sysconfig.h
> because I got a duplicate symbol warning.
>
> Now I can compile it (with a very small number of other warnings
> about va_list).
For my next steps I'll take a look at resolving some of the compiler
warning as those typically indicate bigger problems.
>
> Booting unfortunately fails with a segfault (see below).
>
> OSInvalidateCPUCacheRangeKM/dma_sync_phys indicates that some fix
> does not handle
> the processor cache properly. Maybe the changes for 1.17.4948957 were
> too OMAP specific
> or we are missing some detail. Or it is even related to the va_list
> things.
>
> Or some 1.17.4948957 fixes are not 100% compatible to the
> 1.14.3759903.
> Maybe a comparison with the fixes for the 1.14.3699939 will show.
> That one
> also works on omap3/am335x (e.g. Beaglebone).
>
> Unfortunatley I have not the spare time to look deeper into it,
> although it is tempting :)
>
> Anyways this is a really big step forwards. For the first time we can
> compile a
> jz4780 kernel driver for a modern kernel with working HDMI *and* have
> a (potentially)
> matching user-space available.
>
> BR and thanks,
> Nikolaus
>
Which kernel version are you working from? Do you have any patches
applied beyond what I provided? Did you modify the kernel config from
`letux_defconfig` beyond just switching to the `1.14.37539903` version
of the pvr module? I was able to build and boot the kernel with this
patch and without crashes. I can take a look at why that
`OSInvalidateCPUCacheRangeKM` triggered a crash, but it helps if I'm
able to reproduce the problem on my end :P
>
> [ 9.870707] pvrsrvkm 13040000.gpu: Enabling quirks 00000000
> [ 9.879065] [drm] Initialized ingenic-drm 1.1.0 20200716 for
> 13050000.lcdc0 on minor 0
> [ 9.894156] usb usb1: New USB device strings: Mfr=3, Product=2,
> SerialNumber=1
> [ 9.927309] input: gpio_ir_recv as
> /devices/platform/ir/rc/rc0/input1
> [ 9.969773] dwc2 13500000.usb: Looking up vbus-supply from device
> tree
> [ 10.011616] CPU 0 Unable to handle kernel paging request at
> virtual address 402a1000, epc == 8011a838, ra == 8011ac58
> [ 10.022386] Oops[#1]:
> [ 10.024685] CPU: 0 PID: 494 Comm: systemd-udevd Not tainted
> 5.15.0-letux-ci20+ #7327
> [ 10.032480] $ 0 : 00000000 00000001 ffffffe0 00000002
> [ 10.037747] $ 4 : 402a1000 402a1fe0 84b05ea4 00000001
> [ 10.043014] $ 8 : 00000002 84153410 00001000 00000000
> [ 10.048280] $12 : 80c80000 17d78400 fffffffd ffffffff
> [ 10.053547] $16 : 402a1000 00001000 84b05ea4 00000002
> [ 10.058815] $20 : 402a1000 80c70000 80c80000 80c70000
> [ 10.064082] $24 : 00000000 8017d250
> [ 10.069347] $28 : 843fa000 843fb8f8 80c70000 8011ac58
> [ 10.074614] Hi : 00180542
> [ 10.077514] Lo : 000c02a1
> [ 10.080414] epc : 8011a838 blast_inv_dcache_range+0x10/0x24
> [ 10.086202] ra : 8011ac58 ingenic_xburst_dma_cache_inv+0x98/0xa0
> [ 10.092500] Status: 10000403 KERNEL EXL IE
> [ 10.096718] Cause : 00800008 (ExcCode 02)
> [ 10.100748] BadVA : 402a1000
> [ 10.103647] PrId : 3ee1024f (Ingenic XBurst)
> [ 10.108025] Modules linked in: pvrsrvkm_jz4780_sgx540_130(+)
> ci20_audio gpio_ir_recv(+) rc_core gpio_keys ohci_platform(+)
> ingenic_drm(+) display_connector dw_hdmi ohci_hcd ehci_platform(+)
> drm_kms_helper dwc2(+) cfbfillrect roles syscopyarea cfbimgblt
> ehci_hcd sysfillrect sysimgblt fb_sys_fops cfbcopyarea dm9000
> rtc_pcf8563 mii drm nvmem_jz4780_efuse drm_panel_orientation_quirks
> snd_soc_jz4780_codec snd_soc_jz4740_i2s phy_ingenic_usb ipv6 autofs4
> [ 10.147952] Process systemd-udevd (pid: 494, threadinfo=(ptrval),
> task=(ptrval), tls=77ea0490)
> [ 10.156612] Stack : 85d5ba00 c0380000 843fb908 00001000 00001000
> 00001000 00001000 8011a57c
> [ 10.165051] 8585b100 00000001 00002cc2 ffffffff 80c70000
> 00000000 00001000 c02a1000
> [ 10.173487] 00001000 85de1348 c0390000 8585b280 00000000
> 85de1374 00000000 c03701bc
> [ 10.181924] c036cad4 00000001 00000dc0 00000001 85de1348
> 0000c000 00001000 843fba4c
> [ 10.190359] 85de1348 00004000 00001000 843fba4c 843fbaf0
> 8585b280 85d5ba00 c0380000
> [ 10.198797] ...
> [ 10.201269] Call Trace:
> [ 10.203734] [<8011a838>] blast_inv_dcache_range+0x10/0x24
> [ 10.209165] [<8011ac58>] ingenic_xburst_dma_cache_inv+0x98/0xa0
> [ 10.215117] [<8011a57c>] dma_sync_phys+0x10c/0x1e4
> [ 10.219942] [<c03701bc>] CheckExecuteCacheOp+0x178/0x264
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.228482] [<c0371f7c>] OSInvalidateCPUCacheRangeKM+0x24/0x30
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.237478] [<c036cb1c>] NewVMallocLinuxMemArea+0x94/0x100
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.246128] [<c036f998>] OSAllocPages_Impl+0x60/0x12c
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.254342] [<c03644bc>] MMU_Initialise+0x138/0x358
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.262385] [<c0352bec>] BM_CreateContext+0x1a0/0x2bc
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.270599] [<c0366bdc>] DevInitSGXPart1+0xf8/0x1d4
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.278641] [<c035d5f8>] PVRSRVInitialiseDevice+0xfc/0x114
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.287291] [<c0349958>] SysInitialise+0x538/0x57c
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.295243] [<c036f3a8>] PVRCore_Init+0x114/0x124
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.303111] [<c034a1a4>] pvr_probe+0x18c/0x238
> [pvrsrvkm_jz4780_sgx540_130]
> [ 10.310693] [<805e4740>] platform_probe+0x68/0xc0
> [ 10.315431] [<805e2488>] really_probe+0x18c/0x318
> [ 10.320167] [<805e2704>] __driver_probe_device+0xf0/0xf8
> [ 10.325510] [<805e274c>] driver_probe_device+0x40/0xd0
> [ 10.330679] [<805e2c40>] __driver_attach+0xe4/0xf8
> [ 10.335501] [<805e0390>] bus_for_each_dev+0x6c/0xb0
> [ 10.340408] [<805e16a4>] bus_add_driver+0x19c/0x1e4
> [ 10.345315] [<805e3664>] driver_register+0xd4/0x114
> [ 10.350220] [<80100eb4>] do_one_initcall+0xa0/0x1dc
> [ 10.355125] [<808b4c48>] do_init_module+0x74/0x214
> [ 10.359946] [<801a2724>] load_module+0x1130/0x194c
> [ 10.364769] [<801a3170>] sys_finit_module+0xb4/0xe4
> [ 10.369675] [<80110800>] syscall_common+0x34/0x58
> [ 10.374411]
More information about the openpvrsgx-devgroup
mailing list