From: Graf Yang <graf.yang@analog.com>
Date: Mon, 27 Oct 2008 10:12:53 +0000 (+0800)
Subject: Blackfin arch: fix bug - Fail to boot jffs2 kernel for BF561 with SMP patch
X-Git-Tag: firefly_0821_release~16782^2~10
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6776cf4476833df0f1e96bd9dba18c1ea4f582d5;p=firefly-linux-kernel-4.4.55.git

Blackfin arch: fix bug - Fail to boot jffs2 kernel for BF561 with SMP patch

only if the cplb block overlapped with kernel area, this cplb need be locked

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---

diff --git a/arch/blackfin/kernel/cplb-nompu/cplbinit.c b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
index 512f8c92ead5..2debc900e246 100644
--- a/arch/blackfin/kernel/cplb-nompu/cplbinit.c
+++ b/arch/blackfin/kernel/cplb-nompu/cplbinit.c
@@ -188,10 +188,11 @@ static struct cplb_desc cplb_data[] = {
 
 static u16 __init lock_kernel_check(u32 start, u32 end)
 {
-	if ((end   <= (u32) _end && end   >= (u32)_stext) ||
-	    (start <= (u32) _end && start >= (u32)_stext))
-		return IN_KERNEL;
-	return 0;
+	if (start >= (u32)_end || end <= (u32)_stext)
+		return 0;
+
+	/* This cplb block overlapped with kernel area. */
+	return IN_KERNEL;
 }
 
 static unsigned short __init