Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c134f0d5 authored by Cyril Bur's avatar Cyril Bur Committed by Michael Ellerman
Browse files

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: default avatarCyril Bur <cyrilbur@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 694a20da
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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 */