Thread (16 messages) 16 messages, 5 authors, 2016-03-01

Re: [PATCH] cpufreq: acpi_cpufreq: base frequency attribute support

From: Pandruvada, Srinivas <hidden>
Date: 2016-02-26 01:10:08

On Thu, 2016-02-25 at 10:07 -0800, Srinivas Pandruvada wrote:
On Thu, 2016-02-25 at 08:57 +0530, Viresh Kumar wrote:
quoted
On 24-02-16, 15:37, Srinivas Pandruvada wrote:
quoted
Good I tested again.

Hi Viresh,

Are we no longer allowed to call
	sysfs_create_file in cpufreq_driver.init() callback?

The following call crashes because of BUG_ON for !kobj->sd:
	sysfs_create_file(&policy->kobj,
                                 
&(cpufreq_attr_base_frequency.attr));

Before I debug further, I want to check with you.
This used to work before.
Haven't checked that yet, but you should be using
cpufreq_driver.attr
for this
kind of stuff, isn't it ?
If I use cpufreq_driver.attr, then it will create sysfs attribute for
every system using acpi-cpufreq, whether they can support it or not.
This change is only needed for the later generation of Intel CPUs
(IvyBridge and later). 
There is no standard ACPI way to know the base frequency if we add
attribute for all systems using acpi-cpufreq.
There is used to be

cpufreq_policy_alloc() {
..
    ret = kobject_init_and_add(&policy->kobj, &ktype_cpufreq,
&dev>kobj, "cpufreq");
}

Now it is removed, so we don't have directory entry for policy->kobj to
add during init() callback. Now we have kobject_add after init()
callback returns for policy%u.

Thanks,
Srinivas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help