commit f8c0e061cb83bd528ff0843e717bcebc846d4838 upstream.
Same as Intel, Zhaoxin MP CPUs support C3 share cache and on all
recent Zhaoxin platforms ARB_DISABLE is a nop. So set related
flags correctly in the same way as Intel does.
Signed-off-by: Tony W Wang-oc <TonyWWang-oc(a)zhaoxin.com>
Signed-off-by: Thomas Gleixner <tglx(a)linutronix.de>
Cc: "hpa(a)zytor.com" <hpa(a)zytor.com>
Cc: "gregkh(a)linuxfoundation.org" <gregkh(a)linuxfoundation.org>
Cc: "rjw(a)rjwysocki.net" <rjw(a)rjwysocki.net>
Cc: "lenb(a)kernel.org" <lenb(a)kernel.org>
Cc: David Wang <DavidWang(a)zhaoxin.com>
Cc: "Cooper Yan(BJ-RD)" <CooperYan(a)zhaoxin.com>
Cc: "Qiyuan Wang(BJ-RD)" <QiyuanWang(a)zhaoxin.com>
Cc: "Herry Yang(BJ-RD)" <HerryYang(a)zhaoxin.com>
Link:
https://lkml.kernel.org/r/a370503660994669991a7f7cda7c5e98@zhaoxin.com
Signed-off-by: LeoLiu-oc <LeoLiu-oc(a)zhaoxin.com>
---
arch/x86/kernel/acpi/cstate.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/x86/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c
index cb6e076a6d39..c010f5bbbc51 100644
--- a/arch/x86/kernel/acpi/cstate.c
+++ b/arch/x86/kernel/acpi/cstate.c
@@ -63,6 +63,21 @@ void acpi_processor_power_init_bm_check(struct
acpi_processor_flags *flags,
c->x86_stepping >= 0x0e))
flags->bm_check = 1;
}
+
+ if (c->x86_vendor == X86_VENDOR_ZHAOXIN) {
+ /*
+ * All Zhaoxin CPUs that support C3 share cache.
+ * And caches should not be flushed by software while
+ * entering C3 type state.
+ */
+ flags->bm_check = 1;
+ /*
+ * On all recent Zhaoxin platforms, ARB_DISABLE is a nop.
+ * So, set bm_control to zero to indicate that ARB_DISABLE
+ * is not required while entering C3 type state.
+ */
+ flags->bm_control = 0;
+ }
}
EXPORT_SYMBOL(acpi_processor_power_init_bm_check);
--
2.20.1