-----Original Message----- From: cpufreq-owner@vger.kernel.org [mailto:cpufreq-owner@vger.kernel.org] On Behalf Of Viresh Kumar Sent: 2013年4月25日 19:27 To: Tang Yuantian-B29983 Cc: rjw@sisk.pl; cpufreq@vger.kernel.org; linux-pm@vger.kernel.org; Lists linaro-kernel Subject: Re: [PATCH] cpufreq: Fix the driver can not be unloaded issue
On 25 April 2013 16:08, Tang Yuantian-B29983 B29983@freescale.com wrote:
That's wired. I will have more tests on this. Thanks.
I found another bug you can try. It is also found on multiple cpus per cluster. Test step:
- compile the driver as module.
- hot-unplug one cpu( any one is OK)
- insmod module
- hot-plug the cpu ----> will cause error.
Or test step also can be:
- hot-unplug all the cpus in one cluster 2. hot-plug the cpus in this
cluster. When the second cpu gets hot-pluged, error will occur.
That's because the second cpu will call the cpufreq_add_dev_symlink() to Create the first cpu's "cpufreq link" which is already created. That needs more work to make a patch, hope you can fix it.
Haven't tested it now but i know why that can happen. It will happen only if driver->init() isn't setting policy->cpus correctly. You need to set both online & offline cpus, but in your setup it looks you are setting only online cpus and so cpufreq core isn't able to use the earlier policy struct for offline cpus.
And so it created a new struct cpufreq_policy for second cpu and trying to add links for all other cpus too... (which share this policy)..
Exactly. Currently, we don't consider the offline cpus when setting policy->cpus. Probably other platforms do the same thing.
Thanks, Yuantian
-- To unsubscribe from this list: send the line "unsubscribe cpufreq" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html