This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: Ppvrsrvkm kernel exception

Part Number: AM3352


Hi,

I am facing a issue regarding the SGX530 kernel module. I have a custom AM335x board and I am using Yocto "Thud" as a build environment. The kernel (4.19.19) is built from the Poky linux-yocto recipe with adjustments for the device tree based on the am335x-evm.dts device tree.

To make use of the SGX530 GPU, I have ported the relevant device tree changes and platform quirks from the "ti-linux-4.19.y" branch of https://git.ti.com/ti-linux-kernel/ti-linux-kernel into my device tree. That allowed me to build the kernel- and userspace drivers for the GPU.

Everything seems to work fine (i.e. Qt applications using the eglfs backend are rendered with hardware acceleration), but when the pvrsrvkm kernel module is initializing a kernel exception is thrown:

...
[    0.168456] l4_wkup_cm:clk:0010:0: failed to disable
...
[    7.998927] gfx_l3_cm:clk:0000:0: failed to enable
[    8.004006] ------------[ cut here ]------------
[    8.008887] WARNING: CPU: 0 PID: 92 at drivers/clk/clk.c:828 clk_core_disable+0x3c/0x1f0
[    8.017383] gfx_l3_cm:clk:0000:0 already disabled
[    8.022321] Modules linked in: pvrsrvkm(O+) tilcdc(+) drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea drm drm_panel_orientation_quirks spidev rtc_omap ti_am335x_tscadc
[    8.042385] CPU: 0 PID: 92 Comm: udevd Tainted: G           O      4.19.19-yocto-standard #1
[    8.051243] Hardware name: Generic AM33XX (Flattened Device Tree)
[    8.057684] [<c0110c90>] (unwind_backtrace) from [<c010cd54>] (show_stack+0x20/0x24)
[    8.065843] [<c010cd54>] (show_stack) from [<c0721b38>] (dump_stack+0x20/0x28)
[    8.073460] [<c0721b38>] (dump_stack) from [<c0132030>] (__warn+0xec/0x104)
[    8.080785] [<c0132030>] (__warn) from [<c013209c>] (warn_slowpath_fmt+0x54/0x74)
[    8.088654] [<c013209c>] (warn_slowpath_fmt) from [<c0454de0>] (clk_core_disable+0x3c/0x1f0)
[    8.097525] [<c0454de0>] (clk_core_disable) from [<c0454fbc>] (clk_core_disable_lock+0x28/0x34)
[    8.106667] [<c0454fbc>] (clk_core_disable_lock) from [<c0454ff4>] (clk_disable+0x2c/0x30)
[    8.115363] [<c0454ff4>] (clk_disable) from [<c0120ba0>] (_disable_clocks+0x28/0x80)
[    8.123508] [<c0120ba0>] (_disable_clocks) from [<c0123410>] (omap_hwmod_deassert_hardreset+0x10c/0x15c)
[    8.133475] [<c0123410>] (omap_hwmod_deassert_hardreset) from [<c0123f48>] (omap_device_deassert_hardreset+0x48/0x58)
[    8.145016] [<c0123f48>] (omap_device_deassert_hardreset) from [<bf13d168>] (PVRSRVDrmProbe+0x3c/0xc8 [pvrsrvkm])
[    8.156027] [<bf13d168>] (PVRSRVDrmProbe [pvrsrvkm]) from [<c04b1630>] (platform_drv_probe+0x58/0xa4)
[    8.165727] [<c04b1630>] (platform_drv_probe) from [<c04af4b8>] (really_probe+0x1e8/0x2b0)
[    8.174418] [<c04af4b8>] (really_probe) from [<c04af85c>] (driver_probe_device+0x154/0x170)
[    8.183195] [<c04af85c>] (driver_probe_device) from [<c04af914>] (__driver_attach+0x9c/0xd8)
[    8.192063] [<c04af914>] (__driver_attach) from [<c04ad6f4>] (bus_for_each_dev+0x74/0xb0)
[    8.200657] [<c04ad6f4>] (bus_for_each_dev) from [<c04aee84>] (driver_attach+0x28/0x30)
[    8.209068] [<c04aee84>] (driver_attach) from [<c04ae910>] (bus_add_driver+0x184/0x1ec)
[    8.217481] [<c04ae910>] (bus_add_driver) from [<c04b0478>] (driver_register+0xbc/0x100)
[    8.225988] [<c04b0478>] (driver_register) from [<c04b1578>] (__platform_driver_register+0x40/0x54)
[    8.235677] [<c04b1578>] (__platform_driver_register) from [<bf17e030>] (PVRSRVDrmInit+0x30/0x1000 [pvrsrvkm])
[    8.246370] [<bf17e030>] (PVRSRVDrmInit [pvrsrvkm]) from [<c01034c8>] (do_one_initcall+0x84/0x170)
[    8.255799] [<c01034c8>] (do_one_initcall) from [<c0194494>] (do_init_module+0x6c/0x1f4)
[    8.264305] [<c0194494>] (do_init_module) from [<c01963b4>] (load_module+0x1cc4/0x1e00)
[    8.272719] [<c01963b4>] (load_module) from [<c0196714>] (sys_finit_module+0xa4/0xc4)
[    8.280949] [<c0196714>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
[    8.289534] Exception stack(0xce68bfa8 to 0xce68bff0)
[    8.294845] bfa0:                   00000000 0047f380 00000008 b6eef418 00000000 00000000
[    8.303438] bfc0: 00000000 0047f380 be92a8ec 0000017b 00000000 00450464 00000000 0047f380
[    8.312026] bfe0: be92a808 be92a7f8 b6ee75ac b6e6af50
[    8.317330] ---[ end trace ad59f82dec5deb2e ]---
[    8.387918] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    8.394897] [drm] No driver support for vblank timestamp query.
[    8.657966] Console: switching to colour frame buffer device 60x34
[    8.741666] tilcdc 4830e000.lcdc: fb0: DRM emulated frame buffer device
[    8.823188] [drm] Initialized tilcdc 1.0.0 20121205 for 4830e000.lcdc on minor 0
[    9.160591] [drm] Initialized pvr 1.17.4948957 20110701 for 56000000.sgx on minor 1
...

I think that it is caused by the omap_device_deassert_hardreset call during the platform driver initialization, that tries to reset the gfx_l3_cm clock - which the kernel also fails to enable previously. And I also noticed in the kernel log that the l4_wkup_cm clock also fails to disable during boot. So I checked the clock definitions in the device tree whether I have changes compared to the TI kernel. But my am33xx-clocks.dtsi file is the same as in the TI kernel.

What other device tree entry could cause such an issue? Or am I missing something else?

  • Hello,

    I just wanted to confirm that you are able to run your application despite the Kernel warning during bootup. Have you tried running the following SGX based examples to ensure SGX is fully functional?

    Regards,
    Krunal

  • Hi Krunal,

    Yes, all the SGX Examples I tried (Raw/OGLES2Coverflow, Raw/OGLES2ChameleonMan, Raw/OGLES2ExampleUI, Raw/OGLES2Navigation) run smoothly with out exceptions:

    # /usr/bin/SGX/demos/Raw/OGLES2Coverflow
    PVRShell: EGL 1.4 initialized

    Regards,

    Martin

  • Hi Martin,

    If you remove the pvrsrvkm module and insert it again, do you still see the same issue? I just wanted to confirm that the messages are only observed during boot up. 

    Regards,
    Krunal

  • Hi Krunal,

    Yes, the exception also occurs during re-insertion of the module:

    # /etc/init.d/rc.pvr stop
    Unloaded PowerVR consumer services.
    # lsmod
    Module                  Size  Used by
    edt_ft5x06             20480  0
    skyboard_asyncevent    16384  0
    skyboard_fpga          20480  8
    uio                    20480  17 skyboard_fpga
    fuse                   98304  3
    ti_am335x_adc          20480  0
    kfifo_buf              16384  1 ti_am335x_adc
    industrialio           73728  2 ti_am335x_adc,kfifo_buf
    tilcdc                 36864  1
    drm_kms_helper        172032  2 tilcdc
    cfbfillrect            16384  1 drm_kms_helper
    syscopyarea            16384  1 drm_kms_helper
    cfbimgblt              16384  1 drm_kms_helper
    sysfillrect            16384  1 drm_kms_helper
    sysimgblt              16384  1 drm_kms_helper
    fb_sys_fops            16384  1 drm_kms_helper
    cfbcopyarea            16384  1 drm_kms_helper
    drm                   397312  3 tilcdc,drm_kms_helper
    drm_panel_orientation_quirks    16384  1 drm
    spidev                 16384  0
    rtc_omap               20480  1
    ti_am335x_tscadc       16384  1 ti_am335x_adc
    # /etc/init.d/rc.pvr start
    Loaded PowerVR consumer services.
    # cat /var/log/messages
    Oct 18 12:07:12 EvalBoard user.err kernel: [247627.504269] gfx_l3_cm:clk:0000:0: failed to enable
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504306] ------------[ cut here ]------------
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504349] WARNING: CPU: 0 PID: 10540 at drivers/clk/clk.c:828 clk_core_disable+0x3c/0x1f0
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504356] gfx_l3_cm:clk:0000:0 already disabled
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504363] Modules linked in: pvrsrvkm(O+) edt_ft5x06 skyboard_asyncevent(O) skyboard_fpga(O) uio fuse ti_am335x_adc kfifo_buf industrialio tilcdc drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_s
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504493] CPU: 0 PID: 10540 Comm: modprobe Tainted: G        W  O      4.19.19-yocto-standard #1
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504500] Hardware name: Generic AM33XX (Flattened Device Tree)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504551] [<c0110c90>] (unwind_backtrace) from [<c010cd54>] (show_stack+0x20/0x24)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504588] [<c010cd54>] (show_stack) from [<c0721b38>] (dump_stack+0x20/0x28)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504627] [<c0721b38>] (dump_stack) from [<c0132030>] (__warn+0xec/0x104)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504649] [<c0132030>] (__warn) from [<c013209c>] (warn_slowpath_fmt+0x54/0x74)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504670] [<c013209c>] (warn_slowpath_fmt) from [<c0454de0>] (clk_core_disable+0x3c/0x1f0)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504691] [<c0454de0>] (clk_core_disable) from [<c0454fbc>] (clk_core_disable_lock+0x28/0x34)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504709] [<c0454fbc>] (clk_core_disable_lock) from [<c0454ff4>] (clk_disable+0x2c/0x30)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504736] [<c0454ff4>] (clk_disable) from [<c0120ba0>] (_disable_clocks+0x28/0x80)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504762] [<c0120ba0>] (_disable_clocks) from [<c0123410>] (omap_hwmod_deassert_hardreset+0x10c/0x15c)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.504785] [<c0123410>] (omap_hwmod_deassert_hardreset) from [<c0123f48>] (omap_device_deassert_hardreset+0x48/0x58)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505191] [<c0123f48>] (omap_device_deassert_hardreset) from [<bf222168>] (PVRSRVDrmProbe+0x3c/0xc8 [pvrsrvkm])
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505456] [<bf222168>] (PVRSRVDrmProbe [pvrsrvkm]) from [<c04b1630>] (platform_drv_probe+0x58/0xa4)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505482] [<c04b1630>] (platform_drv_probe) from [<c04af4b8>] (really_probe+0x1e8/0x2b0)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505504] [<c04af4b8>] (really_probe) from [<c04af85c>] (driver_probe_device+0x154/0x170)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505524] [<c04af85c>] (driver_probe_device) from [<c04af914>] (__driver_attach+0x9c/0xd8)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505543] [<c04af914>] (__driver_attach) from [<c04ad6f4>] (bus_for_each_dev+0x74/0xb0)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505562] [<c04ad6f4>] (bus_for_each_dev) from [<c04aee84>] (driver_attach+0x28/0x30)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505582] [<c04aee84>] (driver_attach) from [<c04ae910>] (bus_add_driver+0x184/0x1ec)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505601] [<c04ae910>] (bus_add_driver) from [<c04b0478>] (driver_register+0xbc/0x100)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505621] [<c04b0478>] (driver_register) from [<c04b1578>] (__platform_driver_register+0x40/0x54)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.505826] [<c04b1578>] (__platform_driver_register) from [<bf263030>] (PVRSRVDrmInit+0x30/0x1000 [pvrsrvkm])
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506033] [<bf263030>] (PVRSRVDrmInit [pvrsrvkm]) from [<c01034c8>] (do_one_initcall+0x84/0x170)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506064] [<c01034c8>] (do_one_initcall) from [<c0194494>] (do_init_module+0x6c/0x1f4)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506086] [<c0194494>] (do_init_module) from [<c01963b4>] (load_module+0x1cc4/0x1e00)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506106] [<c01963b4>] (load_module) from [<c0196714>] (sys_finit_module+0xa4/0xc4)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506125] [<c0196714>] (sys_finit_module) from [<c0101000>] (ret_fast_syscall+0x0/0x54)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506135] Exception stack(0xcc8e3fa8 to 0xcc8e3ff0)
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506151] 3fa0:                   00000000 00000000 00000003 004a26a4 00000000 00000000
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506167] 3fc0: 00000000 00000000 00040000 0000017b 00000000 00000000 00000000 004b7358
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506179] 3fe0: be9b7950 be9b7940 00499944 b6e94f50
    Oct 18 12:07:12 EvalBoard user.warn kernel: [247627.506188] ---[ end trace 89509bad4c0f48fc ]---
    Oct 18 12:07:12 EvalBoard user.err kernel: [247627.515922] skyboard-fpga 1000000.fpga: Misaligned frame received!
    Oct 18 12:07:12 EvalBoard user.err kernel: [247627.515951] skyboard-fpga 1000000.fpga: FPGA GPMC controller error register @0x1E = 0x05
    Oct 18 12:07:12 EvalBoard user.err kernel: [247627.515962] skyboard-fpga 1000000.fpga: Disabling DAQ due to an error!
    Oct 18 12:07:12 EvalBoard user.info kernel: [247627.515974] skyboard-fpga 1000000.fpga: disabling DMA engine
    Oct 18 12:07:12 EvalBoard user.debug kernel: [247627.515986] skyboard-fpga 1000000.fpga: cleaning up dma transfers...
    Oct 18 12:07:12 EvalBoard user.debug kernel: [247627.516003] skyboard-fpga 1000000.fpga: dma transfer cleanup done.
    Oct 18 12:07:12 EvalBoard user.info kernel: [247627.520594] [drm] Initialized pvr 1.17.4948957 20110701 for 56000000.sgx on minor 1
    Oct 18 12:07:12 EvalBoard user.info kernel: [247627.550624] PVR_K: UM DDK-(4948957) and KM DDK-(4948957) match. [ OK ]

    Regards,

    Martin

  • Hello Martin,

    We are not observing the issue on our setup and could please share which Yocto branch was used to build the Kernel module.

    Regards,
    Krunal

  • Hi Krunal,

    > We are not observing the issue on our setup

    That's good to hear, since it indicates that the issue has to do with our modifications. Which leads to my next question: What subsystems besides the GPU are attached to the gfx_l3_cm clock? Knowing that might give me a hint to look for in our modifications.

    > could please share which Yocto branch was used to build the Kernel module

    Sure: It's the "v4.19/standard/beaglebone" branch of the linux-yocto repository.

    Thanks for your help!

    Regards,

    Martin

  • Hi Krunal,

    I just found a topic on the Arch Linux ARM forum, that seem to be caused by the same issue but is otherwise unrelated to the pvrsrvkm module: BeagleBone Black Kernel Panic.

    Perhaps that helps.

    Regards,

    Martin

  • Hi Matrin,

    I am not familiar with the branch you are using and I am wondering if you could please use the Kernel v4.19.59 that comes with our latest PSDK. Here is the software manifest that contains all the branches we have used in the PSDK6.0.

    Regards,
    Krunal