From: Will Deacon Date: Fri, 7 Feb 2014 18:12:32 +0000 (+0100) Subject: ARM: 7955/1: spinlock: ensure we have a compiler barrier before sev X-Git-Tag: v3.2.56~101 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c8e77aa65fd685e09804e7a6709c82baa3648d1;p=pandora-kernel.git ARM: 7955/1: spinlock: ensure we have a compiler barrier before sev commit 7c8746a9eb287642deaad0e7c2cdf482dce5e4be upstream. When unlocking a spinlock, we require the following, strictly ordered sequence of events: /* dmb */ /* dsb */ Whilst the code does indeed reflect this in terms of the architecture, the final + have been contracted into a single inline asm without a "memory" clobber, therefore the compiler is at liberty to reorder the unlock to the end of the above sequence. In such a case, a waiting CPU may be woken up before the lock has been unlocked, leading to extremely poor performance. This patch reworks the dsb_sev() function to make use of the dsb() macro and ensure ordering against the unlock. Reported-by: Mark Rutland Signed-off-by: Will Deacon Signed-off-by: Russell King [bwh: Backported to 3.2: 'ishst' variant is not used here] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed