aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/intel_speed_select_if/isst_if_common.h
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2019-06-26 15:38:44 -0700
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-07-02 18:41:16 +0300
commit8fbfb6fc67819c1274584ff902f7d03aafe38dab (patch)
treef0ffe79f841eaecffcac98d9423c5096f2da7368 /drivers/platform/x86/intel_speed_select_if/isst_if_common.h
parentplatform/x86: ISST: Add common API to register and handle ioctls (diff)
downloadlinux-dev-8fbfb6fc67819c1274584ff902f7d03aafe38dab.tar.xz
linux-dev-8fbfb6fc67819c1274584ff902f7d03aafe38dab.zip
platform/x86: ISST: Store per CPU information
There are two per CPU data needs to be stored and cached to avoid repeated MSR readings for accessing them later: - Physical to logical CPU conversion The PUNIT uses a different CPU numbering scheme which is not APIC id based. So we need to establish relationship between PUNIT CPU number and Linux logical CPU numbering which is based on APIC id. There is an MSR 0x53 (MSR_THREAD_ID), which gets physical CPU number for the local CPU where it is read. Also the CPU mask in some messages will inform which CPUs needs to be online/offline for a TDP level. During TDP switch if user offlined some CPUs, then the physical CPU mask can't be converted as we can't read MSR on an offlined CPU to go to a lower TDP level by onlining more CPUs. So the mapping needs to be established at the boot up time. - Bus number corresponding to a CPU A group of CPUs are in a control of a PUNIT. The PUNIT device is exported as PCI device. To do operation on a PUNIT for a CPU, we need to find out to which PCI device it is related to. This is done by reading MSR 0x128 (MSR_CPU_BUS_NUMBER). So during CPU online stages the above MSRs are read and stored. Later this stored information is used to process IOCTLs request from the user space. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform/x86/intel_speed_select_if/isst_if_common.h')
-rw-r--r--drivers/platform/x86/intel_speed_select_if/isst_if_common.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/platform/x86/intel_speed_select_if/isst_if_common.h b/drivers/platform/x86/intel_speed_select_if/isst_if_common.h
index 11f339226fb4..dade77c58b22 100644
--- a/drivers/platform/x86/intel_speed_select_if/isst_if_common.h
+++ b/drivers/platform/x86/intel_speed_select_if/isst_if_common.h
@@ -57,4 +57,5 @@ struct isst_if_cmd_cb {
/* Internal interface functions */
int isst_if_cdev_register(int type, struct isst_if_cmd_cb *cb);
void isst_if_cdev_unregister(int type);
+struct pci_dev *isst_if_get_pci_dev(int cpu, int bus, int dev, int fn);
#endif