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.

DM3730: SGX Hardware Recovery triggered

Other Parts Discussed in Thread: DM3730, OMAP3530

Hi,

I'm working on a touch screen based on dm3730 with ti-dvsdk_dm3730-evm_04_03_00_06.

I'm having SGX errors and consequent reboots on starting/killing the GUI based on qt 5.1.0.

The problem happens randomly but it's easy to recreate it just by starting and killing the process for a sufficient number of loops.

Does someone know how to fix this issue? Thanks in advance.

Here is the error log from dmesg command (at the end there's also the info printed by the gfx_check script):

[ 279.062713] PVR_K: HWRecoveryResetSGX: SGX Hardware Recovery triggered
[ 279.062713] PVR_K: SGX debug (1.6.16.3977)
[ 279.062744] PVR_K: (P0) EUR_CR_EVENT_STATUS: 20000000
[ 279.062744] PVR_K: (P0) EUR_CR_EVENT_STATUS2: 00000000
[ 279.062774] PVR_K: (P0) EUR_CR_BIF_CTRL: 00000000
[ 279.062774] PVR_K: (P0) EUR_CR_BIF_INT_STAT: 00004004
[ 279.062774] PVR_K: (P0) EUR_CR_BIF_FAULT: 0E40A000
[ 279.062805] PVR_K: (P0) EUR_CR_BIF_MEM_REQ_STAT: 00000000
[ 279.062805] PVR_K: (P0) EUR_CR_CLKGATECTL: 00222220
[ 279.062835] PVR_K: (P0) EUR_CR_PDS_PC_BASE: 00203360
[ 279.062835] PVR_K: Flip Command Complete Data 0 for display device 1:
[ 279.062835] PVR_K: SRC 0: (Not in use)
[ 279.062866] PVR_K: SRC 1: (Not in use)
[ 279.062866] PVR_K: SGX Host control:
[ 279.062866] PVR_K: (HC-0) 0x00000001 0x00000000 0x00000000 0x00000001
[ 279.062896] PVR_K: (HC-10) 0x00000000 0x00000001 0x0000000A 0x00030D40
[ 279.062896] PVR_K: (HC-20) 0x00000002 0x00000000 0x00000001 0x00000000
[ 279.062927] PVR_K: (HC-30) 0x0000000C 0x000001D2 0xFEC253DC 0x00000000
[ 279.062927] PVR_K: SGX TA/3D control:
[ 279.062957] PVR_K: (T3C-0) 0x0F003000 0x0F003120 0x0F002000 0x00000000
[ 279.062957] PVR_K: (T3C-10) 0x00000000 0x00000001 0x00000002 0x00000001
[ 279.062988] PVR_K: (T3C-20) 0x0F007F40 0x00000000 0x00000000 0x00000000
[ 279.062988] PVR_K: (T3C-30) 0x00000000 0x00000000 0x00000000 0x00000000
[ 279.062988] PVR_K: (T3C-40) 0x00000000 0x00000000 0x00000000 0x00000000
[ 279.063018] PVR_K: (T3C-50) 0x00000000 0x00000000 0x00000000 0x00000000
[ 279.063018] PVR_K: (T3C-60) 0x00000000 0x00000000 0x00000000 0x00000000
[ 279.063049] PVR_K: (T3C-70) 0x00000000 0x00000000 0x00000000 0x00000000
[ 279.063049] PVR_K: (T3C-80) 0x00000000 0x00000000 0x00000000 0x0F000000
[ 279.063079] PVR_K: (T3C-90) 0x9B968000 0x0F089000 0x00000000 0x0F0883A0
[ 279.063079] PVR_K: (T3C-A0) 0x0F007F40 0x00000000 0x0F088200 0x00000000
[ 279.063110] PVR_K: (T3C-B0) 0x00000000 0x00000003 0x00000001 0x00000000
[ 279.063110] PVR_K: (T3C-C0) 0x00000004 0x00000000 0x00000000 0x00000000
[ 279.063140] PVR_K: (T3C-D0) 0x00000000 0x00000000 0x00000000 0x00000000
[ 279.063140] PVR_K: (T3C-E0) 0x00000001 0x00000001 0x0F000000 0x80008000
[ 279.063140] PVR_K: (T3C-F0) 0x80048000 0x0F004000 0x0F007C20 0x0F002020
[ 279.063171] PVR_K: (T3C-100) 0x00000000 0x00000000 0x00000000 0x00000000
[ 279.063171] PVR_K: SGX Kernel CCB WO:0x43 RO:0x40
[ 279.250213] PVR_K: HWRecoveryResetSGX: SGX Hardware Recovery triggered
[ 279.250244] PVR_K: SGX debug (1.6.16.3977)
[ 279.250244] PVR_K: (P0) EUR_CR_EVENT_STATUS: 20000000
[ 279.250274] PVR_K: (P0) EUR_CR_EVENT_STATUS2: 00000000
[ 279.250274] PVR_K: (P0) EUR_CR_BIF_CTRL: 00000000
[ 279.250274] PVR_K: (P0) EUR_CR_BIF_INT_STAT: 00004004
[ 279.250305] PVR_K: (P0) EUR_CR_BIF_FAULT: 0E40A000
[ 279.250305] PVR_K: (P0) EUR_CR_BIF_MEM_REQ_STAT: 00000000
[ 279.250335] PVR_K: (P0) EUR_CR_CLKGATECTL: 00222220
[ 279.250335] PVR_K: (P0) EUR_CR_PDS_PC_BASE: 00203360
[ 279.250335] PVR_K: Flip Command Complete Data 0 for display device 1:
[ 279.250366] PVR_K: SRC 0: (Not in use)
[ 279.250366] PVR_K: SRC 1: (Not in use)

 

root@baia:~# ./gfx_check.sh

WSEGL settings
[default]

WindowSystem=libpvrPVR2D_FLIPWSEGL.so
------
ARM CPU information
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 179.59
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc08
CPU revision : 2

Hardware : OMAP3 BAIA
Revision : 0220
Serial : 0000000000000000
------
SGX driver information
Version 1.6.16.3977 (release) /home/sources/TS10_PREMIUM/TS10_PACKAGES/ti-dvsdk_dm3730-evm_04_03_00_06/graphics-sdk_4.03.00.02/GFX_Linux_KM
System Version String: SGX revision = 1.2.5
------
Framebuffer settings

mode "1280x800"
geometry 1280 800 1280 2400 32
timings 0 0 0 0 0 0 0
rgba 8/16,8/8,8/0,8/24
endmode

Frame buffer device information:
Name : omapfb
Address : 0x9f000000
Size : 16777216
Type : PACKED PIXELS
Visual : TRUECOLOR
XPanStep : 1
YPanStep : 1
YWrapStep : 0
LineLength : 5120
Accelerator : No
------
Rotation settings
0
------
Kernel Module information
Module Size Used by
g_ether 37490 0
sdmak 4118 0
lpm_omap3530 7235 0
dsplinkk 135721 1 lpm_omap3530
cmemk 24171 0
bufferclass_ti 5204 0
omaplfb 8648 0
pvrsrvkm 155887 6 bufferclass_ti,omaplfb
uinput 6958 2
wl12xx_sdio 3491 0
wl12xx 122438 1 wl12xx_sdio
mac80211 215835 1 wl12xx
cfg80211 157725 2 wl12xx,mac80211
compat 5976 2 wl12xx,mac80211
atmel_mxt_ts 9826 0
------
Boot settings
console=ttyO2,115200n8 ro mem=55M@0x80000000 mpurate=1000 mem=384M@0x88000000 omap_vout.vid1_static_vrfb_alloc=y omapfb.vram=0:16M root=/dev/mmcblk1p6 omapdss.def_disp=lcd ip=off snd-soc-core.pmdown_time=50 quiet rootwait lpj=2334720 board_omap3baia.connector_board_type=2 board_omap3baia.connector_board_rev=2 7
------
Linux Kernel version
Linux baia 2.6.37-g1efd8ad #1 Tue Mar 11 09:45:06 CET 2014 armv7l GNU/Linux

  • Hi Lorenzo,

    I have need of more information to investigate the SGX issue.

    Could you describe in details step by step how to reproduce the issue?

    Are you using prebuilt SGX driver or you have built it? If you have built the SGX driver could you share whether follow some tutorial and if true could you post a link to it or post some description of the steps.

    BR

    Tsvetolin Shulev

  • Hi! Thank you very much for the quick reply.

    I'll try to explain better with more details, let me know if you need further info or if you can suggest some debugging procedure...

    I'm working on a commercial product (a 10'' touch screen) based on DM3730.

    We customized the 2.6.37 kernel for our own board and we're building the complete rootfs starting from the ti-dvsdk_dm3730-evm_04_03_00_06 (the last available as far as I know for this CPU) which uses graphics-sdk_4.03.00.02/ for building the sgx kernel modules and the libraries when doing a 'make opengldemos' (e.g. gfx_dbg_es5.x/libpvrPVR2D_FRONTWSEGL.so).

    On top of that we compile the qt 5.1.0 framework and our qml based GUI.

    First we saw the problem when handling the display poweroff. Every time the timeout occurs our touchscreen goes to powersaving mode turning off the LCD and the backlight. And that triggered the problem EVERY time. So we avoided the problem just turning off the backlight without turning off the display: in this way the SGX never complains... So now when the GUI is up it seems pretty stable.

    Unfortunately the issue still happens on starting/killing the GUI (which happens anytime the user saves the application configuration and the GUI is restarted). In this case the problem doesn't always happen... we created a simple script to trigger it just by sending a killall and then restaring the GUI after a short sleep.

    Sometimes the SGX recovery triggers on GUI start, other times on GUI kill... It's random but we need no more than 20 loops to recreate it. That happens without even interacting with the GUI (so just the main page showing without animations or any transition activated since the device is left untouched and just the script is running)

    We also handle the CPU frequency which is normally 1GHz but scaled down to 300Mhz whenever the display is turned off. I tried to work on that but it doesn't seem to be the problem.

    Hope this provides some more informations... Let me know if you need anything else... We're really stuck with this problem.

    Thanks a lot

  • Hi Lorenzo,

    After deep investigating of the log I can say that the HW Recovery is triggered due to SGX stuck. This is indicated by the EUR_CR_EVENT_STATUS. The problem is related to memory management. The reason for the stuck seem had been page fault in the MMU. Probably you have try to write on read-only memory or access a page that is mapped in the virtual address space, but not loaded in the physical memory.

    Could you check the values of the EUR_CR_EVENT_STATUS and EUR_CR_BIF_INT_STAT several crashes. If the values are different in each one log could post the logs of different crashes?

    BR

    Tsvetolin Shulev

  • Hi, Thanks for you reply!

    We tried to trigger in loop a total of 20 OpenGL crashtest saving the dmesg output on SGX Hardware recovery.
    I'm sending you all the logs as an archive... 0121.SGX_pb_minicom.tar.gz

    You can see that the recovery is
    triggered continuosly until an hardware reboot is performed.

    Concerning the two registers you mentioned:
    EUR_CR_EVENT_STATUS register has always the same value: 20000000

    EUR_CR_BIF_INT_STAT register seems to be always 00004004 with a little exception:
    On some logs the first printed value is 00004008 then it returns to be always 00004004
    (As you can see in the attached logs)

    I hope this helps to clarify the problem or at least to suggest a new way to debug it.
    Tell me if you need anything else, Thank you very much.

    Lorenzo Rimoldi

    NOTE: I didn't mention that in a previous version of our firmware (on the same hardware) we used QT version 4.8.0 and we never saw the problem... It started when using the newer 5.1.0 (which is now mandatory for us). Don't know if it helps in any way but It's just to give you all the possible informations.

  • Hi Lorenzo,

    After I read the additional clarification about difference in the behavior between QT version 4.8.0 and v5.1.0 I suggest you to try with the last QT v5.3.0 from the link:

    http://qt-project.org/downloads

    I assume it is possible to presents some unreported bug with v5.1.0.

    But after I seen the values of the EUR_CR_EVENT_STATUS and EUR_CR_BIF_INT_STAT I still think that the reason for the SGX crush is in the memory management.

    BR

    Tsvetolin Shulev

  • Hi!

    Thanks as usual for your precious support.

    Unfortunately I already tried qt 5.3.0.  That was my last chance before trying to get some help directly from the forum.

    I managed to cross-compile qt 5.3.0 and our GUI but the behavior seems the same that we have on our "stable" firmware based on 5.1.0.

    What do you suggest to investigate the memory problem? should I put some debug logs in the pvr kernel modules? or maybe in the qt libraries? or do you have any other suggestion?

    Let me know if you have any idea.

    Thanks, bye

    Lorenzo Rimoldi

  • Lorenzo,

    As I understand the logs have been made after starting/killing the GUI. This case is hard to be debugged by debug messages because the SGX sources must be debugged. The SGX starting/killing is not a good practice although the SGX must not crushing during this conditions. I suggest you to use the workaround with switching off/on the LCD back light.

    In addition I would like to see one log from display power off/on - CLI output during this operation and dmesg.

    BR

    Tsvetolin Shulev

  • Hi,
    to answer your questions:

    1) dmesg output doesn't change after lcd ON/OFF command, which is:
    echo 1 > /sys/devices/platform/omapdss/display0/enabled (echo 0 to turn OFF)
    We also don't have any CLI log.

    2) The SGX recovery isn't triggered by switching ON/OFF, what happens is that if we leave the display OFF at some point (after approximately 1 to 5 minutes) the reset occurs, even without any interaction with the GUI

    I run strace on the GUI process while turning off the screen and keeping an eye on dmesg for changes...

    The only visible effect is this first message (without doing anything, just waiting with the lcd OFF):

    [ 1371.740417] PVR_K: User requested SGX debug info
    [ 1371.745269] PVR_K: SGX debug (1.6.16.3977)
    [ 1371.749633] PVR_K: Flip Command Complete Data 0 for display device 1:
    [ 1371.756408] PVR_K: SRC 0: ROC DevVAddr:0xD80109C ROP:0x4 ROC:0x2, WOC DevVAddr:0xD801094 WOP:0x2 WOC:0x2
    [ 1371.766418] PVR_K: SRC 1: ROC DevVAddr:0xD8010CC ROP:0x5 ROC:0x3, WOC DevVAddr:0xD8010C4 WOP:0x3 WOC:0x2
    [ 1371.776428] PVR_K: SGX Host control:
    [ 1371.780212] PVR_K: (HC-0) 0x00000001 0x0000000C 0x00000000 0x00000001
    [ 1371.787048] PVR_K: (HC-10) 0x00000000 0x00000000 0x0000000A 0x00030D40
    [ 1371.793945] PVR_K: (HC-20) 0x00000002 0x00000000 0x00000000 0x00000000
    [ 1371.800903] PVR_K: (HC-30) 0x0000000F 0x000000D2 0x035AD914 0x00000000
    [ 1371.807830] PVR_K: SGX TA/3D control:
    [ 1371.811676] PVR_K: (T3C-0) 0x0F003000 0x0F003120 0x0F002000 0x00000000
    [ 1371.819885] PVR_K: (T3C-10) 0x00000000 0x00000001 0x00000002 0x00000001
    [ 1371.826934] PVR_K: (T3C-20) 0x0F007F40 0x00000000 0x00000000 0x00000000
    [ 1371.833953] PVR_K: (T3C-30) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 1371.840972] PVR_K: (T3C-40) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 1371.847991] PVR_K: (T3C-50) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 1371.855041] PVR_K: (T3C-60) 0x00000000 0x00000000 0x00000000 0x0F007F40
    [ 1371.862060] PVR_K: (T3C-70) 0x00000000 0x00000000 0x0F007F40 0x00000000
    [ 1371.869079] PVR_K: (T3C-80) 0x00000000 0x00000000 0x00000000 0x0F000000
    [ 1371.876129] PVR_K: (T3C-90) 0x9BBB1000 0x0F08E580 0x00000000 0x0F088880
    [ 1371.883148] PVR_K: (T3C-A0) 0x0F007F40 0x00000000 0x0F0883A0 0x00000000
    [ 1371.890167] PVR_K: (T3C-B0) 0x00000000 0x00000003 0x00000000 0x00000000
    [ 1371.897186] PVR_K: (T3C-C0) 0x00000004 0x00000000 0x00000000 0x00000000
    [ 1371.904235] PVR_K: (T3C-D0) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 1371.911224] PVR_K: (T3C-E0) 0x00000008 0x00000006 0x0F000000 0x80008000
    [ 1371.919586] PVR_K: (T3C-F0) 0x80048000 0x0F004000 0x0F007C20 0x0F002020
    [ 1371.926605] PVR_K: (T3C-100) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 1371.933715] PVR_K: SGX Kernel CCB WO:0x38 RO:0x38

    After a short time after that the recovery is triggered:

    [ 3954.416534] PVR_K: HWRecoveryResetSGX: SGX Hardware Recovery triggered
    [ 3954.423400] PVR_K: SGX debug (1.6.16.3977)
    [ 3954.427764] PVR_K: (P0) EUR_CR_EVENT_STATUS: 20000000
    [ 3954.433441] PVR_K: (P0) EUR_CR_EVENT_STATUS2: 00000000
    [ 3954.439086] PVR_K: (P0) EUR_CR_BIF_CTRL: 00000000
    [ 3954.444763] PVR_K: (P0) EUR_CR_BIF_INT_STAT: 00004008
    [ 3954.450439] PVR_K: (P0) EUR_CR_BIF_FAULT: 0C840000
    [ 3954.456115] PVR_K: (P0) EUR_CR_BIF_MEM_REQ_STAT: 00000002
    [ 3954.461730] PVR_K: (P0) EUR_CR_CLKGATECTL: 00222220
    [ 3954.467407] PVR_K: (P0) EUR_CR_PDS_PC_BASE: 00000000
    [ 3954.474456] PVR_K: Flip Command Complete Data 0 for display device 1:
    [ 3954.481201] PVR_K: SRC 0: (Not in use)
    [ 3954.485229] PVR_K: SRC 1: (Not in use)
    [ 3954.489257] PVR_K: SGX Host control:
    [ 3954.493011] PVR_K: (HC-0) 0x00000001 0x00000000 0x00000000 0x00000001
    [ 3954.499847] PVR_K: (HC-10) 0x00000000 0x00000001 0x0000000A 0x00030D40
    [ 3954.506774] PVR_K: (HC-20) 0x00000002 0x00000000 0x00000001 0x00000000
    [ 3954.513732] PVR_K: (HC-30) 0x00000015 0x000008CF 0xD9C88610 0x00000000
    [ 3954.520660] PVR_K: SGX TA/3D control:
    [ 3954.524475] PVR_K: (T3C-0) 0x0F003000 0x0F003120 0x0F002000 0x00000000
    [ 3954.531433] PVR_K: (T3C-10) 0x00000000 0x00000001 0x00000002 0x00000001
    [ 3954.538452] PVR_K: (T3C-20) 0x0F007F40 0x00000000 0x00000000 0x00000004
    [ 3954.545471] PVR_K: (T3C-30) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 3954.552520] PVR_K: (T3C-40) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 3954.559539] PVR_K: (T3C-50) 0x00000000 0x0F007F40 0x00000000 0x00000000
    [ 3954.567871] PVR_K: (T3C-60) 0x0F007F40 0x00000000 0x00000000 0x0F007F40
    [ 3954.574890] PVR_K: (T3C-70) 0x00000000 0x00000000 0x0F007F40 0x00000000
    [ 3954.581939] PVR_K: (T3C-80) 0x00000000 0x0F0BC50C 0x00000000 0x0F000000
    [ 3954.588958] PVR_K: (T3C-90) 0x9BBB1000 0x0F08F540 0x00000000 0x0F088200
    [ 3954.595977] PVR_K: (T3C-A0) 0x0F007F40 0x0F0BC414 0x0F088880 0x00040000
    [ 3954.602996] PVR_K: (T3C-B0) 0x0F0BC4C0 0x00000003 0x00000001 0x00000000
    [ 3954.610015] PVR_K: (T3C-C0) 0x00000004 0x00000000 0x00000000 0x00000000
    [ 3954.617034] PVR_K: (T3C-D0) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 3954.624084] PVR_K: (T3C-E0) 0x00000008 0x00000008 0x0F000000 0x80008000
    [ 3954.631103] PVR_K: (T3C-F0) 0x80048000 0x0F004000 0x0F007C20 0x0F002020
    [ 3954.638122] PVR_K: (T3C-100) 0x0F088000 0x0F088000 0x00000000 0x00000000
    [ 3954.645233] PVR_K: SGX Kernel CCB WO:0x51 RO:0x4C
    [ 4971.359771] PVR_K: User requested SGX debug info
    [ 4971.364593] PVR_K: SGX debug (1.6.16.3977)
    [ 4971.368865] PVR_K: Flip Command Complete Data 0 for display device 1:
    [ 4971.375579] PVR_K: SRC 0: ROC DevVAddr:0xD80109C ROP:0x7 ROC:0x4, WOC DevVAddr:0xD801094 WOP:0x4 WOC:0x3
    [ 4971.385528] PVR_K: SRC 1: ROC DevVAddr:0xD8010CC ROP:0x8 ROC:0x5, WOC DevVAddr:0xD8010C4 WOP:0x4 WOC:0x3
    [ 4971.395507] PVR_K: SGX Host control:
    [ 4971.399230] PVR_K: (HC-0) 0x00000001 0x0000000C 0x00000001 0x00000001
    [ 4971.406005] PVR_K: (HC-10) 0x00000000 0x00000001 0x0000000A 0x00030D40
    [ 4971.412902] PVR_K: (HC-20) 0x00000002 0x00000000 0x00000000 0x00000000
    [ 4971.419769] PVR_K: (HC-30) 0x00000017 0x000008F0 0xD9DD2544 0x00000000
    [ 4971.427398] PVR_K: SGX TA/3D control:
    [ 4971.431213] PVR_K: (T3C-0) 0x0F003000 0x0F003120 0x0F002000 0x00000000
    [ 4971.438079] PVR_K: (T3C-10) 0x00000000 0x00000001 0x00000002 0x00000001
    [ 4971.445068] PVR_K: (T3C-20) 0x0F007F40 0x00000000 0x00000000 0x00000000
    [ 4971.452026] PVR_K: (T3C-30) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 4971.459014] PVR_K: (T3C-40) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 4971.465972] PVR_K: (T3C-50) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 4971.472961] PVR_K: (T3C-60) 0x00000000 0x00000000 0x00000000 0x0F007F40
    [ 4971.479949] PVR_K: (T3C-70) 0x00000000 0x00000000 0x0F007F40 0x00000000
    [ 4971.486907] PVR_K: (T3C-80) 0x00000000 0x00000000 0x00000000 0x0F000000
    [ 4971.493896] PVR_K: (T3C-90) 0x9BBB1000 0x0F091040 0x00000000 0x0F088880
    [ 4971.500885] PVR_K: (T3C-A0) 0x0F007F40 0x00000000 0x0F088060 0x00000000
    [ 4971.507843] PVR_K: (T3C-B0) 0x0F0BC4C0 0x00000003 0x00000000 0x00000000
    [ 4971.514801] PVR_K: (T3C-C0) 0x00000004 0x00000000 0x00000000 0x00000000
    [ 4971.522491] PVR_K: (T3C-D0) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 4971.529479] PVR_K: (T3C-E0) 0x0000000C 0x00000009 0x0F000000 0x80008000
    [ 4971.536437] PVR_K: (T3C-F0) 0x80048000 0x0F004000 0x0F007C20 0x0F002020
    [ 4971.543426] PVR_K: (T3C-100) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 4971.550476] PVR_K: SGX Kernel CCB WO:0x58 RO:0x58

    When it happens the GUI isn't doing anything and the strace output just prints endlessly:

             ioctl(10, 0xc01c6743, 0xbefcc824)       = 0

    until I do something like touching the screen and wake it up.

    What can I do to investigate further?

    Thank you very much,

    Lorenzo Rimoldi

  • Hi Lorenzo,

    As I analyzing the last log I can say that:

    [ 1371.740417] PVR_K: User requested SGX debug info  - Some process in the user space crushing.

    [ 1371.933715] PVR_K: SGX Kernel CCB WO:0x38 RO:0x38  - In this moment the SGX Kernel queue is empty. The SGX Kernel still working.

    [ 3954.416534] PVR_K: HWRecoveryResetSGX: SGX Hardware Recovery triggered  - Here start the problems with the SGX Kernel.

    It is necessary to add some debug messages in the SGX Kernel to localize the problem.

    I make some modifications in the .../graphics-sdk_4.03.00.02/GFX_Linux_KM/services4/srvkm/common/queue.c file changing some of the PVR_DBG_MESSAGE to PVR_DBG_ERROR and add a new one. See attachment, prebuild the SGX and try to make a log with the same test from the previous post.

    /**********************************************************************
     *
     * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
     * 
     * This program is free software; you can redistribute it and/or modify it
     * under the terms and conditions of the GNU General Public License,
     * version 2, as published by the Free Software Foundation.
     * 
     * This program is distributed in the hope it will be useful but, except 
     * as otherwise stated in writing, without any warranty; without even the 
     * implied warranty of merchantability or fitness for a particular purpose. 
     * See the GNU General Public License for more details.
     * 
     * You should have received a copy of the GNU General Public License along with
     * this program; if not, write to the Free Software Foundation, Inc.,
     * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
     * 
     * The full GNU General Public License is included in this distribution in
     * the file called "COPYING".
     *
     * Contact Information:
     * Imagination Technologies Ltd. <gpl-support@imgtec.com>
     * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK 
     *
     ******************************************************************************/
    
    #include "services_headers.h"
    
    #include "lists.h"
    
    
    #define DC_NUM_COMMANDS_PER_TYPE		1
    
    typedef struct _DEVICE_COMMAND_DATA_
    {
    	PFN_CMD_PROC			pfnCmdProc;
    	PCOMMAND_COMPLETE_DATA	apsCmdCompleteData[DC_NUM_COMMANDS_PER_TYPE];
    	IMG_UINT32				ui32CCBOffset;
    } DEVICE_COMMAND_DATA;
    
    
    #if defined(__linux__) && defined(__KERNEL__)
    
    #include "proc.h"
    
    void ProcSeqShowQueue(struct seq_file *sfile,void* el)
    {
    	PVRSRV_QUEUE_INFO *psQueue = (PVRSRV_QUEUE_INFO*)el;
    	IMG_INT cmds = 0;
    	IMG_SIZE_T ui32ReadOffset;
    	IMG_SIZE_T ui32WriteOffset;
    	PVRSRV_COMMAND *psCmd;
    
    	if(el == PVR_PROC_SEQ_START_TOKEN)
    	{
    		seq_printf( sfile,
    					"Command Queues\n"
    					"Queue    CmdPtr      Pid Command Size DevInd  DSC  SSC  #Data ...\n");
    		return;
    	}
    
    	ui32ReadOffset = psQueue->ui32ReadOffset;
    	ui32WriteOffset = psQueue->ui32WriteOffset;
    
    	while (ui32ReadOffset != ui32WriteOffset)
    	{
    		psCmd= (PVRSRV_COMMAND *)((IMG_UINTPTR_T)psQueue->pvLinQueueKM + ui32ReadOffset);
    
    		seq_printf(sfile, "%x %x  %5u  %6u  %3u  %5u   %2u   %2u    %3u  \n",
    							(IMG_UINTPTR_T)psQueue,
    							(IMG_UINTPTR_T)psCmd,
    					 		psCmd->ui32ProcessID,
    							psCmd->CommandType,
    							psCmd->ui32CmdSize,
    							psCmd->ui32DevIndex,
    							psCmd->ui32DstSyncCount,
    							psCmd->ui32SrcSyncCount,
    							psCmd->ui32DataSize);
    		
    		ui32ReadOffset += psCmd->ui32CmdSize;
    		ui32ReadOffset &= psQueue->ui32QueueSize - 1;
    		cmds++;
    	}
    
    	if (cmds == 0)
    	{
    		seq_printf(sfile, "%x <empty>\n", (IMG_UINTPTR_T)psQueue);
    	}
    }
    
    void* ProcSeqOff2ElementQueue(struct seq_file * sfile, loff_t off)
    {
    	PVRSRV_QUEUE_INFO *psQueue = IMG_NULL;
    	SYS_DATA *psSysData;
    
    	PVR_UNREFERENCED_PARAMETER(sfile);
    
    	if(!off)
    	{
    		return PVR_PROC_SEQ_START_TOKEN;
    	}
    
    
    	psSysData = SysAcquireDataNoCheck();
    	if (psSysData != IMG_NULL)
    	{
    		for (psQueue = psSysData->psQueueList; (((--off) > 0) && (psQueue != IMG_NULL)); psQueue = psQueue->psNextKM);
    	}
    
    	return psQueue;
    }
    #endif 
    
    #define GET_SPACE_IN_CMDQ(psQueue)										\
    	((((psQueue)->ui32ReadOffset - (psQueue)->ui32WriteOffset)				\
    	+ ((psQueue)->ui32QueueSize - 1)) & ((psQueue)->ui32QueueSize - 1))
    
    #define UPDATE_QUEUE_WOFF(psQueue, ui32Size)							\
    	(psQueue)->ui32WriteOffset = ((psQueue)->ui32WriteOffset + (ui32Size))	\
    	& ((psQueue)->ui32QueueSize - 1);
    
    #define SYNCOPS_STALE(ui32OpsComplete, ui32OpsPending)					\
    	((ui32OpsComplete) >= (ui32OpsPending))
    
    
    static IMG_VOID QueueDumpCmdComplete(COMMAND_COMPLETE_DATA *psCmdCompleteData,
    									 IMG_UINT32				i,
    									 IMG_BOOL				bIsSrc)
    {
    	PVRSRV_SYNC_OBJECT	*psSyncObject;
    
    	psSyncObject = bIsSrc ? psCmdCompleteData->psSrcSync : psCmdCompleteData->psDstSync;
    
    	if (psCmdCompleteData->bInUse)
    	{
    		PVR_LOG(("\t%s %u: ROC DevVAddr:0x%X ROP:0x%x ROC:0x%x, WOC DevVAddr:0x%X WOP:0x%x WOC:0x%x",
    				bIsSrc ? "SRC" : "DEST", i,
    				psSyncObject[i].psKernelSyncInfoKM->sReadOpsCompleteDevVAddr.uiAddr,
    				psSyncObject[i].psKernelSyncInfoKM->psSyncData->ui32ReadOpsPending,
    				psSyncObject[i].psKernelSyncInfoKM->psSyncData->ui32ReadOpsComplete,
    				psSyncObject[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
    				psSyncObject[i].psKernelSyncInfoKM->psSyncData->ui32WriteOpsPending,
    				psSyncObject[i].psKernelSyncInfoKM->psSyncData->ui32WriteOpsComplete))
    	}
    	else
    	{
    		PVR_LOG(("\t%s %u: (Not in use)", bIsSrc ? "SRC" : "DEST", i))
    	}
    }
    
    
    static IMG_VOID QueueDumpDebugInfo_ForEachCb(PVRSRV_DEVICE_NODE *psDeviceNode)
    {
    	if (psDeviceNode->sDevId.eDeviceClass == PVRSRV_DEVICE_CLASS_DISPLAY)
    	{
    		IMG_UINT32				ui32CmdCounter, ui32SyncCounter;
    		SYS_DATA				*psSysData;
    		DEVICE_COMMAND_DATA		*psDeviceCommandData;
    		PCOMMAND_COMPLETE_DATA	psCmdCompleteData;
    
    		SysAcquireData(&psSysData);
    
    		psDeviceCommandData = psSysData->apsDeviceCommandData[psDeviceNode->sDevId.ui32DeviceIndex];
    
    		if (psDeviceCommandData != IMG_NULL)
    		{
    			for (ui32CmdCounter = 0; ui32CmdCounter < DC_NUM_COMMANDS_PER_TYPE; ui32CmdCounter++)
    			{
    				psCmdCompleteData = psDeviceCommandData[DC_FLIP_COMMAND].apsCmdCompleteData[ui32CmdCounter];
    
    				PVR_LOG(("Flip Command Complete Data %u for display device %u:",
    						ui32CmdCounter, psDeviceNode->sDevId.ui32DeviceIndex))
    
    				for (ui32SyncCounter = 0;
    					 ui32SyncCounter < psCmdCompleteData->ui32SrcSyncCount;
    					 ui32SyncCounter++)
    				{
    					QueueDumpCmdComplete(psCmdCompleteData, ui32SyncCounter, IMG_TRUE);
    				}
    
    				for (ui32SyncCounter = 0;
    					 ui32SyncCounter < psCmdCompleteData->ui32DstSyncCount;
    					 ui32SyncCounter++)
    				{
    					QueueDumpCmdComplete(psCmdCompleteData, ui32SyncCounter, IMG_FALSE);
    				}
    			}
    		}
    		else
    		{
    			PVR_LOG(("There is no Command Complete Data for display device %u", psDeviceNode->sDevId.ui32DeviceIndex))
    		}
    	}
    }
    
    
    IMG_VOID QueueDumpDebugInfo(IMG_VOID)
    {
    	SYS_DATA	*psSysData;
    	SysAcquireData(&psSysData);
    	List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList, &QueueDumpDebugInfo_ForEachCb);
    }
    
    
    static IMG_SIZE_T NearestPower2(IMG_SIZE_T ui32Value)
    {
    	IMG_SIZE_T ui32Temp, ui32Result = 1;
    
    	if(!ui32Value)
    		return 0;
    
    	ui32Temp = ui32Value - 1;
    	while(ui32Temp)
    	{
    		ui32Result <<= 1;
    		ui32Temp >>= 1;
    	}
    
    	return ui32Result;
    }
    
    
    IMG_EXPORT
    PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateCommandQueueKM(IMG_SIZE_T ui32QueueSize,
    													 PVRSRV_QUEUE_INFO **ppsQueueInfo)
    {
    	PVRSRV_QUEUE_INFO	*psQueueInfo;
    	IMG_SIZE_T			ui32Power2QueueSize = NearestPower2(ui32QueueSize);
    	SYS_DATA			*psSysData;
    	PVRSRV_ERROR		eError;
    	IMG_HANDLE			hMemBlock;
    
    	SysAcquireData(&psSysData);
    
    	
    	eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    					 sizeof(PVRSRV_QUEUE_INFO),
    					 (IMG_VOID **)&psQueueInfo, &hMemBlock,
    					 "Queue Info");
    	if (eError != PVRSRV_OK)
    	{
    		PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateCommandQueueKM: Failed to alloc queue struct"));
    		goto ErrorExit;
    	}
    	OSMemSet(psQueueInfo, 0, sizeof(PVRSRV_QUEUE_INFO));
    
    	psQueueInfo->hMemBlock[0] = hMemBlock;
    	psQueueInfo->ui32ProcessID = OSGetCurrentProcessIDKM();
    
    	
    	eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    					 ui32Power2QueueSize + PVRSRV_MAX_CMD_SIZE,
    					 &psQueueInfo->pvLinQueueKM, &hMemBlock,
    					 "Command Queue");
    	if (eError != PVRSRV_OK)
    	{
    		PVR_DPF((PVR_DBG_ERROR,"PVRSRVCreateCommandQueueKM: Failed to alloc queue buffer"));
    		goto ErrorExit;
    	}
    
    	psQueueInfo->hMemBlock[1] = hMemBlock;
    	psQueueInfo->pvLinQueueUM = psQueueInfo->pvLinQueueKM;
    
    	
    	PVR_ASSERT(psQueueInfo->ui32ReadOffset == 0);
    	PVR_ASSERT(psQueueInfo->ui32WriteOffset == 0);
    
    	psQueueInfo->ui32QueueSize = ui32Power2QueueSize;
    
    	
    	if (psSysData->psQueueList == IMG_NULL)
    	{
    		eError = OSCreateResource(&psSysData->sQProcessResource);
    		if (eError != PVRSRV_OK)
    		{
    			goto ErrorExit;
    		}
    	}
    
    	
    	eError = OSLockResource(&psSysData->sQProcessResource,
    							KERNEL_ID);
    	if (eError != PVRSRV_OK)
    	{
    		goto ErrorExit;
    	}
    
    	psQueueInfo->psNextKM = psSysData->psQueueList;
    	psSysData->psQueueList = psQueueInfo;
    
    	eError = OSUnlockResource(&psSysData->sQProcessResource, KERNEL_ID);
    	if (eError != PVRSRV_OK)
    	{
    		goto ErrorExit;
    	}
    
    	*ppsQueueInfo = psQueueInfo;
    
    	return PVRSRV_OK;
    
    ErrorExit:
    
    	if(psQueueInfo)
    	{
    		if(psQueueInfo->pvLinQueueKM)
    		{
    			OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    						psQueueInfo->ui32QueueSize,
    						psQueueInfo->pvLinQueueKM,
    						psQueueInfo->hMemBlock[1]);
    			psQueueInfo->pvLinQueueKM = IMG_NULL;
    		}
    
    		OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    					sizeof(PVRSRV_QUEUE_INFO),
    					psQueueInfo,
    					psQueueInfo->hMemBlock[0]);
    		
    	}
    
    	return eError;
    }
    
    
    IMG_EXPORT
    PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyCommandQueueKM(PVRSRV_QUEUE_INFO *psQueueInfo)
    {
    	PVRSRV_QUEUE_INFO	*psQueue;
    	SYS_DATA			*psSysData;
    	PVRSRV_ERROR		eError;
    	IMG_BOOL			bTimeout = IMG_TRUE;
    
    	SysAcquireData(&psSysData);
    
    	psQueue = psSysData->psQueueList;
    
    	 
    	LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
    	{
    		if(psQueueInfo->ui32ReadOffset == psQueueInfo->ui32WriteOffset)
    		{
    			bTimeout = IMG_FALSE;
    			break;
    		}
    		OSWaitus(MAX_HW_TIME_US/WAIT_TRY_COUNT);
    	} END_LOOP_UNTIL_TIMEOUT();
    
    	if (bTimeout)
    	{
    		
    		PVR_DPF((PVR_DBG_ERROR,"PVRSRVDestroyCommandQueueKM : Failed to empty queue"));
    		eError = PVRSRV_ERROR_CANNOT_FLUSH_QUEUE;
    		goto ErrorExit;
    	}
    
    	
    	eError = OSLockResource(&psSysData->sQProcessResource,
    								KERNEL_ID);
    	if (eError != PVRSRV_OK)
    	{
    		goto ErrorExit;
    	}
    
    	if(psQueue == psQueueInfo)
    	{
    		psSysData->psQueueList = psQueueInfo->psNextKM;
    
    		OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    					NearestPower2(psQueueInfo->ui32QueueSize) + PVRSRV_MAX_CMD_SIZE,
    					psQueueInfo->pvLinQueueKM,
    					psQueueInfo->hMemBlock[1]);
    		psQueueInfo->pvLinQueueKM = IMG_NULL;
    		OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    					sizeof(PVRSRV_QUEUE_INFO),
    					psQueueInfo,
    					psQueueInfo->hMemBlock[0]);
    		 
    		psQueueInfo = IMG_NULL; 
    	}
    	else
    	{
    		while(psQueue)
    		{
    			if(psQueue->psNextKM == psQueueInfo)
    			{
    				psQueue->psNextKM = psQueueInfo->psNextKM;
    
    				OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    							psQueueInfo->ui32QueueSize,
    							psQueueInfo->pvLinQueueKM,
    							psQueueInfo->hMemBlock[1]);
    				psQueueInfo->pvLinQueueKM = IMG_NULL;
    				OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    							sizeof(PVRSRV_QUEUE_INFO),
    							psQueueInfo,
    							psQueueInfo->hMemBlock[0]);
    				 
    				psQueueInfo = IMG_NULL; 
    				break;
    			}
    			psQueue = psQueue->psNextKM;
    		}
    
    		if(!psQueue)
    		{
    			eError = OSUnlockResource(&psSysData->sQProcessResource, KERNEL_ID);
    			if (eError != PVRSRV_OK)
    			{
    				goto ErrorExit;
    			}
    			eError = PVRSRV_ERROR_INVALID_PARAMS;
    			goto ErrorExit;
    		}
    	}
    
    	
    	eError = OSUnlockResource(&psSysData->sQProcessResource, KERNEL_ID);
    	if (eError != PVRSRV_OK)
    	{
    		goto ErrorExit;
    	}
    
    	
    	if (psSysData->psQueueList == IMG_NULL)
    	{
    		eError = OSDestroyResource(&psSysData->sQProcessResource);
    		if (eError != PVRSRV_OK)
    		{
    			goto ErrorExit;
    		}
    	}
    
    ErrorExit:
    
    	return eError;
    }
    
    
    IMG_EXPORT
    PVRSRV_ERROR IMG_CALLCONV PVRSRVGetQueueSpaceKM(PVRSRV_QUEUE_INFO *psQueue,
    												IMG_SIZE_T ui32ParamSize,
    												IMG_VOID **ppvSpace)
    {
    	IMG_BOOL bTimeout = IMG_TRUE;
    
    	
    	ui32ParamSize =  (ui32ParamSize+3) & 0xFFFFFFFC;
    
    	if (ui32ParamSize > PVRSRV_MAX_CMD_SIZE)
    	{
    		PVR_DPF((PVR_DBG_WARNING,"PVRSRVGetQueueSpace: max command size is %d bytes", PVRSRV_MAX_CMD_SIZE));
    		return PVRSRV_ERROR_CMD_TOO_BIG;
    	}
    
    	 
    	LOOP_UNTIL_TIMEOUT(MAX_HW_TIME_US)
    	{
    		if (GET_SPACE_IN_CMDQ(psQueue) > ui32ParamSize)
    		{
    			bTimeout = IMG_FALSE;
    			break;
    		}
    		OSWaitus(MAX_HW_TIME_US/WAIT_TRY_COUNT);
    	} END_LOOP_UNTIL_TIMEOUT();
    
    	if (bTimeout == IMG_TRUE)
    	{
    		*ppvSpace = IMG_NULL;
    
    		return PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE;
    	}
    	else
    	{
    		*ppvSpace = (IMG_VOID *)((IMG_UINTPTR_T)psQueue->pvLinQueueUM + psQueue->ui32WriteOffset);
    	}
    
    	return PVRSRV_OK;
    }
    
    
    IMG_EXPORT
    PVRSRV_ERROR IMG_CALLCONV PVRSRVInsertCommandKM(PVRSRV_QUEUE_INFO	*psQueue,
    												PVRSRV_COMMAND		**ppsCommand,
    												IMG_UINT32			ui32DevIndex,
    												IMG_UINT16			CommandType,
    												IMG_UINT32			ui32DstSyncCount,
    												PVRSRV_KERNEL_SYNC_INFO	*apsDstSync[],
    												IMG_UINT32			ui32SrcSyncCount,
    												PVRSRV_KERNEL_SYNC_INFO	*apsSrcSync[],
    												IMG_SIZE_T			ui32DataByteSize )
    {
    	PVRSRV_ERROR 	eError;
    	PVRSRV_COMMAND	*psCommand;
    	IMG_SIZE_T		ui32CommandSize;
    	IMG_UINT32		i;
    
    	
    	ui32DataByteSize = (ui32DataByteSize + 3UL) & ~3UL;
    
    	
    	ui32CommandSize = sizeof(PVRSRV_COMMAND)
    					+ ((ui32DstSyncCount + ui32SrcSyncCount) * sizeof(PVRSRV_SYNC_OBJECT))
    					+ ui32DataByteSize;
    
    	
    	eError = PVRSRVGetQueueSpaceKM (psQueue, ui32CommandSize, (IMG_VOID**)&psCommand);
    	if(eError != PVRSRV_OK)
    	{
    		return eError;
    	}
    
    	psCommand->ui32ProcessID	= OSGetCurrentProcessIDKM();
    
    	
    	psCommand->ui32CmdSize		= ui32CommandSize; 
    	psCommand->ui32DevIndex 	= ui32DevIndex;
    	psCommand->CommandType 		= CommandType;
    	psCommand->ui32DstSyncCount	= ui32DstSyncCount;
    	psCommand->ui32SrcSyncCount	= ui32SrcSyncCount;
    	
    	
    	psCommand->psDstSync		= (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psCommand) + sizeof(PVRSRV_COMMAND));
    
    
    	psCommand->psSrcSync		= (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psCommand->psDstSync)
    								+ (ui32DstSyncCount * sizeof(PVRSRV_SYNC_OBJECT)));
    
    	psCommand->pvData			= (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psCommand->psSrcSync)
    								+ (ui32SrcSyncCount * sizeof(PVRSRV_SYNC_OBJECT)));
    	psCommand->ui32DataSize		= ui32DataByteSize;
    
    	
    	for (i=0; i<ui32DstSyncCount; i++)
    	{
    		psCommand->psDstSync[i].psKernelSyncInfoKM = apsDstSync[i];
    		psCommand->psDstSync[i].ui32WriteOpsPending = PVRSRVGetWriteOpsPending(apsDstSync[i], IMG_FALSE);
    		psCommand->psDstSync[i].ui32ReadOpsPending = PVRSRVGetReadOpsPending(apsDstSync[i], IMG_FALSE);
    
    // -------------
    		PVR_DPF((PVR_DBG_ERROR, "PVRSRVInsertCommandKM: Dst %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x", 
    				i, psCommand->psDstSync[i].psKernelSyncInfoKM->sReadOpsCompleteDevVAddr.uiAddr,
    				psCommand->psDstSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
    				psCommand->psDstSync[i].ui32ReadOpsPending,
    				psCommand->psDstSync[i].ui32WriteOpsPending));
    	}
    
    	
    	for (i=0; i<ui32SrcSyncCount; i++)
    	{
    		psCommand->psSrcSync[i].psKernelSyncInfoKM = apsSrcSync[i];
    		psCommand->psSrcSync[i].ui32WriteOpsPending = PVRSRVGetWriteOpsPending(apsSrcSync[i], IMG_TRUE);
    		psCommand->psSrcSync[i].ui32ReadOpsPending = PVRSRVGetReadOpsPending(apsSrcSync[i], IMG_TRUE);
    
    // -------------
    		PVR_DPF((PVR_DBG_ERROR, "PVRSRVInsertCommandKM: Src %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x", 
    				i, psCommand->psSrcSync[i].psKernelSyncInfoKM->sReadOpsCompleteDevVAddr.uiAddr,
    				psCommand->psSrcSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
    				psCommand->psSrcSync[i].ui32ReadOpsPending,
    				psCommand->psSrcSync[i].ui32WriteOpsPending));
    	}
    
    	
    	*ppsCommand = psCommand;
    
    	return PVRSRV_OK;
    }
    
    
    IMG_EXPORT
    PVRSRV_ERROR IMG_CALLCONV PVRSRVSubmitCommandKM(PVRSRV_QUEUE_INFO *psQueue,
    												PVRSRV_COMMAND *psCommand)
    {
    	
    	
    	
    	if (psCommand->ui32DstSyncCount > 0)
    	{
    		psCommand->psDstSync = (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psQueue->pvLinQueueKM)
    									+ psQueue->ui32WriteOffset + sizeof(PVRSRV_COMMAND));
    	}
    
    	if (psCommand->ui32SrcSyncCount > 0)
    	{
    		psCommand->psSrcSync = (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psQueue->pvLinQueueKM)
    									+ psQueue->ui32WriteOffset + sizeof(PVRSRV_COMMAND)
    									+ (psCommand->ui32DstSyncCount * sizeof(PVRSRV_SYNC_OBJECT)));
    	}
    
    	psCommand->pvData = (PVRSRV_SYNC_OBJECT*)(((IMG_UINTPTR_T)psQueue->pvLinQueueKM)
    									+ psQueue->ui32WriteOffset + sizeof(PVRSRV_COMMAND)
    									+ (psCommand->ui32DstSyncCount * sizeof(PVRSRV_SYNC_OBJECT))
    									+ (psCommand->ui32SrcSyncCount * sizeof(PVRSRV_SYNC_OBJECT)));
    
    	
    	UPDATE_QUEUE_WOFF(psQueue, psCommand->ui32CmdSize);
    
    	return PVRSRV_OK;
    }
    
    
    
    static
    PVRSRV_ERROR PVRSRVProcessCommand(SYS_DATA			*psSysData,
    								  PVRSRV_COMMAND	*psCommand,
    								  IMG_BOOL			bFlush)
    {
    	PVRSRV_SYNC_OBJECT		*psWalkerObj;
    	PVRSRV_SYNC_OBJECT		*psEndObj;
    	IMG_UINT32				i;
    	COMMAND_COMPLETE_DATA	*psCmdCompleteData;
    	PVRSRV_ERROR			eError = PVRSRV_OK;
    	IMG_UINT32				ui32WriteOpsComplete;
    	IMG_UINT32				ui32ReadOpsComplete;
    	DEVICE_COMMAND_DATA		*psDeviceCommandData;
    	IMG_UINT32				ui32CCBOffset;
    
    	
    	psWalkerObj = psCommand->psDstSync;
    	psEndObj = psWalkerObj + psCommand->ui32DstSyncCount;
    	while (psWalkerObj < psEndObj)
    	{
    		PVRSRV_SYNC_DATA *psSyncData = psWalkerObj->psKernelSyncInfoKM->psSyncData;
    
    		ui32WriteOpsComplete = psSyncData->ui32WriteOpsComplete;
    		ui32ReadOpsComplete = psSyncData->ui32ReadOpsComplete;
    		
    		if ((ui32WriteOpsComplete != psWalkerObj->ui32WriteOpsPending)
    		||	(ui32ReadOpsComplete != psWalkerObj->ui32ReadOpsPending))
    		{
    			if (!bFlush ||
    				!SYNCOPS_STALE(ui32WriteOpsComplete, psWalkerObj->ui32WriteOpsPending) ||
    				!SYNCOPS_STALE(ui32ReadOpsComplete, psWalkerObj->ui32ReadOpsPending))
    			{
    				return PVRSRV_ERROR_FAILED_DEPENDENCIES;
    			}
    		}
    
    		psWalkerObj++;
    	}
    
    	
    	psWalkerObj = psCommand->psSrcSync;
    	psEndObj = psWalkerObj + psCommand->ui32SrcSyncCount;
    	while (psWalkerObj < psEndObj)
    	{
    		PVRSRV_SYNC_DATA *psSyncData = psWalkerObj->psKernelSyncInfoKM->psSyncData;
    
    		ui32ReadOpsComplete = psSyncData->ui32ReadOpsComplete;
    		ui32WriteOpsComplete = psSyncData->ui32WriteOpsComplete;
    		
    		if ((ui32WriteOpsComplete != psWalkerObj->ui32WriteOpsPending)
    		|| (ui32ReadOpsComplete != psWalkerObj->ui32ReadOpsPending))
    		{
    			if (!bFlush &&
    				SYNCOPS_STALE(ui32WriteOpsComplete, psWalkerObj->ui32WriteOpsPending) &&
    				SYNCOPS_STALE(ui32ReadOpsComplete, psWalkerObj->ui32ReadOpsPending))
    			{
    				PVR_DPF((PVR_DBG_WARNING,
    						"PVRSRVProcessCommand: Stale syncops psSyncData:0x%x ui32WriteOpsComplete:0x%x ui32WriteOpsPending:0x%x",
    						(IMG_UINTPTR_T)psSyncData, ui32WriteOpsComplete, psWalkerObj->ui32WriteOpsPending));
    			}
    
    			if (!bFlush ||
    				!SYNCOPS_STALE(ui32WriteOpsComplete, psWalkerObj->ui32WriteOpsPending) ||
    				!SYNCOPS_STALE(ui32ReadOpsComplete, psWalkerObj->ui32ReadOpsPending))
    			{
    				return PVRSRV_ERROR_FAILED_DEPENDENCIES;
    			}
    		}
    		psWalkerObj++;
    	}
    
    	
    	if (psCommand->ui32DevIndex >= SYS_DEVICE_COUNT)
    	{
    		PVR_DPF((PVR_DBG_ERROR,
    					"PVRSRVProcessCommand: invalid DeviceType 0x%x",
    					psCommand->ui32DevIndex));
    		return PVRSRV_ERROR_INVALID_PARAMS;
    	}
    
    	
    	psDeviceCommandData = psSysData->apsDeviceCommandData[psCommand->ui32DevIndex];
    	ui32CCBOffset = psDeviceCommandData[psCommand->CommandType].ui32CCBOffset;
    	psCmdCompleteData = psDeviceCommandData[psCommand->CommandType].apsCmdCompleteData[ui32CCBOffset];
    	if (psCmdCompleteData->bInUse)
    	{
    		
    		return PVRSRV_ERROR_FAILED_DEPENDENCIES;
    	}
    
    	
    	psCmdCompleteData->bInUse = IMG_TRUE;
    
    	
    	psCmdCompleteData->ui32DstSyncCount = psCommand->ui32DstSyncCount;
    	for (i=0; i<psCommand->ui32DstSyncCount; i++)
    	{
    		psCmdCompleteData->psDstSync[i] = psCommand->psDstSync[i];
    // -------------
    		PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVProcessCommand: Dst %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x (CCB:%u)",
    				i, psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->sReadOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psDstSync[i].ui32ReadOpsPending,
    				psCmdCompleteData->psDstSync[i].ui32WriteOpsPending,
    				ui32CCBOffset));
    	}
    
    
    	
    	psCmdCompleteData->ui32SrcSyncCount = psCommand->ui32SrcSyncCount;
    	for (i=0; i<psCommand->ui32SrcSyncCount; i++)
    	{
    		psCmdCompleteData->psSrcSync[i] = psCommand->psSrcSync[i];
    // -------------
    		PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVProcessCommand: Src %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x (CCB:%u)",
    				i, psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->sReadOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psSrcSync[i].ui32ReadOpsPending,
    				psCmdCompleteData->psSrcSync[i].ui32WriteOpsPending,
    				ui32CCBOffset));
    	}
    
    	
    
    
    
    
    
    
    
    
    
    	if (psDeviceCommandData[psCommand->CommandType].pfnCmdProc((IMG_HANDLE)psCmdCompleteData,
    															   psCommand->ui32DataSize,
    															   psCommand->pvData) == IMG_FALSE)
    	{
    		
    
    
    		psCmdCompleteData->bInUse = IMG_FALSE;
    		eError = PVRSRV_ERROR_CMD_NOT_PROCESSED;
    	}
    	
    	
    	psDeviceCommandData[psCommand->CommandType].ui32CCBOffset = (ui32CCBOffset + 1) % DC_NUM_COMMANDS_PER_TYPE;
    
    	return eError;
    }
    
    
    static IMG_VOID PVRSRVProcessQueues_ForEachCb(PVRSRV_DEVICE_NODE *psDeviceNode)
    {
    	if (psDeviceNode->bReProcessDeviceCommandComplete &&
    		psDeviceNode->pfnDeviceCommandComplete != IMG_NULL)
    	{
    		(*psDeviceNode->pfnDeviceCommandComplete)(psDeviceNode);
    	}
    }
    
    IMG_EXPORT
    PVRSRV_ERROR PVRSRVProcessQueues(IMG_UINT32	ui32CallerID,
    								 IMG_BOOL	bFlush)
    {
    	PVRSRV_QUEUE_INFO 	*psQueue;
    	SYS_DATA			*psSysData;
    	PVRSRV_COMMAND 		*psCommand;
    	PVRSRV_ERROR		eError;
    
    	SysAcquireData(&psSysData);
    
    	
    	psSysData->bReProcessQueues = IMG_FALSE;
    
    	
    	eError = OSLockResource(&psSysData->sQProcessResource,
    							ui32CallerID);
    	if(eError != PVRSRV_OK)
    	{
    		
    		psSysData->bReProcessQueues = IMG_TRUE;
    
    		
    		if(ui32CallerID == ISR_ID)
    		{
    			if (bFlush)
    			{
    				PVR_DPF((PVR_DBG_ERROR,"PVRSRVProcessQueues: Couldn't acquire queue processing lock for FLUSH"));
    			}
    			else
    			{
    				PVR_DPF((PVR_DBG_MESSAGE,"PVRSRVProcessQueues: Couldn't acquire queue processing lock"));
    			}
    		}
    		else
    		{
    			PVR_DPF((PVR_DBG_MESSAGE,"PVRSRVProcessQueues: Queue processing lock-acquire failed when called from the Services driver."));
    			PVR_DPF((PVR_DBG_MESSAGE,"                     This is due to MISR queue processing being interrupted by the Services driver."));
    		}
    
    		return PVRSRV_OK;
    	}
    
    	psQueue = psSysData->psQueueList;
    
    	if(!psQueue)
    	{
    		PVR_DPF((PVR_DBG_MESSAGE,"No Queues installed - cannot process commands"));
    	}
    
    	if (bFlush)
    	{
    		PVRSRVSetDCState(DC_STATE_FLUSH_COMMANDS);
    	}
    
    	while (psQueue)
    	{
    		while (psQueue->ui32ReadOffset != psQueue->ui32WriteOffset)
    		{
    			psCommand = (PVRSRV_COMMAND*)((IMG_UINTPTR_T)psQueue->pvLinQueueKM + psQueue->ui32ReadOffset);
    
    			if (PVRSRVProcessCommand(psSysData, psCommand, bFlush) == PVRSRV_OK)
    			{
    				
    				UPDATE_QUEUE_ROFF(psQueue, psCommand->ui32CmdSize)
    
    				continue;
    			} else {
    				//----
    				PVR_DPF((PVR_DBG_ERROR, "Failed processing command"));
    			}
    
    			break;
    		}
    		psQueue = psQueue->psNextKM;
    	}
    
    	if (bFlush)
    	{
    		PVRSRVSetDCState(DC_STATE_NO_FLUSH_COMMANDS);
    	}
    
    	
    	List_PVRSRV_DEVICE_NODE_ForEach(psSysData->psDeviceNodeList,
    									&PVRSRVProcessQueues_ForEachCb);
    
    
    	
    	OSUnlockResource(&psSysData->sQProcessResource, ui32CallerID);
    
    	
    	if(psSysData->bReProcessQueues)
    	{
    		return PVRSRV_ERROR_PROCESSING_BLOCKED;
    	}
    
    	return PVRSRV_OK;
    }
    
    #if defined(SUPPORT_CUSTOM_SWAP_OPERATIONS)
    IMG_INTERNAL
    IMG_VOID PVRSRVFreeCommandCompletePacketKM(IMG_HANDLE	hCmdCookie,
    										   IMG_BOOL		bScheduleMISR)
    {
    	COMMAND_COMPLETE_DATA	*psCmdCompleteData = (COMMAND_COMPLETE_DATA *)hCmdCookie;
    	SYS_DATA				*psSysData;
    
    	SysAcquireData(&psSysData);
    
    	
    	psCmdCompleteData->bInUse = IMG_FALSE;
    
    	
    	PVRSRVScheduleDeviceCallbacks();
    
    	if(bScheduleMISR)
    	{
    		OSScheduleMISR(psSysData);
    	}
    }
    
    #endif 
    
    
    IMG_EXPORT
    IMG_VOID PVRSRVCommandCompleteKM(IMG_HANDLE	hCmdCookie,
    								 IMG_BOOL	bScheduleMISR)
    {
    	IMG_UINT32				i;
    	COMMAND_COMPLETE_DATA	*psCmdCompleteData = (COMMAND_COMPLETE_DATA *)hCmdCookie;
    	SYS_DATA				*psSysData;
    
    	SysAcquireData(&psSysData);
    
    	
    	for (i=0; i<psCmdCompleteData->ui32DstSyncCount; i++)
    	{
    		psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->psSyncData->ui32WriteOpsComplete++;
    
    // -------------
    		PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVCommandCompleteKM: Dst %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x",
    				i, psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->sReadOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psDstSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psDstSync[i].ui32ReadOpsPending,
    				psCmdCompleteData->psDstSync[i].ui32WriteOpsPending));
    	}
    
    	
    	for (i=0; i<psCmdCompleteData->ui32SrcSyncCount; i++)
    	{
    		psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->psSyncData->ui32ReadOpsComplete++;
    
    // -------------
    		PVR_DPF((PVR_DBG_MESSAGE, "PVRSRVCommandCompleteKM: Src %u RO-VA:0x%x WO-VA:0x%x ROP:0x%x WOP:0x%x",
    				i, psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->sReadOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psSrcSync[i].psKernelSyncInfoKM->sWriteOpsCompleteDevVAddr.uiAddr,
    				psCmdCompleteData->psSrcSync[i].ui32ReadOpsPending,
    				psCmdCompleteData->psSrcSync[i].ui32WriteOpsPending));
    	}
    
    	
    	psCmdCompleteData->bInUse = IMG_FALSE;
    
    	
    	PVRSRVScheduleDeviceCallbacks();
    
    	if(bScheduleMISR)
    	{
    		OSScheduleMISR(psSysData);
    	}
    }
    
    
    
    
    IMG_EXPORT
    PVRSRV_ERROR PVRSRVRegisterCmdProcListKM(IMG_UINT32		ui32DevIndex,
    										 PFN_CMD_PROC	*ppfnCmdProcList,
    										 IMG_UINT32		ui32MaxSyncsPerCmd[][2],
    										 IMG_UINT32		ui32CmdCount)
    {
    	SYS_DATA				*psSysData;
    	PVRSRV_ERROR			eError;
    	IMG_UINT32				ui32CmdCounter, ui32CmdTypeCounter;
    	IMG_SIZE_T				ui32AllocSize;
    	DEVICE_COMMAND_DATA		*psDeviceCommandData;
    	COMMAND_COMPLETE_DATA	*psCmdCompleteData;
    
    	
    	if(ui32DevIndex >= SYS_DEVICE_COUNT)
    	{
    		PVR_DPF((PVR_DBG_ERROR,
    					"PVRSRVRegisterCmdProcListKM: invalid DeviceType 0x%x",
    					ui32DevIndex));
    		return PVRSRV_ERROR_INVALID_PARAMS;
    	}
    
    	
    	SysAcquireData(&psSysData);
    
    	
    	ui32AllocSize = ui32CmdCount * sizeof(*psDeviceCommandData);
    	eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    						ui32AllocSize,
    						(IMG_VOID **)&psDeviceCommandData, IMG_NULL,
    						"Array of Pointers for Command Store");
    	if (eError != PVRSRV_OK)
    	{
    		PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterCmdProcListKM: Failed to alloc CC data"));
    		goto ErrorExit;
    	}
    
    	psSysData->apsDeviceCommandData[ui32DevIndex] = psDeviceCommandData;
    
    	for (ui32CmdTypeCounter = 0; ui32CmdTypeCounter < ui32CmdCount; ui32CmdTypeCounter++)
    	{
    		psDeviceCommandData[ui32CmdTypeCounter].pfnCmdProc = ppfnCmdProcList[ui32CmdTypeCounter];
    		psDeviceCommandData[ui32CmdTypeCounter].ui32CCBOffset = 0;
    		
    		for (ui32CmdCounter = 0; ui32CmdCounter < DC_NUM_COMMANDS_PER_TYPE; ui32CmdCounter++)
    		{
    			
    
    			ui32AllocSize = sizeof(COMMAND_COMPLETE_DATA) 
    						  + ((ui32MaxSyncsPerCmd[ui32CmdTypeCounter][0]
    						  +	ui32MaxSyncsPerCmd[ui32CmdTypeCounter][1])
    						  * sizeof(PVRSRV_SYNC_OBJECT));	 
    
    			eError = OSAllocMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
    								ui32AllocSize,
    								(IMG_VOID **)&psCmdCompleteData,
    								IMG_NULL,
    								"Command Complete Data");
    			if (eError != PVRSRV_OK)
    			{
    				PVR_DPF((PVR_DBG_ERROR,"PVRSRVRegisterCmdProcListKM: Failed to alloc cmd %d", ui32CmdTypeCounter));
    				goto ErrorExit;
    			}
    			
    			psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter] = psCmdCompleteData;
    			
    			
    			OSMemSet(psCmdCompleteData, 0x00, ui32AllocSize);
    
    			
    			psCmdCompleteData->psDstSync = (PVRSRV_SYNC_OBJECT*)
    											(((IMG_UINTPTR_T)psCmdCompleteData)
    											+ sizeof(COMMAND_COMPLETE_DATA));
    			psCmdCompleteData->psSrcSync = (PVRSRV_SYNC_OBJECT*)
    											(((IMG_UINTPTR_T)psCmdCompleteData->psDstSync)
    											+ (sizeof(PVRSRV_SYNC_OBJECT) * ui32MaxSyncsPerCmd[ui32CmdTypeCounter][0]));
    
    			psCmdCompleteData->ui32AllocSize = ui32AllocSize;
    		}
    	}
    
    	return PVRSRV_OK;
    
    ErrorExit:
    
    	
    
     	if (PVRSRVRemoveCmdProcListKM(ui32DevIndex, ui32CmdCount) != PVRSRV_OK)
      	{
     		PVR_DPF((PVR_DBG_ERROR,
     				"PVRSRVRegisterCmdProcListKM: Failed to clean up after error, device 0x%x",
     				ui32DevIndex));
      	}
    
    	return eError;
    }
    
    
    IMG_EXPORT
    PVRSRV_ERROR PVRSRVRemoveCmdProcListKM(IMG_UINT32 ui32DevIndex,
    									   IMG_UINT32 ui32CmdCount)
    {
    	SYS_DATA				*psSysData;
    	IMG_UINT32				ui32CmdTypeCounter, ui32CmdCounter;
    	DEVICE_COMMAND_DATA		*psDeviceCommandData;
    	COMMAND_COMPLETE_DATA	*psCmdCompleteData;
    	IMG_SIZE_T				ui32AllocSize;
    
    	
    	if(ui32DevIndex >= SYS_DEVICE_COUNT)
    	{
    		PVR_DPF((PVR_DBG_ERROR,
    				"PVRSRVRemoveCmdProcListKM: invalid DeviceType 0x%x",
    				ui32DevIndex));
    		return PVRSRV_ERROR_INVALID_PARAMS;
    	}
    
    	
    	SysAcquireData(&psSysData);
    
    	psDeviceCommandData = psSysData->apsDeviceCommandData[ui32DevIndex];
    	if(psDeviceCommandData != IMG_NULL)
    	{
    		for (ui32CmdTypeCounter = 0; ui32CmdTypeCounter < ui32CmdCount; ui32CmdTypeCounter++)
    		{
    			for (ui32CmdCounter = 0; ui32CmdCounter < DC_NUM_COMMANDS_PER_TYPE; ui32CmdCounter++)
    			{
    				psCmdCompleteData = psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter];
    				
    				
    				if (psCmdCompleteData != IMG_NULL)
    				{
    					OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, psCmdCompleteData->ui32AllocSize,
    							  psCmdCompleteData, IMG_NULL);
    					psDeviceCommandData[ui32CmdTypeCounter].apsCmdCompleteData[ui32CmdCounter] = IMG_NULL;
    				}
    			}
    		}
    
    		
    		ui32AllocSize = ui32CmdCount * sizeof(*psDeviceCommandData);
    		OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP, ui32AllocSize, psDeviceCommandData, IMG_NULL);
    		psSysData->apsDeviceCommandData[ui32DevIndex] = IMG_NULL;
    	}
    
    	return PVRSRV_OK;
    }
    
    

    BR

    Tsvetolin Shulev

  • Hi Cvetolin,

    I have changed the file  as you recommend, but not different messages appear.
    The following appeared after some 33 cycle when I starting the Qt application and after some seconds I kill.
    The problem below appeared in the application startup.

    [ 310.489837] PVR_K: HWRecoveryResetSGX: SGX Hardware Recovery triggered
    [ 310.496643] PVR_K: SGX debug (1.6.16.3977)
    [ 310.500915] PVR_K: (P0) EUR_CR_EVENT_STATUS: 20000000
    [ 310.506530] PVR_K: (P0) EUR_CR_EVENT_STATUS2: 00000000
    [ 310.512145] PVR_K: (P0) EUR_CR_BIF_CTRL: 00000000
    [ 310.517761] PVR_K: (P0) EUR_CR_BIF_INT_STAT: 00004004
    [ 310.523376] PVR_K: (P0) EUR_CR_BIF_FAULT: 0E40A000
    [ 310.529724] PVR_K: (P0) EUR_CR_BIF_MEM_REQ_STAT: 00000000
    [ 310.535339] PVR_K: (P0) EUR_CR_CLKGATECTL: 00222220
    [ 310.540954] PVR_K: (P0) EUR_CR_PDS_PC_BASE: 00203360
    [ 310.546569] PVR_K: Flip Command Complete Data 0 for display device 1:
    [ 310.553253] PVR_K: SRC 0: (Not in use)
    [ 310.557250] PVR_K: SRC 1: (Not in use)
    [ 310.561218] PVR_K: SGX Host control:
    [ 310.564941] PVR_K: (HC-0) 0x00000001 0x00000000 0x00000000 0x00000001
    [ 310.571716] PVR_K: (HC-10) 0x00000000 0x00000001 0x0000000A 0x00030D40
    [ 310.578613] PVR_K: (HC-20) 0x00000002 0x00000000 0x00000001 0x00000000
    [ 310.585479] PVR_K: (HC-30) 0x00000013 0x00000363 0x00A2B5D4 0x00000000
    [ 310.592346] PVR_K: SGX TA/3D control:
    [ 310.596160] PVR_K: (T3C-0) 0x0F003000 0x0F003120 0x0F002000 0x00000000
    [ 310.603027] PVR_K: (T3C-10) 0x00000000 0x00000001 0x00000002 0x00000001
    [ 310.609985] PVR_K: (T3C-20) 0x0F007F40 0x00000000 0x00000000 0x00000000
    [ 310.616973] PVR_K: (T3C-30) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 310.624694] PVR_K: (T3C-40) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 310.631652] PVR_K: (T3C-50) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 310.638641] PVR_K: (T3C-60) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 310.645568] PVR_K: (T3C-70) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 310.652557] PVR_K: (T3C-80) 0x00000000 0x00000000 0x00000000 0x0F000000
    [ 310.659515] PVR_K: (T3C-90) 0x9B97F000 0x0F089000 0x00000000 0x0F0883A0
    [ 310.666473] PVR_K: (T3C-A0) 0x0F007F40 0x00000000 0x0F088200 0x00000000
    [ 310.673461] PVR_K: (T3C-B0) 0x00000000 0x00000003 0x00000002 0x00000000
    [ 310.680419] PVR_K: (T3C-C0) 0x00000004 0x693B7671 0x00000000 0x00000000
    [ 310.687377] PVR_K: (T3C-D0) 0x00000000 0x00000000 0x00000000 0x00000000
    [ 310.694366] PVR_K: (T3C-E0) 0x00000001 0x00000001 0x0F000000 0x80008000
    [ 310.701324] PVR_K: (T3C-F0) 0x80048000 0x0F004000 0x0F007C20 0x0F002020
    [ 310.708282] PVR_K: (T3C-100) 0x00000000 0x00000000 0x00000000 0x00000000

    Bye,
    Raffaele Recalcati

  • Hi,

    I rebuilt the kernel module in debug mode, and a lot of additional info are present.

    In the attached file you can see the log at module initialization (6 secs) and when the application starts (18 secs).

    In the next post I'm attaching an assert visible sometimes after application start-up. It doesn't always appear, like the  SGX dump of previous posts, so I suppose it could be the same problem, catched by an assert this time.

  • I'm attaching the kernel oops we're getting soon after the application is started. Something wrong is happening in services4/srvkm/devices/sgx/mmu.c.

    From the log you can see the "Failed processing command" messages that are printed each time the application starts, and after 5 seconds, the kernel bug report.

  • Hi Stefano,

    After analyzing the last logs I see that the graphics continue to sends compositions to the DSS after switching off the display. This provokes errors and crush. The problem is not known and I could not suggest you a turnkey solution. For further investigation of the issue is necessary to have the hardware but this is out of the scope of E2E forum.

    BR

    Tsvetolin Shulev