summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorCyril Bur2018-02-14 04:27:06 +0100
committerMichael Ellerman2018-02-14 23:54:42 +0100
commitc134f0d57a47b7f8704dee1cefc246f9471f3e80 (patch)
tree1da876159171790a96a2a76ab5d3941be66b498b /arch/powerpc/kernel
parentMerge tag 'powerpc-4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/p... (diff)
downloadkernel-qcow2-linux-c134f0d57a47b7f8704dee1cefc246f9471f3e80.tar.gz
kernel-qcow2-linux-c134f0d57a47b7f8704dee1cefc246f9471f3e80.tar.xz
kernel-qcow2-linux-c134f0d57a47b7f8704dee1cefc246f9471f3e80.zip
powerpc: Expose TSCR via sysfs only on powernv
The TSCR can only be accessed in hypervisor mode. Fixes: 88b5e12eeb11 ("powerpc: Expose TSCR via sysfs") Signed-off-by: Cyril Bur <cyrilbur@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/sysfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 5a8bfee6e187..04d0bbd7a1dd 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -788,7 +788,8 @@ static int register_cpu_online(unsigned int cpu)
if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
device_create_file(s, &dev_attr_pir);
- if (cpu_has_feature(CPU_FTR_ARCH_206))
+ if (cpu_has_feature(CPU_FTR_ARCH_206) &&
+ !firmware_has_feature(FW_FEATURE_LPAR))
device_create_file(s, &dev_attr_tscr);
#endif /* CONFIG_PPC64 */
@@ -873,7 +874,8 @@ static int unregister_cpu_online(unsigned int cpu)
if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
device_remove_file(s, &dev_attr_pir);
- if (cpu_has_feature(CPU_FTR_ARCH_206))
+ if (cpu_has_feature(CPU_FTR_ARCH_206) &&
+ !firmware_has_feature(FW_FEATURE_LPAR))
device_remove_file(s, &dev_attr_tscr);
#endif /* CONFIG_PPC64 */