Maximizing performance (tegrastats, External memory controller)

Hi,
I am running a little program on the TK1 which polls for a GPIO interrupt to start a data acquisition. For some reason there is a significant delay whenever i wait some seconds between two consecutive executions. I already maximized the performance (cpu governor, cpuqiet etc) but it seems to me that some sort of power saving is still active. The tegrastats output below shows “good” behavior in the first line and “bad” in the second line. It seems to me that the throttled external memory controller frequency has an impact on my delay. How can i force the EMC to run at full speed?

AM 446/1924MB (lfb 321x4MB) cpu [0%,0%,0%,0%]@2065 EMC 12%@102 AVP 0%@204 VDE 120 GR3D 0%@12 EDP limit 0
RAM 446/1924MB (lfb 321x4MB) cpu [3%,3%,3%,3%]@2065 EMC 1%@924 AVP 0%@204 VDE 120 GR3D 0%@12 EDP limit 0

DId you try to use an interrupt instead of polling? A C code example available here - http://labs.isee.biz/index.php/How_to_use_GPIOs

Hi. My program already uses poll(). I found the following command to maximize EMC frequency:
cat /sys/kernel/debug/clock/override.emc/max > /sys/kernel/debug/clock/override.emc/rate
echo 1 > /sys/kernel/debug/clock/override.emc/state
Is there a better way to set the EMC bus speed to maximum? Are there any possible issues by doing so?

Hi, I am running a little program on the TK1 which polls for a GPIO interrupt to start a data >acquisition. For some reason there is a significant delay whenever i wait some seconds between >two consecutive executions.

How much is this significant delay?

I already maximized the performance (cpu governor, cpuqiet etc) but it seems to me that some sort of power saving is still active.

Did you set the scaling_governor to performance? Why do you think, the power saving is still active?

It seems to me that the throttled external memory controller frequency has an impact on mydelay. How can i force the EMC to run at full speed?

Do you have a heatsink or cooling down the module? What is the temperature of the module and cpu? The cpu will throttle down, when it gets too hot.

I did set the scaling_governor to perfomance and the device is activly cooled by three fans. The delay jitters between 600us and 1200us when the EMC frequency is 102kHz (observed with tegrastats). At some point the frequency goes up to 924 and the delay is quite stable around 200us.When i manually maximize the frequency (see comments above) everything works fine, so the only question left is if there is a better way to set the EMC frequency then using ‘/sys/kernel/debug’.

The EMC driver for TK1 seems to have a kernel module parameter which allows to disable EMC completely. Try setting tegra12_emc.emc_enable=0 in U-Boot as kernel command line:

Apalis TK1 # env set defargs ${defargs} tegra12_emc.emc_enable=0
Apalis TK1 # env save

Will this command disable the EMC or the dynamic frequency scaling?

It won’t disable the EMC, it will just leave it running at the highest operating point. It disables dynamic frequence scaling for the EMC.

For details, refer to the source in arch/arm/mach-tegra/tegra12_emc.c.

Great. Thanks for your help.

You are welcome.