summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/exceptions-64e.S
diff options
context:
space:
mode:
authorLaurentiu Tudor <Laurentiu.Tudor@freescale.com>2013-03-14 14:13:51 (GMT)
committerEmil Medve <Emilian.Medve@Freescale.com>2013-04-02 09:48:02 (GMT)
commit04b4a27226e6396bdd12ea5185c9eea995fc21c3 (patch)
treea34c3067cd72302f71007002d53391083dd1fd54 /arch/powerpc/kernel/exceptions-64e.S
parent03f8008a6a6e45015dddeada9d23ef949e98b6d3 (diff)
downloadlinux-fsl-qoriq-04b4a27226e6396bdd12ea5185c9eea995fc21c3.tar.xz
powerpc/e6500: Don't assume two threads always present
There are virtualization scenarios that might expose to guests e6500 cores with just one thread. So check first how many threads are available and only after that try starting them. Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com> Change-Id: I7e14c0d7e9a792ad47e3f9cc41cf73a6a2b954f4 Reviewed-on: http://git.am.freescale.net:8181/578 Reviewed-by: Wood Scott-B07421 <scottwood@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'arch/powerpc/kernel/exceptions-64e.S')
-rw-r--r--arch/powerpc/kernel/exceptions-64e.S8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 0b7b33f..39308c7 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -1363,6 +1363,11 @@ _STATIC(init_core_book3e)
_GLOBAL(fsl_enable_threads)
BEGIN_FTR_SECTION
+ MFTMR(TMRN_TMCFG0, 3)
+ andi. r3,r3,0x3f
+ cmpi 0,r3,2
+ blt 2f
+
/* Disable the other thread */
li r3,2
mtspr SPRN_TENC,r3
@@ -1386,8 +1391,7 @@ BEGIN_FTR_SECTION
li r3, 2
mtspr SPRN_TENS, r3
END_FTR_SECTION_IFSET(CPU_FTR_SMT)
-
- blr
+2: blr
_STATIC(init_thread_book3e)
lis r3,(SPRN_EPCR_ICM | SPRN_EPCR_GICM)@h