Hi Viresh, Thanks for the quick response. 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 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); 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/ Am I doing something wrong? Is GFP_KERNEL the wrong flag to use for this purpose? Regards Guru On Tue, Mar 5, 2013 at 12:01 PM, Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote: > Hi Guru, > > On Wed, Mar 6, 2013 at 12:15 AM, Guru Prasad <gurupras@xxxxxxxxxxx> wrote: >> I'm trying to run the Linux kernel with the cpufreq driver in a >> simulation environment where the CPU frequency can be modified. > > Okay. > >> This leaves me with two choices : >> Either have several kernels with different static cpufreq_frequency tables or > > So you meant have different uImages per freq_table, right? > >> let the kernel create the cpufreq_frequency_table dynamically. > > Didn't get that completely :( > You want the kernel to create this table dynamically, yes we can allocate memory > for it dynamically, but we need some input from some static/dynamic code on the > kind of values you have. > > So, we need a fixed freq_table before cpufreq_driver->init is called. That's it. > > What you might end up doing could be unregister/register your cpufreq driver for > every new freq_table you want to test your system with. And so your > cpufreq_driver->init() can return these new tables everytime. -- 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