ARM-software / SCP-firmware

This System Control Processor (SCP) firmware repository is no longer used and has been set to Read-only for archiving purposes. Please refer to the following active repository.

Home Page:https://gitlab.arm.com/firmware/SCP-firmware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

describe_fast_channels using wrong fast channel address

arunksudhilal opened this issue · comments

Hi,

I was enabling cpufreq scmi perf over fast channels and saw this issue. scmi_perf_describe_fast_channels() function is passing fast_channels_addr_ap to non-secure Linux. And when Linux reads these address they are all zero because they are not initialized anywhere in SCP code. I can get the fast channel working by changing addr_ap to addr_scp. Below is the patch. Please comment. Please help me understand what I m missing if I m wrong.

--- a/module/scmi_perf/src/mod_scmi_perf.c
+++ b/module/scmi_perf/src/mod_scmi_perf.c
@@ -1219,8 +1220,9 @@ static int scmi_perf_describe_fast_channels(fwk_id_t service_id,
         goto exit;
 
     }
-    if (domain->fast_channels_addr_ap == NULL ||
-        domain->fast_channels_addr_ap[chan_index] == 0x0) {
+
+       if (domain->fast_channels_addr_scp == NULL ||
+        domain->fast_channels_addr_scp[chan_index] == 0x0) {
         return_values.status = SCMI_NOT_SUPPORTED;
         goto exit;
     }
@@ -1228,9 +1230,9 @@ static int scmi_perf_describe_fast_channels(fwk_id_t service_id,
     return_values.attributes = 0; /* Doorbell not supported */
     return_values.rate_limit = scmi_perf_ctx.fast_channels_rate_limit;
     return_values.chan_addr_low =
-        (uint32_t)(domain->fast_channels_addr_ap[chan_index] & ~0UL);
+        (uint32_t)(domain->fast_channels_addr_scp[chan_index] & ~0UL);
     return_values.chan_addr_high =
-        (domain->fast_channels_addr_ap[chan_index] >> 32);
+        (domain->fast_channels_addr_scp[chan_index] >> 32);
     return_values.chan_size = chan_size;
 
 exit:

This is been refactored recently, no longer applicable