arm: mach-tegra: resolve tegra_cpu_lock race condition
authorSang-Hun Lee <sanlee@nvidia.com>
Mon, 11 Feb 2013 01:48:24 +0000 (17:48 -0800)
committerMandar Padmawar <mpadmawar@nvidia.com>
Mon, 18 Feb 2013 14:57:29 +0000 (06:57 -0800)
commit91bdd64c3c80480195a5ccdb8cef969ca5a18afc
tree53df067d3ce7e4296353473372b6c5b12b8823d2
parentd68e3878da280659e126db7ad0345137d05ebf3e
arm: mach-tegra: resolve tegra_cpu_lock race condition

Problem description:

 - lock used in cpuquiet, cpu-tegra3.c, tegra2-throttle.c, and tegra3_throttle
   originate from cpu-tegra.c, tegra_cpu_lock
 - edp_update_limit and tegra_auto_hotplug_governor need a protection from
   tegra_cpu_lock. These are also called by tegra_cpu_set_speed_cap
 - Some callers of tegra_cpu_set_speed_cap do not acquire tegra_cpu_lock,
   but some do

Fix description:

 - Create a locked variant and unlocked variant of tegra_cpu_set_speed_cap
   to make it explicit that tegra_cpu_lock is needed for tegra_cpu_set_speed_cap
 - Replace existing calls with new variants of tegra_cpu_set_speed_cap appropriately

Bug 1225764

Change-Id: I8aa6356df278375e3a9105023f66c8286e3fdbef
Signed-off-by: Sang-Hun Lee <sanlee@nvidia.com>
Reviewed-on: http://git-master/r/199238
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
arch/arm/mach-tegra/cpu-tegra.c
arch/arm/mach-tegra/cpu-tegra.h
arch/arm/mach-tegra/cpu-tegra3.c
arch/arm/mach-tegra/cpuquiet.c
arch/arm/mach-tegra/tegra2_throttle.c
arch/arm/mach-tegra/tegra3_throttle.c