Commit 9ab9b9d3 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki
Browse files

cpufreq: Drop unnecessary cpus locking from store()



This change was introduced long back by commit 4f750c93 ("cpufreq:
Synchronize the cpufreq store_*() routines with CPU hotplug").

Since then, both cpufreq and hotplug core have been reworked and have
much better locking in place. The race mentioned in commit 4f750c93
isn't possible anymore.

Drop the unnecessary locking.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 336e5128
Loading
Loading
Loading
Loading
+4 −15
Original line number Diff line number Diff line
@@ -973,21 +973,10 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
	if (!fattr->store)
		return -EIO;

	/*
	 * cpus_read_trylock() is used here to work around a circular lock
	 * dependency problem with respect to the cpufreq_register_driver().
	 */
	if (!cpus_read_trylock())
		return -EBUSY;

	if (cpu_online(policy->cpu)) {
	down_write(&policy->rwsem);
	if (likely(!policy_is_inactive(policy)))
		ret = fattr->store(policy, buf, count);
	up_write(&policy->rwsem);
	}

	cpus_read_unlock();

	return ret;
}