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.

SK-AM68: Disabling APM events

Part Number: SK-AM68

Tool/software:

Hi,

I am trying to disable APM events on the on-board GPU since it is having a noticeable effect on our program but I am unable to do so correctly.

So far I have tried disabling the following kernel configurations:

CONFIG_ENERGY_MODEL=n
CONFIG_SUSPEND=n
CONFIG_WQ_POWER_EFFICIENT_DEFAULT=n
# CONFIG_PM=n # Causes kernel panic
CONFIG_PM_SLEEP=n
CONFIG_HIBERNATION=n
CONFIG_CPU_PM=n
CONFIG_CPU_IDLE=n

CONFIG_ARCH_SUSPEND_POSSIBLE=n
CONFIG_PM_CLK=n # Doesn't work without CONFIG_PM=n
CONFIG_PM_GENERIC_DOMAINS=n
CONFIG_PM_GENERIC_DOMAINS_OF=n
CONFIG_CPU_FREQ_GOV_POWERSAVE=n
CONFIG_CPU_FREQ_GOV_CONSERVATIVE=n

CONFIG_ARCH_HIBERNATION_POSSIBLE=n
CONFIG_ARCH_SUSPEND_POSSIBLE=n

CONFIG_ACPI=n

And I am unable to find any config options relating to APM which I find unusual since it is enabled and running on the board.

Here is my PVR dump in case it is of any use:

