1
0
Fork 0
remarkable-linux/drivers/acpi
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
..
acpica ACPICA: Dispatcher: Update thread ID for recursive method calls 2016-05-17 13:42:58 -04:00
apei When checking addresses in APEI action entries for validity, allow 2015-01-15 11:30:57 +01:00
pmic ACPI/PMIC: Fix typo in MODULE_DESCRIPTION in intel_pmic_crc.c 2015-03-26 21:34:51 +01:00
Kconfig ACPI: move arm64 GSI IRQ model to generic GSI IRQ layer 2015-03-26 15:13:09 +00:00
Makefile ACPI: move arm64 GSI IRQ model to generic GSI IRQ layer 2015-03-26 15:13:09 +00:00
ac.c power_supply: Change ownership from driver to core 2015-03-13 23:15:51 +01:00
acpi_apd.c ACPI: add AMD ACPI2Platform device support for x86 system 2015-02-06 15:42:16 +01:00
acpi_cmos_rtc.c ACPI / RTC: Fix CMOS RTC opregion handler accesses to wrong addresses 2014-09-08 15:38:41 +02:00
acpi_extlog.c ACPI and power management updates for 3.17-rc1 2014-08-06 20:34:19 -07:00
acpi_ipmi.c ACPI / IPMI: Cleanup coding styles 2013-09-30 19:46:13 +02:00
acpi_lpat.c ACPI / LPAT: Common table processing functions 2015-01-29 21:02:10 +08:00
acpi_lpss.c ACPI / LPSS: Fix up acpi_lpss_create_device() 2015-08-03 09:29:14 -07:00
acpi_memhotplug.c ACPICA: Resources: Provide common part for struct acpi_resource_address structures. 2015-01-26 16:09:56 +01:00
acpi_pad.c ACPI/PAD: Use explicit broadcast oneshot control function 2015-04-03 08:44:34 +02:00
acpi_platform.c driver core / ACPI: Represent ACPI companions using fwnode_handle 2015-03-16 23:49:03 +01:00
acpi_pnp.c serial: 8250: bind to ALi Fast Infrared Controller (ALI5123) 2015-09-21 10:05:39 -07:00
acpi_processor.c ACPI / processor: Request native thermal interrupt handling via _OSC 2016-07-10 23:07:20 -04:00
battery.c Power management and ACPI updates for v4.1-rc1 2015-04-14 20:21:54 -07:00
battery.h ACPI / battery: move some ACPI_BATTERY_* definitions to header 2014-03-19 01:57:46 +01:00
bgrt.c acpi: bgrt: fix build error due to attribute change 2013-08-22 08:34:39 -07:00
blacklist.c ACPI / blacklist: Disable Vista compatibility for Sony VGN-SR19XN. 2015-03-16 15:14:50 +01:00
bus.c ACPI / processor: Request native thermal interrupt handling via _OSC 2016-07-10 23:07:20 -04:00
button.c ACPI / button: Do not propagate wakeup-from-suspend events 2014-07-23 00:59:04 +02:00
cm_sbs.c ACPI: Revert "ACPI: Remove CONFIG_ACPI_PROCFS_POWER and cm_sbsc.c" 2014-05-06 01:52:09 +02:00
container.c ACPI / hotplug: Generate online uevents for ACPI containers 2014-09-21 02:58:18 +02:00
custom_method.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
debugfs.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
device_pm.c ACPI / PM: Add missing pm_generic_complete() invocation 2015-07-21 10:10:02 -07:00
dock.c driver core / ACPI: Represent ACPI companions using fwnode_handle 2015-03-16 23:49:03 +01:00
ec.c ACPI / EC: fix NULL pointer dereference in acpi_ec_remove_query_handler() 2015-04-22 04:12:35 +02:00
ec_sys.c ACPI / EC: Mark the function acpi_ec_add_debugfs() as static in ec_sys.c 2014-01-06 00:13:22 +01:00
event.c netlink: make nlmsg_end() and genlmsg_end() void 2015-01-18 01:03:45 -05:00
fan.c ACPI / Fan: Use bus id as the name for non PNP0C0B (Fan) devices 2014-12-11 00:29:02 +01:00
glue.c ACPI: Introduce has_acpi_companion() 2015-03-16 23:49:08 +01:00
gsi.c ACPI: move arm64 GSI IRQ model to generic GSI IRQ layer 2015-03-26 15:13:09 +00:00
hed.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
int340x_thermal.c ACPI/int340x_thermal: enumerate INT3401 for Intel SoC DTS thermal driver 2015-01-06 08:17:14 +08:00
internal.h ACPI / processor: Request native thermal interrupt handling via _OSC 2016-07-10 23:07:20 -04:00
ioapic.c x86/irq, ACPI: Implement ACPI driver to support IOAPIC hotplug 2015-02-05 15:09:26 +01:00
numa.c ACPI / table: remove duplicate NULL check for the handler of acpi_table_parse() 2015-02-06 01:34:47 +01:00
nvs.c ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem. 2014-05-27 18:13:08 +02:00
osl.c ACPI / osi: Fix an issue that acpi_osi=!* cannot disable ACPICA internal strings 2016-06-03 19:15:46 -04:00
pci_irq.c Revert "x86/PCI: Refine the way to release PCI IRQ resources" 2015-03-20 14:56:19 +01:00
pci_link.c ACPI, PCI: Penalize legacy IRQ used by ACPI SCI 2015-09-21 10:05:44 -07:00
pci_root.c PCI: Don't clear ASPM bits when the FADT declares it's unsupported 2015-04-09 14:20:11 -05:00
pci_slot.c ACPI / PCI: Include appropriate header file in pci_slot.c 2014-01-06 00:13:22 +01:00
power.c ACPI: Remove duplicate definitions of PREFIX 2014-03-19 02:01:57 +01:00
proc.c ACPI / proc: remove unneeded NULL check 2014-02-05 01:06:21 +01:00
processor_core.c ACPI / processor: Make it possible to get CPU hardware ID via GICC 2015-03-26 15:13:07 +00:00
processor_driver.c ACPI / processor: Make acpi_cpu_soft_notify() process CPU FROZEN events 2014-08-06 22:22:03 +02:00
processor_idle.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-04-13 11:08:28 -07:00
processor_pdc.c ACPI / processor: Introduce ARCH_MIGHT_HAVE_ACPI_PDC 2014-07-21 13:50:58 +02:00
processor_perflib.c ACPI / processor: use acpi_evaluate_ost() to replace open-coded version 2014-02-21 00:27:47 +01:00
processor_thermal.c ACPI: correct minor typos 2013-12-07 01:38:45 +01:00
processor_throttling.c ACPI / processor: Rework processor throttling with work_on_cpu() 2014-02-27 00:21:05 +01:00
property.c ACPI / property: Drop size_prop from acpi_dev_get_property_reference() 2014-11-05 20:48:06 +01:00
reboot.c Revert "ACPI: ignore FADT reset-reg-sup flag" 2012-04-20 11:19:35 -07:00
resource.c ACPI / PCI: Fix regressions caused by resource_size_t overflow with 32-bit kernel 2015-08-03 09:29:14 -07:00
sbs.c ACPI / SBS: Enable battery manager when present 2015-04-29 00:04:29 +02:00
sbshc.c ACPI / SBS: Add 5 us delay to fix SBS hangs on MacBook 2015-04-30 23:18:11 +02:00
sbshc.h
scan.c ACPI / scan: Add a scan handler for PRP0001 2015-04-24 02:18:01 +02:00
sleep.c ACPI / PM: Enable all wakeup GPEs in suspend-to-idle 2015-03-30 01:52:02 +02:00
sleep.h ACPI / sleep: Drop acpi_suspend() which is not used 2015-03-18 12:53:21 +01:00
sysfs.c ACPI / sysfs: Treat the count field of counter_show() as unsigned 2015-03-10 01:03:30 +01:00
tables.c ACPI / table: Print GIC information when MADT is parsed 2015-03-25 11:49:31 +00:00
thermal.c Thermal: move the KELVIN_TO_MILLICELSIUS macro to thermal.h 2014-10-10 13:57:15 +08:00
utils.c Merge branches 'acpi-scan', 'acpi-utils' and 'acpi-pm' 2014-12-18 18:42:56 +01:00
video.c ACPI / video: Add force native backlight quirk for Lenovo Ideapad Z570 2015-03-22 22:02:51 +01:00
video_detect.c ACPI: Revert "ACPI / video: Add Dell Inspiron 5737 to the blacklist" 2016-04-13 17:14:25 -04:00
wakeup.c ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00