};
static int renoir_get_metrics_table(struct smu_context *smu,
- SmuMetrics_t *metrics_table)
+ SmuMetrics_t *metrics_table,
+ bool bypass_cache)
{
struct smu_table_context *smu_table= &smu->smu_table;
int ret = 0;
mutex_lock(&smu->metrics_lock);
- if (!smu_table->metrics_time || time_after(jiffies, smu_table->metrics_time + msecs_to_jiffies(100))) {
+
+ if (bypass_cache ||
+ !smu_table->metrics_time ||
+ time_after(jiffies, smu_table->metrics_time + msecs_to_jiffies(100))) {
ret = smu_cmn_update_table(smu, SMU_TABLE_SMU_METRICS, 0,
(void *)smu_table->metrics_table, false);
if (ret) {
smu_table->metrics_time = jiffies;
}
- memcpy(metrics_table, smu_table->metrics_table, sizeof(SmuMetrics_t));
+ if (metrics_table)
+ memcpy(metrics_table, smu_table->metrics_table, sizeof(SmuMetrics_t));
+
mutex_unlock(&smu->metrics_lock);
return ret;
memset(&metrics, 0, sizeof(metrics));
- ret = renoir_get_metrics_table(smu, &metrics);
+ ret = renoir_get_metrics_table(smu, &metrics, false);
if (ret)
return ret;
int ret = 0, clk_id = 0;
SmuMetrics_t metrics;
- ret = renoir_get_metrics_table(smu, &metrics);
+ ret = renoir_get_metrics_table(smu, &metrics, false);
if (ret)
return ret;
if (!value)
return -EINVAL;
- ret = renoir_get_metrics_table(smu, &metrics);
+ ret = renoir_get_metrics_table(smu, &metrics, false);
if (ret)
return ret;
if (!value)
return -EINVAL;
- ret = renoir_get_metrics_table(smu, &metrics);
+ ret = renoir_get_metrics_table(smu, &metrics, false);
if (ret)
return ret;
SmuMetrics_t metrics;
int ret = 0;
- ret = renoir_get_metrics_table(smu, &metrics);
+ ret = renoir_get_metrics_table(smu, &metrics, true);
if (ret)
return ret;