powerpc: Disable CPU_FTR_TM if TM is disabled by firmware
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sun, 2 Nov 2014 14:32:42 +0000 (20:02 +0530)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 9 May 2016 01:21:51 +0000 (21:21 -0400)
[ Upstream commit 9e819963b45f79e87f5a8c44960a66c0727c80e6 ]

Firmware is allowed to communicate to us via the "ibm,pa-features" property
that TM (Transactional Memory) support is disabled.

Currently this doesn't happen on any platform we're aware of, but we should
honor it anyway.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
arch/powerpc/kernel/prom.c

index 099f27e6d1b07e148c0b2c25d8f377d1d4f23654..2a95c6076fa367ab27785f929d6d28a082cad372 100644 (file)
@@ -160,6 +160,12 @@ static struct ibm_pa_feature {
        {CPU_FTR_NODSISRALIGN, 0, 0,    1, 1, 1},
        {0, MMU_FTR_CI_LARGE_PAGE, 0,   1, 2, 0},
        {CPU_FTR_REAL_LE, PPC_FEATURE_TRUE_LE, 5, 0, 0},
+       /*
+        * If the kernel doesn't support TM (ie. CONFIG_PPC_TRANSACTIONAL_MEM=n),
+        * we don't want to turn on CPU_FTR_TM here, so we use CPU_FTR_TM_COMP
+        * which is 0 if the kernel doesn't support TM.
+        */
+       {CPU_FTR_TM_COMP, 0, 0,         22, 0, 0},
 };
 
 static void __init scan_features(unsigned long node, const unsigned char *ftrs,