root@am68-sk:~# dmesg | grep -i pvr
[    6.819663] pvrsrvkm: loading out-of-tree module taints kernel.
[    6.841654] PVR_K:  183: Device: 4e20000000.gpu
[    6.895646] PVR_K:  183: Read BVNC 36.53.104.796 from HW device registers
[    6.932829] PVR_K:  183: RGX Device registered BVNC 36.53.104.796 with 1 core in the system
[    6.996556] [drm] Initialized pvr 24.2.6643903 20170530 for 4e20000000.gpu on minor 1
[   21.663153] PVR_K:  331: RGX Firmware image 'rgx.fw.36.53.104.796' loaded
[   21.675470] PVR_K:  331: Shader binary image 'rgx.sh.36.53.104.796' loaded
[   58.912050] PVR_K:  388: User requested PVR debug info
[   58.918064] PVR_K:  388: ------------[ PVR DBG: START (High) ]------------
[   58.924962] PVR_K:  388: OS kernel info: Linux 6.6.58-ti-01497-ga7758da17c28-dirty #1 SMP PREEMPT Wed Nov 27 13:23:15 UTC 2024 aarch64
[   58.937093] PVR_K:  388: DDK info: Rogue_DDK_Linux_WS rogueddk 24.2@6643903 (release) j721s2_linux
[   58.946520] PVR_K:  388: Time now: 58946516us
[   58.950885] PVR_K:  388: Services State: OK
[   58.955066] PVR_K:  388: Server Errors: 0
[   58.959079] PVR_K:  388: Connections Device ID:0(128) P331-V331-T331-weston, P388-V388-T388-pvrdebug
[   58.968199] PVR_K:  388: ------[ Driver Info ]------
[   58.973156] PVR_K:  388: Comparison of UM/KM components: MATCHING
[   58.979253] PVR_K:  388: KM Arch: 64 Bit
[   58.983176] PVR_K:  388: Driver Mode: Native
[   58.987447] PVR_K:  388: UM Connected Clients: 64 Bit
[   58.992490] PVR_K:  388: UM info: 24.2 @  6643903 (release) build options: 0x80020810
[   59.000308] PVR_K:  388: KM info: 24.2 @  6643903 (release) build options: 0x00020810
[   59.008122] PVR_K:  388: Window system: lws-generic
[   59.012996] PVR_K:  388: Power lock status: Free
[   59.017609] PVR_K:  388: ------[ Server Thread Summary ]------
[   59.023439] PVR_K:  388:   pvr_defer_free : Running
[   59.028313] PVR_K:  388:     Number of deferred cleanup items: QUEUED: 00000  CONNECTION : 00000 MMU : 00000 OSMEM : 00000 PMR : 00000
[   59.040378] PVR_K:  388:     Number of deferred cleanup items dropped after retry limit reached : 0
[   59.049408] PVR_K:  388:   pvr_device_wdg : Running
[   59.054278] PVR_K:  388: Active Threads (UM/KM): 1 / 2
[   59.059410] PVR_K:  388: Suspended Threads: 0
[   59.063763] PVR_K:  388: ------[ RGX Device ID:0 Start ]------
[   59.069624] PVR_K:  388: ------[ RGX Info ]------
[   59.074331] PVR_K:  388: Device Node (Info): 00000000e0c6ba78 (000000001f8b300c)
[   59.081733] PVR_K:  388:     DevmemHistoryRecordStats - None
[   59.087383] PVR_K:  388: RGX BVNC: 36.53.104.796 (rogue)
[   59.092688] PVR_K:  388: RGX Device State: ACTIVE
[   59.097384] PVR_K:  388: RGX Power State: OFF
[   59.101734] PVR_K:  388: RGX Health Status: OK, Reason: NONE
[   59.107383] PVR_K:  388: FW info: 24.2 @  6643903 (release) build options: 0x80020810
[   59.115201] PVR_K:  388: TRP: HW support - Yes; SW disabled
[   59.120767] PVR_K:  388: WGP: HW support - Yes; SW disabled
[   59.126333] PVR_K:  388: RGX HWR State 0x00000001: HWR OK;
[   59.131812] PVR_K:  388: RGX FW Power State: RGXFWIF_POW_OFF (APM enabled: 3 ok, 0 denied, 0 non-idle, 2 retry, 0 other, 5 total. Latency: 100 ms)
[   59.144918] PVR_K:  388: RGX DVFS: 0 frequency changes. Current frequency: 799.998 MHz (sampled at 23352097475 ns). FW frequency: 800.000 MHz.
[   59.157688] PVR_K:  388: RGX FW OS 0 - State: active; Freelists: Ok; Priority: 0; Isolation group: 0;  Time Slice*: 0% (0ms); MTS off;
[   59.169756] PVR_K:  388: RGX Kernel CCB WO:0x37 RO:0x37
[   59.174976] PVR_K:  388: RGX Firmware CCB WO:0x0 RO:0x0
[   59.180192] PVR_K:  388: RGX Kernel CCB commands executed = 55
[   59.186016] PVR_K:  388: RGX SLR: Forced UFO updates requested = 0
[   59.192190] PVR_K:  388: RGX Errors: WGP:0, TRP:0
[   59.196889] PVR_K:  388: Thread0: FW IRQ count = 92
[   59.201758] PVR_K:  388: Last sampled IRQ count in LISR = 92
[   59.207411] PVR_K:  388: FW System config flags = 0x00020000 (Ctx switch options: Medium CSW profile;)
[   59.216703] PVR_K:  388: FW OS config flags = 0x0000000F (Ctx switch: TDM; GEOM; 3D; CDM;)
[   59.224955] PVR_K:  388:  (!) RGX power is down. No registers dumped
[   59.231297] PVR_K:  388: ------[ RGX FW Trace Info ]------
[   59.236773] PVR_K:  388: Debug log type: none
[   59.241120] PVR_K:  388: RGX FW thread 0: Trace buffer not yet allocated
[   59.247808] PVR_K:  388: ------[ Full CCB Status ]------
[   59.253115] PVR_K:  388: FWCtx 0x00045840 (TQ_3D-P331-T331-weston)
[   59.259284] PVR_K:  388:   `--<Empty>
[   59.262941] PVR_K:  388: FWCtx 0x00045040 (TA-P331-T331-weston)
[   59.268851] PVR_K:  388:   `--<Empty>
[   59.272508] PVR_K:  388: FWCtx 0x00045118 (3D-P331-T331-weston)
[   59.278416] PVR_K:  388:   `--<Empty>
[   59.282073] PVR_K:  388: ------[ RGX Device ID:0 End ]------
[   59.287723] PVR_K:  388: ------[ Device ID: 128 - Phys Heaps ]------
[   59.294078] PVR_K:  388: 0x000000007d12541c -> PdMs: SYSMEM, Type: UMA, default, Usage Flags: 0x00000004 (GPU_LOCAL), Refs: 11, Free Size: 16264806400B, Total Size: 16576684032B, Spas Region: 0000000000000000
[   59.312555] PVR_K:  388: PMR Zombie Count: 0, PMR Zombie Count In Cleanup: 0
[   59.319592] PVR_K:  388: PMR Live Count: 84
[   59.323770] PVR_K:  388: ------[ System Summary Device ID:0 ]------
[   59.330033] PVR_K:  388: Device System Power State: OFF
[   59.335251] PVR_K:  388: MaxHWTOut: 500000us, WtTryCt: 10000, WDGTOut(on,off): (10000ms,3600000ms)
[   59.344196] PVR_K:  388: ------[ AppHint Settings ]------
[   59.349586] PVR_K:  388:   Build Vars
[   59.353243] PVR_K:  388:     EnableTrustedDeviceAceConfig: N
[   59.358892] PVR_K:  388:     CleanupThreadPriority: 0x00000005
[   59.364715] PVR_K:  388:     WatchdogThreadPriority: 0x00000000
[   59.370622] PVR_K:  388:     HWPerfClientBufferSize: 0x000c0000
[   59.376530] PVR_K:  388:     DevmemHistoryBufSizeLog2: 0x0000000b
[   59.382611] PVR_K:  388:     DevmemHistoryMaxEntries: 0x00002710
[   59.388608] PVR_K:  388:   Module Params
[   59.392533] PVR_K:  388:     none
[   59.395841] PVR_K:  388:   Debug Info Params
[   59.400103] PVR_K:  388:     none
[   59.403404] PVR_K:  388:   Debug Info Params Device ID: 0
[   59.408796] PVR_K:  388:     none
[   59.412105] PVR_K:  388: ------[ Active Sync Checkpoints ]------
[   59.418106] PVR_K:  388: (SyncCP Counts: InUse:6 Max:9)
[   59.423315] PVR_K:  388: (SyncCP Mirrored Counts: InUse:0 Max:0)
[   59.429316] PVR_K:  388: sw: RM_SWTimeline-weston-331 @0 cur=0
[   59.435145] PVR_K:  388: ------[ Native Fence Sync: timelines ]------
[   59.441579] PVR_K:  388: foreign_sync: @0 ctx=1 refs=1
[   59.446712] PVR_K:  388: rogue-ta3d: @43 ctx=5 refs=3
[   59.451750] PVR_K:  388:  @41: (++) refs=1 fwaddr=0x100423e9 enqueue=1 status=Signalled 41-update fence
[   59.461119] PVR_K:  388:  @42: (++) refs=1 fwaddr=0x10042019 enqueue=1 status=Signalled 42-update fence
[   59.470502] PVR_K:  388: V3-weston-331: @43 ctx=6 refs=3
[   59.475799] PVR_K:  388:  @41: (++) refs=1 fwaddr=0x100423f1 enqueue=1 status=Signalled 41-es3_DoKickTA_43
[   59.485429] PVR_K:  388:  @42: (++) refs=3 fwaddr=0x10042001 enqueue=1 status=Signalled 42-es3_DoKickTA_44
[   59.495069] PVR_K:  388: P3-weston-331: @43 ctx=7 refs=3
[   59.500366] PVR_K:  388:  @41: (++) refs=1 fwaddr=0x100423f9 enqueue=1 status=Signalled 41-es3_DoKick3D_43
[   59.509995] PVR_K:  388:  @42: (++) refs=3 fwaddr=0x10042009 enqueue=1 status=Signalled 42-es3_DoKick3D_44
[   59.519633] PVR_K:  388: rogue-tq3d: @0 ctx=10 refs=1
[   59.524679] PVR_K:  388: QE-weston-331: @2 ctx=11 refs=1
[   59.529983] PVR_K:  388: ------------[ PVR DBG: END ]------------

 


I am using the ti-linux-staging 6.6 kernel.

I have also tried the recommended method from this TI document for disabling APM but it had no effect.

Please let me know the correct method for disabling APM.

  • Hello,

    I take it you are using the 9.01 SDK. Have you made any modifications to the root file system or patches to the kernel? Is this on the EVM or custom board?

    Regards,
    Sarabesh S.

  • I am using yocto (scarthgap) for creating the distro - I posted here since the drivers are from TI.

    The only changes I have made to the kernel are those configs in the fragment from my first post and also a few more:

    CONFIG_SPI_OMAP24XX=y
    CONFIG_SPI_SLAVE=y
    CONFIG_SPI_SPIDEV=y

    And yes this is the EVM I am using

  • Hi Matt,

    Thanks for the information, I will get back to you in the next couple days on this. Thanks for your patience.

    Regards,
    Sarabesh S.

  • Hello, 

    Apologies for the delay. I see that disabling APM can be found in the SDK documentation here: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j721s2/11_00_00_08/exports/docs/linux/Foundational_Components/Graphics/Rogue/Rogue_Power_Management_Info.html#apm

    Please try " ...setting the power control to “on” through the devices /sys/devices/path-to-device/power/control interface. Subsequently, it’s status can be checked by reading that device file."

    Thank you,
    Sarabesh S.

  • Hi Sarabesh,

    Thanks for your reply however I had mentioned in my post that this is something I had tried (The section of the documentation that I linked, 3.6.8, mentions the same method as the one you linked, 3.6.3).

    My solution was to apply patches and fragment settings to u-boot in order to edit pvr driver parameters.

    The extra settings are as follows:
    pvrsrvkm.DisableClockGating=0
    pvrsrvkm.EnableRDPowerIsland=0
    pvrsrvkm.EnableFullSyncTracking=0
    pvrsrvkm.EnableSoftResetContextSwitch=0

    These were applied to the following files:

    u-boot-ti-staging/2024.04+git/git/include/configs/ti_armv7_common.h

    u-boot-ti-staging/2024.04+git/git/include/config_distro_bootcmd.h

    for the config_distro_bootcmd.h patch the settings should be used with "setenv bootargs ${bootargs} pvrsrvkm.DisableClockGating=0..."

    Potentially CONFIG_CMF_INI is required to be enabled in the u-boot config (accessed via bitbake -c menuconfig if using bitbake)

    If that doesn't work, add PVRSRV_APPHINT_ENABLEAPM=RGX_ACTIVEPM_FORCE_OFF to the EXTRA_OEMAKE for ti-img-rogue-driver

    I would think only one of these changes is required but I haven't invested the time to figure out which one is the solution since I just keep all of the patches applied simultaneously

    Kind Regards,

    Matt