Re: [PATCH] PM: OPP: introduce function to free cpufreq table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 23, 2011 at 06:12:15PM -0500, Nishanth Menon wrote:
> cpufreq table allocated by opp_init_cpufreq_table is better
> freed by OPP layer itself. This allows future modifications to
> the table handling to be transparent to the users.
...
> +void opp_free_cpufreq_table(struct device *dev,
> +				struct cpufreq_frequency_table **table)
> +{
> +	if (!table)
> +		return;
> +
> +	/* Pretend as if I am an updater */
> +	mutex_lock(&dev_opp_list_lock);
> +	kfree(*table);
> +	*table = NULL;
> +	mutex_unlock(&dev_opp_list_lock);
> +}

Not clear what the mutex protects here.  Currently it protects only
device opp list modifications.  opp_init_cpufreq_table holds the lock only
while looking up and walking the device opp list; the cpufreq table it
creates is not complete by the time the lock is dropped.


Todd
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux