cpufreq: OMAP: fix freq_table leak
authorNishanth Menon <nm@ti.com>
Fri, 27 May 2011 02:39:20 +0000 (19:39 -0700)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 13 Jan 2012 15:09:46 +0000 (17:09 +0200)
commit479581c25814ee95742d01881333e678a2389366
treeb135d916298c8e0ded21b330f33ebe1305991d95
parentdbbaf2f3f735450b756b0bcb1ffb1bf2bb0b2647
cpufreq: OMAP: fix freq_table leak

We use a single frequency table for multiple CPUs. But, with
OMAP4, since we have multiple CPUs, the cpu_init call for CPU1
causes freq_table previously allocated for CPU0 to be overwritten.
In addition, we dont free the table on exit path.

We solve this by maintaining an atomic type counter to ensure
just a single table exists at a given time.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
drivers/cpufreq/omap-cpufreq.c