From 764b10dda52b97b215713bcae15d0cd107a83c7e Mon Sep 17 00:00:00 2001 From: Raymond Knopp <raymond.knopp@eurecom.fr> Date: Thu, 17 Jul 2014 11:54:22 +0000 Subject: [PATCH] git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5523 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- targets/RT/USER/lte-softmodem.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 3e9823871aa..e493997d515 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -340,6 +340,36 @@ void exit_fun(const char* s) //exit (-1); } +static int latency_target_fd = -1; +static int32_t latency_target_value = 0; +/* Latency trick - taken from cyclictest.c +* if the file /dev/cpu_dma_latency exists, +* open it and write a zero into it. This will tell +* the power management system not to transition to +* a high cstate (in fact, the system acts like idle=poll) +* When the fd to /dev/cpu_dma_latency is closed, the behavior +* goes back to the system default. +* +* Documentation/power/pm_qos_interface.txt +*/ +static void set_latency_target(void) +{ + struct stat s; + int ret; + if (stat("/dev/cpu_dma_latency", &s) == 0) { + latency_target_fd = open("/dev/cpu_dma_latency", O_RDWR); + if (latency_target_fd == -1) + return; + ret = write(latency_target_fd, &latency_target_value, 4); + if (ret == 0) { + printf("# error setting cpu_dma_latency to %d!: %s\n", latency_target_value, strerror(errno)); + close(latency_target_fd); + return; + } + printf("# /dev/cpu_dma_latency set to %dus\n", latency_target_value); + } +} + #ifdef XFORMS static void *scope_thread(void *arg) { char stats_buffer[16384]; @@ -407,8 +437,6 @@ static void *scope_thread(void *arg) { } #endif -int dummy_tx_buffer[3840*4] __attribute__((aligned(16))); - #ifdef EMOS #define NO_ESTIMATES_DISK 100 //No. of estimates that are aquired before dumped to disk -- GitLab