Quoting Viresh Kumar (2018-12-13 02:14:17) > On 13-12-18, 02:12, Stephen Boyd wrote: > > It's on a v4.19 kernel with this cpufreq hw driver backported to it. I > > think all it takes is to return an error the second time the policy is > > initialized when cpufreq_online() calls into the cpufreq driver. > > What do you mean by "the second time the policy is initialized" ? > > We call cpufreq_online() only once for each policy. > I have one policy for four CPUs. So take down all four of those CPUs by writing a 0 to the online file for each CPU, and then bring them back online. That should make cpufreq_driver->init() be called twice, once during boot when the CPUs are bound to the cpufreq devices, and second from the sysfs write when the user brings the first CPU in that policy online again by writing a 1 to the online file. If that second time it fails I suspect we hit the lockdep warning. I may have also catted the policy*/stat/* files before offlining any CPUs. If you can't trigger it I can try to reproduce again with a static counter in cpufreq_online() that fails when set to 1 or something.