Re: Dynamic cpufreq_frequency_table?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6 March 2013 01:28, Guru Prasad <gurupras@xxxxxxxxxxx> wrote:
> What I mean is, every time i start the simulation with a new clock
> frequency, I have my cpufreq_init function do the following
>         int steps;
>         policy->cpuinfo.max_freq = my_cpufreq_get(policy->cpu); //In KHz
>         policy->cpuinfo.min_freq = 100  * 1000; //In KHz

You don't have to set these, but you just need to pass the right table
to cpufreq core and call cpufreq_frequency_table_cpuinfo(). These would
be set accordingly by this routine.

>         policy->cpuinfo.transition_latency = 10 * 1000; //In us
>         policy->cur = my_cpufreq_get(policy->cpu);      //(I'm assuming that
> the CPU frequency is always at the maximum before the driver takes
> control.)
>
>
> //      Get the number of cpufreq steps - Each step is 200MHz
>         steps = get_cpufreq_steps(policy->cpuinfo.max_freq,
> policy->cpuinfo.min_freq);
> //      Malloc the required space based on number of steps
>         dyn_cpufreq_table = kmalloc(sizeof(struct
> cpufreq_frequency_table) * steps, GFP_KERNEL);
> //      Create entries in the table
>         create_freq_table(dyn_cpufreq_table, policy);

That's okay, but i didn't get how will you get different set of
freqs in your table when you boot up.

> However, when I use this code, although my debug statements suggest
> that the table is created successfully, sysfs shows no cpufreq under
> /sys/devices/system/cpu/cpu0/

Something is wrong. And for finding out what, you need to post your code
here, even if it is non-mainline-able.


> Am I doing something wrong? Is GFP_KERNEL the wrong flag to use for
> this purpose?

That's not the culprit for sure.
--
To unsubscribe from this list: send the line "unsubscribe cpufreq" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux