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-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2bf59e70d9b45f7e4ad57715b442e5861fcd178;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