From: Tero Kristo Date: Tue, 25 Sep 2012 16:05:32 +0000 (+0300) Subject: ARM: OMAP: clockdomain: Fix locking on _clkdm_clk_hwmod_enable / disable X-Git-Tag: omap-for-v3.7-rc1/fixes-take5-signed~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64e29fd5ed42f5d0ff5b0ea9395b3abd5d43f89b;p=pandora-kernel.git ARM: OMAP: clockdomain: Fix locking on _clkdm_clk_hwmod_enable / disable Previously the code only acquired spinlock after increasing / decreasing the usecount value, which is wrong. This leaves a small window where a task switch may occur between the check of the usecount and the actual wakeup / sleep of the domain. Fixed by moving the spinlock locking before the usecount access. Left the usecount as atomic_t if someone wants an easy access to the parameter through atomic_read. Signed-off-by: Tero Kristo Acked-by: Paul Walmsley Signed-off-by: Tony Lindgren --- Reading git-diff-tree failed