[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git-commits-head
Subject:    Blackfin: work around testset anomaly 05000477
From:       Linux Kernel Mailing List <linux-kernel () vger ! kernel ! org>
Date:       2009-11-30 23:59:09
Message-ID: 200911302359.nAUNx9GG001174 () hera ! kernel ! org
[Download RAW message or body]

Gitweb:     http://git.kernel.org/linus/f99e8c1d0f41011870d14d5990c65e65b123f2ef
Commit:     f99e8c1d0f41011870d14d5990c65e65b123f2ef
Parent:     af5d7fc7e4d8e34bad42178f7011287e94eeb3ed
Author:     Mike Frysinger <vapier@gentoo.org>
AuthorDate: Tue Nov 3 03:14:38 2009 +0000
Committer:  Mike Frysinger <vapier@gentoo.org>
CommitDate: Wed Nov 25 02:35:39 2009 -0500

    Blackfin: work around testset anomaly 05000477
    
    Ironically, the atomic testset instruction cannot be interrupted else it
    will produce incorrect results.  So disable interrupts to help it out.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/blackfin/mach-bf561/atomic.S |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/mach-bf561/atomic.S b/arch/blackfin/mach-bf561/atomic.S
index 0261a5e..f99f174 100644
--- a/arch/blackfin/mach-bf561/atomic.S
+++ b/arch/blackfin/mach-bf561/atomic.S
@@ -19,6 +19,16 @@
 	\reg\().h = _corelock;
 .endm
 
+.macro safe_testset addr:req, scratch:req
+#if ANOMALY_05000477
+	cli \scratch;
+	testset (\addr);
+	sti \scratch;
+#else
+	testset (\addr);
+#endif
+.endm
+
 /*
  * r0 = address of atomic data to flush and invalidate (32bit).
  *
@@ -33,7 +43,7 @@ ENTRY(_get_core_lock)
 	cli r0;
 	coreslot_loadaddr p0;
 .Lretry_corelock:
-	testset (p0);
+	safe_testset p0, r2;
 	if cc jump .Ldone_corelock;
 	SSYNC(r2);
 	jump .Lretry_corelock
@@ -56,7 +66,7 @@ ENTRY(_get_core_lock_noflush)
 	cli r0;
 	coreslot_loadaddr p0;
 .Lretry_corelock_noflush:
-	testset (p0);
+	safe_testset p0, r2;
 	if cc jump .Ldone_corelock_noflush;
 	SSYNC(r2);
 	jump .Lretry_corelock_noflush
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic