remarkable-linux/arch
Srinivas Pandruvada 51319f40e5 ACPI / processor: Request native thermal interrupt handling via _OSC
[ Upstream commit a21211672c ]

There are several reports of freeze on enabling HWP (Hardware PStates)
feature on Skylake-based systems by the Intel P-states driver. The root
cause is identified as the HWP interrupts causing BIOS code to freeze.

HWP interrupts use the thermal LVT which can be handled by Linux
natively, but on the affected Skylake-based systems SMM will respond
to it by default.  This is a problem for several reasons:
 - On the affected systems the SMM thermal LVT handler is broken (it
   will crash when invoked) and a BIOS update is necessary to fix it.
 - With thermal interrupt handled in SMM we lose all of the reporting
   features of the arch/x86/kernel/cpu/mcheck/therm_throt driver.
 - Some thermal drivers like x86-package-temp depend on the thermal
   threshold interrupts signaled via the thermal LVT.
 - The HWP interrupts are useful for debugging and tuning
   performance (if the kernel can handle them).
The native handling of thermal interrupts needs to be enabled
because of that.

This requires some way to tell SMM that the OS can handle thermal
interrupts.  That can be done by using _OSC/_PDC in processor
scope very early during ACPI initialization.

The meaning of _OSC/_PDC bit 12 in processor scope is whether or
not the OS supports native handling of interrupts for Collaborative
Processor Performance Control (CPPC) notifications.  Since on
HWP-capable systems CPPC is a firmware interface to HWP, setting
this bit effectively tells the firmware that the OS will handle
thermal interrupts natively going forward.

For details on _OSC/_PDC refer to:
http://www.intel.com/content/www/us/en/standards/processor-vendor-specific-acpi-specification.html

To implement the _OSC/_PDC handshake as described, introduce a new
function, acpi_early_processor_osc(), that walks the ACPI
namespace looking for ACPI processor objects and invokes _OSC for
them with bit 12 in the capabilities buffer set and terminates the
namespace walk on the first success.

Also modify intel_thermal_interrupt() to clear HWP status bits in
the HWP_STATUS MSR to acknowledge HWP interrupts (which prevents
them from firing continuously).

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ rjw: Subject & changelog, function rename ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-07-10 23:07:20 -04:00
..
alpha alpha: kernel: osf_sys: Set 'kts.tv_nsec' only when 'tv' has effect 2015-05-26 10:01:51 -07:00
arc arc: unwind: warn only once if DW2_UNWIND is disabled 2016-07-10 22:27:13 -04:00
arm ARM: OMAP3: Add cpuidle parameters table for omap3430 2016-07-10 23:07:15 -04:00
arm64 arm64: mm: remove page_mapping check in __sync_icache_dcache 2016-07-10 20:20:00 -04:00
avr32 mmc: atmel-mci: restore dma on AVR32 2016-04-18 08:51:01 -04:00
blackfin blackfin: Fix build error 2015-06-10 10:19:24 -07:00
c6x C6X Fixes for v4.1 2015-04-16 18:48:55 -04:00
cris CRIS changes for 4.1 2015-04-26 13:31:05 -07:00
frv Devicetree updates for 4.1: 2015-04-24 08:46:18 -07:00
hexagon Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc 2015-04-15 13:53:55 -07:00
ia64 ia64: make cpu_callin_map non-volatile. 2015-06-02 10:07:03 -07:00
m32r m32r: fix m32104ut_defconfig build fail 2016-02-03 16:23:16 -05:00
m68k m68k: Define asmlinkage_protect 2015-10-22 14:43:25 -07:00
metag Metag architecture changes for v4.1 2015-04-24 07:56:50 -07:00
microblaze microblaze: use asm-generic for seccomp.h 2015-04-17 09:04:10 -04:00
mips MIPS: KVM: Fix modular KVM under QEMU 2016-07-10 20:19:56 -04:00
mn10300 mn10300: Select CONFIG_HAVE_UID16 to fix build failure 2016-01-31 11:23:40 -08:00
nios2 nios2 update for v4.1-rc1 2015-04-24 07:59:07 -07:00
openrisc openrisc: fix CONFIG_UID16 setting 2015-08-03 09:28:58 -07:00
parisc parisc: Fix pagefault crash in unaligned __get_user() call 2016-06-17 15:39:21 -04:00
powerpc powerpc: Update TM user feature bits in scan_features() 2016-07-10 23:07:09 -04:00
s390 Revert "s390/kdump: Clear subchannel ID to signal non-CCW/SCSI IPL" 2016-07-10 22:27:13 -04:00
score score: Fix exception handler label 2015-06-10 10:19:47 -07:00
sh lib/decompressors: use real out buf size for gunzip with kernel 2015-09-29 19:26:19 +02:00
sparc sparc64: fix incorrect sign extension in sys_sparc64_personality 2016-02-03 16:23:15 -05:00
tile signal: fix information leak in copy_siginfo_from_user32 2015-08-16 20:52:26 -07:00
um fs/coredump: prevent fsuid=0 dumps into user-controlled directories 2016-04-18 08:51:07 -04:00
unicore32 lib/decompressors: use real out buf size for gunzip with kernel 2015-09-29 19:26:19 +02:00
x86 ACPI / processor: Request native thermal interrupt handling via _OSC 2016-07-10 23:07:20 -04:00
xtensa xtensa: clear all DBREAKC registers on start 2016-04-18 08:50:55 -04:00
.gitignore
Kconfig powerpc updates for 4.1 2015-04-16 13:53:32 -05:00