Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2019-06-15 17:24:15 +0200
committerBorislav Petkov <bp@suse.de>2019-06-15 17:24:15 +0200
commit85f4332322f386ddfea1b511b34eb1fa4794e220 (patch)
treed8f261ca61e6d04779cd947a95cba0ec73bca2ee
parent1efb484301d0a0d1fd6f0b4e2899b44b57cda916 (diff)
cpufreq: Add Hygon Dhyana support (fate#327735).
-rw-r--r--patches.arch/cpufreq-add-hygon-dhyana-support.patch91
-rw-r--r--series.conf1
2 files changed, 92 insertions, 0 deletions
diff --git a/patches.arch/cpufreq-add-hygon-dhyana-support.patch b/patches.arch/cpufreq-add-hygon-dhyana-support.patch
new file mode 100644
index 0000000000..664f59219f
--- /dev/null
+++ b/patches.arch/cpufreq-add-hygon-dhyana-support.patch
@@ -0,0 +1,91 @@
+From: Pu Wen <puwen@hygon.cn>
+Date: Sun, 23 Sep 2018 17:37:38 +0800
+Subject: cpufreq: Add Hygon Dhyana support
+Git-commit: cc9690cfc7a36873b219d569049e10f073dd22e4
+Patch-mainline: v4.20-rc1
+References: fate#327735
+
+The Hygon Dhyana CPU supports ACPI P-States, and there is SMBus device
+(PCI device ID 0x790b) on the Hygon platform. Add Hygon Dhyana support
+to the cpufreq driver by using the code path of AMD family 17h.
+
+Signed-off-by: Pu Wen <puwen@hygon.cn>
+Signed-off-by: Borislav Petkov <bp@suse.de>
+Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Cc: rjw@rjwysocki.net
+Cc: viresh.kumar@linaro.org
+Cc: bp@alien8.de
+Cc: tglx@linutronix.de
+Cc: mingo@redhat.com
+Cc: hpa@zytor.com
+Cc: x86@kernel.org
+Cc: thomas.lendacky@amd.com
+Cc: rafael@kernel.org
+Cc: linux-pm@vger.kernel.org
+Link: https://lkml.kernel.org/r/4db6f0f8537a93c172430c446a0297a6ab1c3c2d.1537533369.git.puwen@hygon.cn
+---
+ drivers/cpufreq/acpi-cpufreq.c | 5 +++++
+ drivers/cpufreq/amd_freq_sensitivity.c | 9 +++++++--
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
+index b61f4ec43e06..d62fd374d5c7 100644
+--- a/drivers/cpufreq/acpi-cpufreq.c
++++ b/drivers/cpufreq/acpi-cpufreq.c
+@@ -61,6 +61,7 @@ enum {
+
+ #define INTEL_MSR_RANGE (0xffff)
+ #define AMD_MSR_RANGE (0x7)
++#define HYGON_MSR_RANGE (0x7)
+
+ #define MSR_K7_HWCR_CPB_DIS (1ULL << 25)
+
+@@ -95,6 +96,7 @@ static bool boost_state(unsigned int cpu)
+ rdmsr_on_cpu(cpu, MSR_IA32_MISC_ENABLE, &lo, &hi);
+ msr = lo | ((u64)hi << 32);
+ return !(msr & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);
++ case X86_VENDOR_HYGON:
+ case X86_VENDOR_AMD:
+ rdmsr_on_cpu(cpu, MSR_K7_HWCR, &lo, &hi);
+ msr = lo | ((u64)hi << 32);
+@@ -113,6 +115,7 @@ static int boost_set_msr(bool enable)
+ msr_addr = MSR_IA32_MISC_ENABLE;
+ msr_mask = MSR_IA32_MISC_ENABLE_TURBO_DISABLE;
+ break;
++ case X86_VENDOR_HYGON:
+ case X86_VENDOR_AMD:
+ msr_addr = MSR_K7_HWCR;
+ msr_mask = MSR_K7_HWCR_CPB_DIS;
+@@ -225,6 +228,8 @@ static unsigned extract_msr(struct cpufreq_policy *policy, u32 msr)
+
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
+ msr &= AMD_MSR_RANGE;
++ else if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
++ msr &= HYGON_MSR_RANGE;
+ else
+ msr &= INTEL_MSR_RANGE;
+
+diff --git a/drivers/cpufreq/amd_freq_sensitivity.c b/drivers/cpufreq/amd_freq_sensitivity.c
+index be926d9a66e5..4ac7c3cf34be 100644
+--- a/drivers/cpufreq/amd_freq_sensitivity.c
++++ b/drivers/cpufreq/amd_freq_sensitivity.c
+@@ -111,11 +111,16 @@ static int __init amd_freq_sensitivity_init(void)
+ {
+ u64 val;
+ struct pci_dev *pcidev;
++ unsigned int pci_vendor;
+
+- if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
++ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
++ pci_vendor = PCI_VENDOR_ID_AMD;
++ else if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON)
++ pci_vendor = PCI_VENDOR_ID_HYGON;
++ else
+ return -ENODEV;
+
+- pcidev = pci_get_device(PCI_VENDOR_ID_AMD,
++ pcidev = pci_get_device(pci_vendor,
+ PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, NULL);
+
+ if (!pcidev) {
+
diff --git a/series.conf b/series.conf
index d23ff8fc0d..464263a96c 100644
--- a/series.conf
+++ b/series.conf
@@ -19546,6 +19546,7 @@
patches.arch/x86-kvm-add-hygon-dhyana-support-to-kvm.patch
patches.arch/x86-xen-add-hygon-dhyana-support-to-xen.patch
patches.arch/acpi-add-hygon-dhyana-support.patch
+ patches.arch/cpufreq-add-hygon-dhyana-support.patch
patches.fixes/0001-x86-xen-Fix-boot-loader-version-reported-for-PVH-gue.patch
patches.arch/x86-kexec-correct-kexec_backup_src_end-off-by-one-error.patch
patches.fixes/resource-include-resource-end-in-walk_-interfaces.patch