diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-10-24 21:44:44 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-11-10 22:11:35 +1100 |
commit | 1696d0fb7fcd18160c9cc92a3f2b2d68e6923dd8 (patch) | |
tree | 1f2788739eba799f1a06e5d5ec17328b758d27c0 /arch/powerpc/kernel/sysfs.c | |
parent | 339a3293f4e493a6c40f71e4faab0c8389174313 (diff) | |
download | talos-obmc-linux-1696d0fb7fcd18160c9cc92a3f2b2d68e6923dd8.tar.gz talos-obmc-linux-1696d0fb7fcd18160c9cc92a3f2b2d68e6923dd8.zip |
powerpc/64: Set DSCR default initially from SPR
Take the DSCR value set by firmware as the dscr_default value,
rather than zero.
POWER9 recommends DSCR default to a non-zero value.
Signed-off-by: From: Nicholas Piggin <npiggin@gmail.com>
[mpe: Make record_spr_defaults() __init]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/sysfs.c')
-rw-r--r-- | arch/powerpc/kernel/sysfs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index 4437c70c7c2b..b8d4a1dac39f 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@ -590,6 +590,17 @@ static void sysfs_create_dscr_default(void) if (cpu_has_feature(CPU_FTR_DSCR)) err = device_create_file(cpu_subsys.dev_root, &dev_attr_dscr_default); } + +void __init record_spr_defaults(void) +{ + int cpu; + + if (cpu_has_feature(CPU_FTR_DSCR)) { + dscr_default = mfspr(SPRN_DSCR); + for (cpu = 0; cpu < nr_cpu_ids; cpu++) + paca[cpu].dscr_default = dscr_default; + } +} #endif /* CONFIG_PPC64 */ #ifdef HAS_PPC_PMC_PA6T |