linux-stable/drivers/platform
Rajneesh Bhardwaj 8aba056a4e platform/x86: intel_pmc_core: Add Package cstates residency info
This patch introduces a new debugfs entry to read current Package
cstate residency counters. A similar variant of this patch was discussed
earlier "https://patchwork.kernel.org/patch/9908563/" but didn't make it
into mainline for various reasons. Current version only adds debugfs
entry which is quite useful for S0ix debug but excludes the exported API
that was there in initial version. Though there are tools like turbostat
and socwatch which can also show this info but sometimes its more
practical to have it here as it's hard to switch between various tools for
S0ix debug when pmc_core driver is the primary debug tool. Internal and
external customers have requested for this patch to be included in the
PMC driver on many occasions and Google Chrome OS team has already included
it in their builds. This becomes handy when requesting logs from external
customers who may not always have above mentioned tools in their integrated
kernel builds.

Package cstate residency MSRs provide useful debug information about
system idle states. In idle states system must enter deeper Package
cstates. Package cstates depend not only on Core cstates but also on
various IP block's power gating status and LTR values.

For Intel Core SoCs Package C10 entry is a must for deeper sleep states
such as S0ix. "Suspend-to-idle"  should ideally take this path:
PC0 -> PC10 -> S0ix. For S0ix debug, its logical to check for
Package C10 residency first if for some reason system fails to enter S0ix.

Please refer to this link for MSR details:
https://software.intel.com/sites/default/files/managed/22/0d/335592-sdm-vol-4.pdf

Usage:
cat /sys/kernel/debug/pmc_core/package_cstate_show
Package C2       : 0xec2e21735f
Package C3       : 0xc30113ba4
Package C6       : 0x9ef4be15c5
Package C7       : 0x1e011904
Package C8       : 0x3c5653cfe5a
Package C9       : 0x0
Package C10      : 0x16fff4289

Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: "David E. Box" <david.e.box@intel.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-and-tested-by: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2019-02-23 09:21:16 -08:00
..
chrome platform/chrome: don't report EC_MKBP_EVENT_SENSOR_FIFO as wakeup 2018-11-13 21:25:28 -08:00
goldfish Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
mellanox platform/mellanox: mlxreg-hotplug: Fix KASAN warning 2019-02-23 09:20:32 -08:00
mips MIPS: Loongson: Add Loongson-3A R2.1 basic support 2018-11-19 15:20:31 -08:00
olpc platform/olpc: Make ec explicitly non-modular 2016-08-28 22:31:52 -07:00
x86 platform/x86: intel_pmc_core: Add Package cstates residency info 2019-02-23 09:21:16 -08:00
Kconfig platform/x86: Move Mellanox platform hotplug driver to platform/mellanox 2018-01-31 10:36:48 -08:00
Makefile platform/x86: Move Mellanox platform hotplug driver to platform/mellanox 2018-01-31 10:36:48 -08:00