cpufreq: AMD: Ignore the check for ProcFeedback in ST/CZ
authorAkshu Agrawal <Akshu.Agrawal@amd.com>
Thu, 18 Jan 2018 10:21:30 +0000 (15:51 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 7 Feb 2018 10:26:37 +0000 (11:26 +0100)
In ST/CZ CPUID 8000_0007_EDX[11, ProcFeedbackInterface] is 0,
but the mechanism is still available and can be used.

Signed-off-by: Akshu Agrawal <akshu.agrawal@amd.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/amd_freq_sensitivity.c

index 042023bbbf6214744070196ab5616abc58e81689..be926d9a66e574604758fb40300504bec9ca3039 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/types.h>
+#include <linux/pci.h>
 #include <linux/percpu-defs.h>
 #include <linux/init.h>
 #include <linux/mod_devicetable.h>
@@ -109,12 +110,18 @@ out:
 static int __init amd_freq_sensitivity_init(void)
 {
        u64 val;
+       struct pci_dev *pcidev;
 
        if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD)
                return -ENODEV;
 
-       if (!static_cpu_has(X86_FEATURE_PROC_FEEDBACK))
-               return -ENODEV;
+       pcidev = pci_get_device(PCI_VENDOR_ID_AMD,
+                       PCI_DEVICE_ID_AMD_KERNCZ_SMBUS, NULL);
+
+       if (!pcidev) {
+               if (!static_cpu_has(X86_FEATURE_PROC_FEEDBACK))
+                       return -ENODEV;
+       }
 
        if (rdmsrl_safe(MSR_AMD64_FREQ_SENSITIVITY_ACTUAL, &val))
                return -ENODEV;