lkml.org 
[lkml]   [2018]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v3 03/10] PM: Introduce an Energy Model management framework
Hi Quentin,

On 21/05/18 15:24, Quentin Perret wrote:

[...]

> +#ifdef CONFIG_ENERGY_MODEL

[...]

> +struct em_data_callback {
> + /**
> + * active_power() - Provide power at the next capacity state of a CPU
> + * @power : Active power at the capacity state (modified)
> + * @freq : Frequency at the capacity state (modified)
> + * @cpu : CPU for which we do this operation
> + *
> + * active_power() must find the lowest capacity state of 'cpu' above
> + * 'freq' and update 'power' and 'freq' to the matching active power
> + * and frequency.
> + *
> + * Return 0 on success.
> + */
> + int (*active_power) (unsigned long *power, unsigned long *freq, int cpu);
> +};

[...]

> +#else
> +struct em_freq_domain;
> +struct em_data_callback;

This doesn't compile for CONFIG_ENERGY_MODEL=n:

drivers/cpufreq/cpufreq-dt.c:164:9: error: variable 'em_cb' has initializer but incomplete type
struct em_data_callback em_cb = { &dev_pm_opp_of_estimate_power };
^~~~~~~~~~~~~~~~

Guess you need some sort of macro to init the struct (w/o introducing
ifdeffery into drivers code)?

Best,

- Juri

\
 
 \ /
  Last update: 2018-06-06 18:48    [W:0.401 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site