mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
Merge tag 'acpi-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki:
"These include new ACPICA material, a rework of the ACPI thermal
driver, a switch-over of the ACPI processor driver to using _OSC
instead of (long deprecated) _PDC for CPU initialization, a rework of
firmware notifications handling in several drivers, fixes and cleanups
for suspend-to-idle handling on AMD systems, ACPI backlight driver
updates and more.
Specifics:
- Update the ACPICA code in the kernel to upstream revision 20230628
including the following changes:
- Suppress a GCC 12 dangling-pointer warning (Philip Prindeville)
- Reformat the ACPI_STATE_COMMON macro and its users (George Guo)
- Replace the ternary operator with ACPI_MIN() (Jiangshan Yi)
- Add support for _DSC as per ACPI 6.5 (Saket Dumbre)
- Remove a duplicate macro from zephyr header (Najumon B.A)
- Add data structures for GED and _EVT tracking (Jose Marinho)
- Fix misspelled CDAT DSMAS define (Dave Jiang)
- Simplify an error message in acpi_ds_result_push() (Christophe
Jaillet)
- Add a struct size macro related to SRAT (Dave Jiang)
- Add AML_NO_OPERAND_RESOLVE flag to Timer (Abhishek Mainkar)
- Add support for RISC-V external interrupt controllers in MADT
(Sunil V L)
- Add RHCT flags, CMO and MMU nodes (Sunil V L)
- Change ACPICA version to 20230628 (Bob Moore)
- Introduce new wrappers for ACPICA notify handler install/remove and
convert multiple drivers to using their own Notify() handlers
instead of the ACPI bus type .notify() slated for removal (Michal
Wilczynski)
- Add backlight=native DMI quirk for Apple iMac12,1 and iMac12,2
(Hans de Goede)
- Put ACPI video and its child devices explicitly into D0 on boot to
avoid platform firmware confusion (Kai-Heng Feng)
- Add backlight=native DMI quirk for Lenovo Ideapad Z470 (Jiri Slaby)
- Support obtaining physical CPU ID from MADT on LoongArch (Bibo Mao)
- Convert ACPI CPU initialization to using _OSC instead of _PDC that
has been depreceted since 2018 and dropped from the specification
in ACPI 6.5 (Michal Wilczynski, Rafael Wysocki)
- Drop non-functional nocrt parameter from ACPI thermal (Mario
Limonciello)
- Clean up the ACPI thermal driver, rework the handling of firmware
notifications in it and make it provide a table of generic trip
point structures to the core during initialization (Rafael Wysocki)
- Defer enumeration of devices with _DEP pointing to IVSC (Wentong
Wu)
- Install SystemCMOS address space handler for ACPI000E (TAD) to meet
platform firmware expectations on some platforms (Zhang Rui)
- Fix finding the generic error data in the ACPi extlog driver for
compatibility with old and new firmware interface versions
(Xiaochun Lee)
- Remove assorted unused declarations of functions (Yue Haibing)
- Move AMBA bus scan handling into arm64 specific directory (Sudeep
Holla)
- Fix and clean up suspend-to-idle interface for AMD systems (Mario
Limonciello, Andy Shevchenko)
- Fix string truncation warning in pnpacpi_add_device() (Sunil V L)"
* tag 'acpi-6.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (66 commits)
ACPI: x86: s2idle: Add a function to get LPS0 constraint for a device
ACPI: x86: s2idle: Add for_each_lpi_constraint() helper
ACPI: x86: s2idle: Add more debugging for AMD constraints parsing
ACPI: x86: s2idle: Fix a logic error parsing AMD constraints table
ACPI: x86: s2idle: Catch multiple ACPI_TYPE_PACKAGE objects
ACPI: x86: s2idle: Post-increment variables when getting constraints
ACPI: Adjust #ifdef for *_lps0_dev use
ACPI: TAD: Install SystemCMOS address space handler for ACPI000E
ACPI: Remove assorted unused declarations of functions
ACPI: extlog: Fix finding the generic error data for v3 structure
PNP: ACPI: Fix string truncation warning
ACPI: Remove unused extern declaration acpi_paddr_to_node()
ACPI: video: Add backlight=native DMI quirk for Apple iMac12,1 and iMac12,2
ACPI: video: Put ACPI video and its child devices into D0 on boot
ACPI: processor: LoongArch: Get physical ID from MADT
ACPI: scan: Defer enumeration of devices with a _DEP pointing to IVSC device
ACPI: thermal: Eliminate code duplication from acpi_thermal_notify()
ACPI: thermal: Drop unnecessary thermal zone callbacks
ACPI: thermal: Rework thermal_get_trend()
ACPI: thermal: Use trip point table to register thermal zones
...
This commit is contained in:
@@ -6333,10 +6333,6 @@
|
||||
-1: disable all critical trip points in all thermal zones
|
||||
<degrees C>: override all critical trip points
|
||||
|
||||
thermal.nocrt= [HW,ACPI]
|
||||
Set to disable actions on ACPI thermal zone
|
||||
critical and hot trip points.
|
||||
|
||||
thermal.off= [HW,ACPI]
|
||||
1: disable ACPI thermal control
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <acpi/pdc_intel.h>
|
||||
#include <acpi/proc_cap_intel.h>
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/numa.h>
|
||||
@@ -69,9 +69,9 @@ extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
|
||||
#endif
|
||||
|
||||
static inline bool arch_has_acpi_pdc(void) { return true; }
|
||||
static inline void arch_acpi_set_pdc_bits(u32 *buf)
|
||||
static inline void arch_acpi_set_proc_cap_bits(u32 *cap)
|
||||
{
|
||||
buf[2] |= ACPI_PDC_EST_CAPABILITY_SMP;
|
||||
*cap |= ACPI_PROC_CAP_EST_CAPABILITY_SMP;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
||||
* Copyright (C) 2001 Patrick Mochel <mochel@osdl.org>
|
||||
*/
|
||||
#include <acpi/pdc_intel.h>
|
||||
#include <acpi/proc_cap_intel.h>
|
||||
|
||||
#include <asm/numa.h>
|
||||
#include <asm/fixmap.h>
|
||||
@@ -102,23 +102,31 @@ static inline bool arch_has_acpi_pdc(void)
|
||||
c->x86_vendor == X86_VENDOR_CENTAUR);
|
||||
}
|
||||
|
||||
static inline void arch_acpi_set_pdc_bits(u32 *buf)
|
||||
static inline void arch_acpi_set_proc_cap_bits(u32 *cap)
|
||||
{
|
||||
struct cpuinfo_x86 *c = &cpu_data(0);
|
||||
|
||||
buf[2] |= ACPI_PDC_C_CAPABILITY_SMP;
|
||||
*cap |= ACPI_PROC_CAP_C_CAPABILITY_SMP;
|
||||
|
||||
/* Enable coordination with firmware's _TSD info */
|
||||
*cap |= ACPI_PROC_CAP_SMP_T_SWCOORD;
|
||||
|
||||
if (cpu_has(c, X86_FEATURE_EST))
|
||||
buf[2] |= ACPI_PDC_EST_CAPABILITY_SWSMP;
|
||||
*cap |= ACPI_PROC_CAP_EST_CAPABILITY_SWSMP;
|
||||
|
||||
if (cpu_has(c, X86_FEATURE_ACPI))
|
||||
buf[2] |= ACPI_PDC_T_FFH;
|
||||
*cap |= ACPI_PROC_CAP_T_FFH;
|
||||
|
||||
if (cpu_has(c, X86_FEATURE_HWP))
|
||||
*cap |= ACPI_PROC_CAP_COLLAB_PROC_PERF;
|
||||
|
||||
/*
|
||||
* If mwait/monitor is unsupported, C2/C3_FFH will be disabled
|
||||
* If mwait/monitor is unsupported, C_C1_FFH and
|
||||
* C2/C3_FFH will be disabled.
|
||||
*/
|
||||
if (!cpu_has(c, X86_FEATURE_MWAIT))
|
||||
buf[2] &= ~(ACPI_PDC_C_C2C3_FFH);
|
||||
if (!cpu_has(c, X86_FEATURE_MWAIT) ||
|
||||
boot_option_idle_override == IDLE_NOMWAIT)
|
||||
*cap &= ~(ACPI_PROC_CAP_C_C1_FFH | ACPI_PROC_CAP_C_C2C3_FFH);
|
||||
}
|
||||
|
||||
static inline bool acpi_has_cpu_in_madt(void)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
#ifdef CONFIG_ACPI
|
||||
#include <linux/acpi.h>
|
||||
#include <asm/acpi.h>
|
||||
#include <acpi/pdc_intel.h>
|
||||
#include <acpi/proc_cap_intel.h>
|
||||
#include <acpi/processor.h>
|
||||
#include <xen/interface/platform.h>
|
||||
#endif
|
||||
@@ -288,17 +288,17 @@ static bool __init xen_check_mwait(void)
|
||||
|
||||
native_cpuid(&ax, &bx, &cx, &dx);
|
||||
|
||||
/* Ask the Hypervisor whether to clear ACPI_PDC_C_C2C3_FFH. If so,
|
||||
/* Ask the Hypervisor whether to clear ACPI_PROC_CAP_C_C2C3_FFH. If so,
|
||||
* don't expose MWAIT_LEAF and let ACPI pick the IOPORT version of C3.
|
||||
*/
|
||||
buf[0] = ACPI_PDC_REVISION_ID;
|
||||
buf[1] = 1;
|
||||
buf[2] = (ACPI_PDC_C_CAPABILITY_SMP | ACPI_PDC_EST_CAPABILITY_SWSMP);
|
||||
buf[2] = (ACPI_PROC_CAP_C_CAPABILITY_SMP | ACPI_PROC_CAP_EST_CAPABILITY_SWSMP);
|
||||
|
||||
set_xen_guest_handle(op.u.set_pminfo.pdc, buf);
|
||||
|
||||
if ((HYPERVISOR_platform_op(&op) == 0) &&
|
||||
(buf[2] & (ACPI_PDC_C_C1_FFH | ACPI_PDC_C_C2C3_FFH))) {
|
||||
(buf[2] & (ACPI_PROC_CAP_C_C1_FFH | ACPI_PROC_CAP_C_C2C3_FFH))) {
|
||||
cpuid_leaf5_ecx_val = cx;
|
||||
cpuid_leaf5_edx_val = dx;
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ acpi-$(CONFIG_PCI) += acpi_lpss.o
|
||||
acpi-y += acpi_apd.o
|
||||
acpi-y += acpi_platform.o
|
||||
acpi-y += acpi_pnp.o
|
||||
acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
|
||||
acpi-y += power.o
|
||||
acpi-y += event.o
|
||||
acpi-y += evged.o
|
||||
|
||||
@@ -34,7 +34,7 @@ MODULE_LICENSE("GPL");
|
||||
|
||||
static int acpi_ac_add(struct acpi_device *device);
|
||||
static void acpi_ac_remove(struct acpi_device *device);
|
||||
static void acpi_ac_notify(struct acpi_device *device, u32 event);
|
||||
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data);
|
||||
|
||||
static const struct acpi_device_id ac_device_ids[] = {
|
||||
{"ACPI0003", 0},
|
||||
@@ -54,11 +54,9 @@ static struct acpi_driver acpi_ac_driver = {
|
||||
.name = "ac",
|
||||
.class = ACPI_AC_CLASS,
|
||||
.ids = ac_device_ids,
|
||||
.flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS,
|
||||
.ops = {
|
||||
.add = acpi_ac_add,
|
||||
.remove = acpi_ac_remove,
|
||||
.notify = acpi_ac_notify,
|
||||
},
|
||||
.drv.pm = &acpi_ac_pm,
|
||||
};
|
||||
@@ -128,8 +126,9 @@ static enum power_supply_property ac_props[] = {
|
||||
};
|
||||
|
||||
/* Driver Model */
|
||||
static void acpi_ac_notify(struct acpi_device *device, u32 event)
|
||||
static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
|
||||
{
|
||||
struct acpi_device *device = data;
|
||||
struct acpi_ac *ac = acpi_driver_data(device);
|
||||
|
||||
if (!ac)
|
||||
@@ -235,7 +234,7 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||
|
||||
result = acpi_ac_get_state(ac);
|
||||
if (result)
|
||||
goto end;
|
||||
goto err_release_ac;
|
||||
|
||||
psy_cfg.drv_data = ac;
|
||||
|
||||
@@ -248,7 +247,7 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||
&ac->charger_desc, &psy_cfg);
|
||||
if (IS_ERR(ac->charger)) {
|
||||
result = PTR_ERR(ac->charger);
|
||||
goto end;
|
||||
goto err_release_ac;
|
||||
}
|
||||
|
||||
pr_info("%s [%s] (%s)\n", acpi_device_name(device),
|
||||
@@ -256,9 +255,19 @@ static int acpi_ac_add(struct acpi_device *device)
|
||||
|
||||
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
|
||||
register_acpi_notifier(&ac->battery_nb);
|
||||
end:
|
||||
|
||||
result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
|
||||
acpi_ac_notify);
|
||||
if (result)
|
||||
kfree(ac);
|
||||
goto err_unregister;
|
||||
|
||||
return 0;
|
||||
|
||||
err_unregister:
|
||||
power_supply_unregister(ac->charger);
|
||||
unregister_acpi_notifier(&ac->battery_nb);
|
||||
err_release_ac:
|
||||
kfree(ac);
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -297,6 +306,8 @@ static void acpi_ac_remove(struct acpi_device *device)
|
||||
|
||||
ac = acpi_driver_data(device);
|
||||
|
||||
acpi_dev_remove_notify_handler(device, ACPI_ALL_NOTIFY,
|
||||
acpi_ac_notify);
|
||||
power_supply_unregister(ac->charger);
|
||||
unregister_acpi_notifier(&ac->battery_nb);
|
||||
|
||||
|
||||
@@ -51,12 +51,11 @@ acpi_cmos_rtc_space_handler(u32 function, acpi_physical_address address,
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
|
||||
const struct acpi_device_id *id)
|
||||
int acpi_install_cmos_rtc_space_handler(acpi_handle handle)
|
||||
{
|
||||
acpi_status status;
|
||||
|
||||
status = acpi_install_address_space_handler(adev->handle,
|
||||
status = acpi_install_address_space_handler(handle,
|
||||
ACPI_ADR_SPACE_CMOS,
|
||||
&acpi_cmos_rtc_space_handler,
|
||||
NULL, NULL);
|
||||
@@ -67,18 +66,30 @@ static int acpi_install_cmos_rtc_space_handler(struct acpi_device *adev,
|
||||
|
||||
return 1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_install_cmos_rtc_space_handler);
|
||||
|
||||
static void acpi_remove_cmos_rtc_space_handler(struct acpi_device *adev)
|
||||
void acpi_remove_cmos_rtc_space_handler(acpi_handle handle)
|
||||
{
|
||||
if (ACPI_FAILURE(acpi_remove_address_space_handler(adev->handle,
|
||||
if (ACPI_FAILURE(acpi_remove_address_space_handler(handle,
|
||||
ACPI_ADR_SPACE_CMOS, &acpi_cmos_rtc_space_handler)))
|
||||
pr_err("Error removing CMOS-RTC region handler\n");
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(acpi_remove_cmos_rtc_space_handler);
|
||||
|
||||
static int acpi_cmos_rtc_attach_handler(struct acpi_device *adev, const struct acpi_device_id *id)
|
||||
{
|
||||
return acpi_install_cmos_rtc_space_handler(adev->handle);
|
||||
}
|
||||
|
||||
static void acpi_cmos_rtc_detach_handler(struct acpi_device *adev)
|
||||
{
|
||||
acpi_remove_cmos_rtc_space_handler(adev->handle);
|
||||
}
|
||||
|
||||
static struct acpi_scan_handler cmos_rtc_handler = {
|
||||
.ids = acpi_cmos_rtc_ids,
|
||||
.attach = acpi_install_cmos_rtc_space_handler,
|
||||
.detach = acpi_remove_cmos_rtc_space_handler,
|
||||
.attach = acpi_cmos_rtc_attach_handler,
|
||||
.detach = acpi_cmos_rtc_detach_handler,
|
||||
};
|
||||
|
||||
void __init acpi_cmos_rtc_init(void)
|
||||
|
||||
@@ -172,7 +172,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
|
||||
fru_text = "";
|
||||
sec_type = (guid_t *)gdata->section_type;
|
||||
if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) {
|
||||
struct cper_sec_mem_err *mem = (void *)(gdata + 1);
|
||||
struct cper_sec_mem_err *mem = acpi_hest_get_payload(gdata);
|
||||
|
||||
if (gdata->error_data_length >= sizeof(*mem))
|
||||
trace_extlog_mem_event(mem, err_seq, fru_id, fru_text,
|
||||
|
||||
@@ -9,9 +9,11 @@
|
||||
* Copyright (C) 2013, Intel Corporation
|
||||
* Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
*/
|
||||
#define pr_fmt(fmt) "ACPI: " fmt
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/pci.h>
|
||||
@@ -21,6 +23,8 @@
|
||||
|
||||
#include <asm/cpu.h>
|
||||
|
||||
#include <xen/xen.h>
|
||||
|
||||
#include "internal.h"
|
||||
|
||||
DEFINE_PER_CPU(struct acpi_processor *, processors);
|
||||
@@ -508,54 +512,110 @@ static void acpi_processor_remove(struct acpi_device *device)
|
||||
}
|
||||
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
|
||||
|
||||
#ifdef CONFIG_X86
|
||||
static bool acpi_hwp_native_thermal_lvt_set;
|
||||
static acpi_status __init acpi_hwp_native_thermal_lvt_osc(acpi_handle handle,
|
||||
u32 lvl,
|
||||
void *context,
|
||||
void **rv)
|
||||
#ifdef CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC
|
||||
bool __init processor_physically_present(acpi_handle handle)
|
||||
{
|
||||
u8 sb_uuid_str[] = "4077A616-290C-47BE-9EBD-D87058713953";
|
||||
u32 capbuf[2];
|
||||
int cpuid, type;
|
||||
u32 acpi_id;
|
||||
acpi_status status;
|
||||
acpi_object_type acpi_type;
|
||||
unsigned long long tmp;
|
||||
union acpi_object object = {};
|
||||
struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
|
||||
|
||||
status = acpi_get_type(handle, &acpi_type);
|
||||
if (ACPI_FAILURE(status))
|
||||
return false;
|
||||
|
||||
switch (acpi_type) {
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
|
||||
if (ACPI_FAILURE(status))
|
||||
return false;
|
||||
acpi_id = object.processor.proc_id;
|
||||
break;
|
||||
case ACPI_TYPE_DEVICE:
|
||||
status = acpi_evaluate_integer(handle, METHOD_NAME__UID,
|
||||
NULL, &tmp);
|
||||
if (ACPI_FAILURE(status))
|
||||
return false;
|
||||
acpi_id = tmp;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (xen_initial_domain())
|
||||
/*
|
||||
* When running as a Xen dom0 the number of processors Linux
|
||||
* sees can be different from the real number of processors on
|
||||
* the system, and we still need to execute _PDC or _OSC for
|
||||
* all of them.
|
||||
*/
|
||||
return xen_processor_present(acpi_id);
|
||||
|
||||
type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
|
||||
cpuid = acpi_get_cpuid(handle, type, acpi_id);
|
||||
|
||||
return !invalid_logical_cpuid(cpuid);
|
||||
}
|
||||
|
||||
/* vendor specific UUID indicating an Intel platform */
|
||||
static u8 sb_uuid_str[] = "4077A616-290C-47BE-9EBD-D87058713953";
|
||||
|
||||
static acpi_status __init acpi_processor_osc(acpi_handle handle, u32 lvl,
|
||||
void *context, void **rv)
|
||||
{
|
||||
u32 capbuf[2] = {};
|
||||
struct acpi_osc_context osc_context = {
|
||||
.uuid_str = sb_uuid_str,
|
||||
.rev = 1,
|
||||
.cap.length = 8,
|
||||
.cap.pointer = capbuf,
|
||||
};
|
||||
acpi_status status;
|
||||
|
||||
if (acpi_hwp_native_thermal_lvt_set)
|
||||
return AE_CTRL_TERMINATE;
|
||||
if (!processor_physically_present(handle))
|
||||
return AE_OK;
|
||||
|
||||
capbuf[0] = 0x0000;
|
||||
capbuf[1] = 0x1000; /* set bit 12 */
|
||||
arch_acpi_set_proc_cap_bits(&capbuf[OSC_SUPPORT_DWORD]);
|
||||
|
||||
if (ACPI_SUCCESS(acpi_run_osc(handle, &osc_context))) {
|
||||
if (osc_context.ret.pointer && osc_context.ret.length > 1) {
|
||||
u32 *capbuf_ret = osc_context.ret.pointer;
|
||||
status = acpi_run_osc(handle, &osc_context);
|
||||
if (ACPI_FAILURE(status))
|
||||
return status;
|
||||
|
||||
if (capbuf_ret[1] & 0x1000) {
|
||||
acpi_handle_info(handle,
|
||||
"_OSC native thermal LVT Acked\n");
|
||||
acpi_hwp_native_thermal_lvt_set = true;
|
||||
}
|
||||
}
|
||||
kfree(osc_context.ret.pointer);
|
||||
}
|
||||
kfree(osc_context.ret.pointer);
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
void __init acpi_early_processor_osc(void)
|
||||
static bool __init acpi_early_processor_osc(void)
|
||||
{
|
||||
if (boot_cpu_has(X86_FEATURE_HWP)) {
|
||||
acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX,
|
||||
acpi_hwp_native_thermal_lvt_osc,
|
||||
NULL, NULL, NULL);
|
||||
acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID,
|
||||
acpi_hwp_native_thermal_lvt_osc,
|
||||
NULL, NULL);
|
||||
acpi_status status;
|
||||
|
||||
acpi_proc_quirk_mwait_check();
|
||||
|
||||
status = acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX, acpi_processor_osc, NULL,
|
||||
NULL, NULL);
|
||||
if (ACPI_FAILURE(status))
|
||||
return false;
|
||||
|
||||
status = acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, acpi_processor_osc,
|
||||
NULL, NULL);
|
||||
if (ACPI_FAILURE(status))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void __init acpi_early_processor_control_setup(void)
|
||||
{
|
||||
if (acpi_early_processor_osc()) {
|
||||
pr_info("_OSC evaluated successfully for all CPUs\n");
|
||||
} else {
|
||||
pr_info("_OSC evaluation for CPUs failed, trying _PDC\n");
|
||||
acpi_early_processor_set_pdc();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -557,6 +557,7 @@ static int acpi_tad_disable_timer(struct device *dev, u32 timer_id)
|
||||
static int acpi_tad_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
acpi_handle handle = ACPI_HANDLE(dev);
|
||||
struct acpi_tad_driver_data *dd = dev_get_drvdata(dev);
|
||||
|
||||
device_init_wakeup(dev, false);
|
||||
@@ -577,6 +578,7 @@ static int acpi_tad_remove(struct platform_device *pdev)
|
||||
|
||||
pm_runtime_put_sync(dev);
|
||||
pm_runtime_disable(dev);
|
||||
acpi_remove_cmos_rtc_space_handler(handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -589,6 +591,11 @@ static int acpi_tad_probe(struct platform_device *pdev)
|
||||
unsigned long long caps;
|
||||
int ret;
|
||||
|
||||
ret = acpi_install_cmos_rtc_space_handler(handle);
|
||||
if (ret < 0) {
|
||||
dev_info(dev, "Unable to install space handler\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
/*
|
||||
* Initialization failure messages are mostly about firmware issues, so
|
||||
* print them at the "info" level.
|
||||
@@ -596,22 +603,27 @@ static int acpi_tad_probe(struct platform_device *pdev)
|
||||
status = acpi_evaluate_integer(handle, "_GCP", NULL, &caps);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
dev_info(dev, "Unable to get capabilities\n");
|
||||
return -ENODEV;
|
||||
ret = -ENODEV;
|
||||
goto remove_handler;
|
||||
}
|
||||
|
||||
if (!(caps & ACPI_TAD_AC_WAKE)) {
|
||||
dev_info(dev, "Unsupported capabilities\n");
|
||||
return -ENODEV;
|
||||
ret = -ENODEV;
|
||||
goto remove_handler;
|
||||
}
|
||||
|
||||
if (!acpi_has_method(handle, "_PRW")) {
|
||||
dev_info(dev, "Missing _PRW\n");
|
||||
return -ENODEV;
|
||||
ret = -ENODEV;
|
||||
goto remove_handler;
|
||||
}
|
||||
|
||||
dd = devm_kzalloc(dev, sizeof(*dd), GFP_KERNEL);
|
||||
if (!dd)
|
||||
return -ENOMEM;
|
||||
if (!dd) {
|
||||
ret = -ENOMEM;
|
||||
goto remove_handler;
|
||||
}
|
||||
|
||||
dd->capabilities = caps;
|
||||
dev_set_drvdata(dev, dd);
|
||||
@@ -653,6 +665,11 @@ static int acpi_tad_probe(struct platform_device *pdev)
|
||||
|
||||
fail:
|
||||
acpi_tad_remove(pdev);
|
||||
/* Don't fallthrough because cmos rtc space handler is removed in acpi_tad_remove() */
|
||||
return ret;
|
||||
|
||||
remove_handler:
|
||||
acpi_remove_cmos_rtc_space_handler(handle);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ static DEFINE_MUTEX(video_list_lock);
|
||||
static LIST_HEAD(video_bus_head);
|
||||
static int acpi_video_bus_add(struct acpi_device *device);
|
||||
static void acpi_video_bus_remove(struct acpi_device *device);
|
||||
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
|
||||
static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data);
|
||||
|
||||
/*
|
||||
* Indices in the _BCL method response: the first two items are special,
|
||||
@@ -104,7 +104,6 @@ static struct acpi_driver acpi_video_bus = {
|
||||
.ops = {
|
||||
.add = acpi_video_bus_add,
|
||||
.remove = acpi_video_bus_remove,
|
||||
.notify = acpi_video_bus_notify,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1527,8 +1526,9 @@ static int acpi_video_bus_stop_devices(struct acpi_video_bus *video)
|
||||
acpi_osi_is_win8() ? 0 : 1);
|
||||
}
|
||||
|
||||
static void acpi_video_bus_notify(struct acpi_device *device, u32 event)
|
||||
static void acpi_video_bus_notify(acpi_handle handle, u32 event, void *data)
|
||||
{
|
||||
struct acpi_device *device = data;
|
||||
struct acpi_video_bus *video = acpi_driver_data(device);
|
||||
struct input_dev *input;
|
||||
int keycode = 0;
|
||||
@@ -2027,6 +2027,12 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
||||
if (error)
|
||||
goto err_put_video;
|
||||
|
||||
/*
|
||||
* HP ZBook Fury 16 G10 requires ACPI video's child devices have _PS0
|
||||
* evaluated to have functional panel brightness control.
|
||||
*/
|
||||
acpi_device_fix_up_power_extended(device);
|
||||
|
||||
pr_info("%s [%s] (multi-head: %s rom: %s post: %s)\n",
|
||||
ACPI_VIDEO_DEVICE_NAME, acpi_device_bid(device),
|
||||
video->flags.multihead ? "yes" : "no",
|
||||
@@ -2053,8 +2059,19 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
||||
|
||||
acpi_video_bus_add_notify_handler(video);
|
||||
|
||||
error = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
acpi_video_bus_notify);
|
||||
if (error)
|
||||
goto err_remove;
|
||||
|
||||
return 0;
|
||||
|
||||
err_remove:
|
||||
mutex_lock(&video_list_lock);
|
||||
list_del(&video->entry);
|
||||
mutex_unlock(&video_list_lock);
|
||||
acpi_video_bus_remove_notify_handler(video);
|
||||
acpi_video_bus_unregister_backlight(video);
|
||||
err_put_video:
|
||||
acpi_video_bus_put_devices(video);
|
||||
kfree(video->attached_array);
|
||||
@@ -2075,6 +2092,9 @@ static void acpi_video_bus_remove(struct acpi_device *device)
|
||||
|
||||
video = acpi_driver_data(device);
|
||||
|
||||
acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
|
||||
acpi_video_bus_notify);
|
||||
|
||||
mutex_lock(&video_list_lock);
|
||||
list_del(&video->entry);
|
||||
mutex_unlock(&video_list_lock);
|
||||
|
||||
@@ -287,4 +287,6 @@ struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
|
||||
|
||||
void acpi_db_uint32_to_hex_string(u32 value, char *buffer);
|
||||
|
||||
void acpi_db_generate_interrupt(char *gsiv_arg);
|
||||
|
||||
#endif /* __ACDEBUG_H__ */
|
||||
|
||||
@@ -129,6 +129,7 @@ ACPI_GLOBAL(acpi_table_handler, acpi_gbl_table_handler);
|
||||
ACPI_GLOBAL(void *, acpi_gbl_table_handler_context);
|
||||
ACPI_GLOBAL(acpi_interface_handler, acpi_gbl_interface_handler);
|
||||
ACPI_GLOBAL(struct acpi_sci_handler_info *, acpi_gbl_sci_handler_list);
|
||||
ACPI_GLOBAL(struct acpi_ged_handler_info *, acpi_gbl_ged_handler_list);
|
||||
|
||||
/* Owner ID support */
|
||||
|
||||
|
||||
@@ -543,6 +543,14 @@ struct acpi_field_info {
|
||||
u32 pkg_length;
|
||||
};
|
||||
|
||||
/* Information about the interrupt ID and _EVT of a GED device */
|
||||
|
||||
struct acpi_ged_handler_info {
|
||||
struct acpi_ged_handler_info *next;
|
||||
u32 int_id; /* The interrupt ID that triggers the execution ofthe evt_method. */
|
||||
struct acpi_namespace_node *evt_method; /* The _EVT method to be executed when an interrupt with ID = int_ID is received */
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Generic "state" object for stacks
|
||||
@@ -560,25 +568,28 @@ struct acpi_field_info {
|
||||
u8 descriptor_type; /* To differentiate various internal objs */\
|
||||
u8 flags; \
|
||||
u16 value; \
|
||||
u16 state;
|
||||
u16 state
|
||||
|
||||
/* There are 2 bytes available here until the next natural alignment boundary */
|
||||
|
||||
struct acpi_common_state {
|
||||
ACPI_STATE_COMMON};
|
||||
ACPI_STATE_COMMON;
|
||||
};
|
||||
|
||||
/*
|
||||
* Update state - used to traverse complex objects such as packages
|
||||
*/
|
||||
struct acpi_update_state {
|
||||
ACPI_STATE_COMMON union acpi_operand_object *object;
|
||||
ACPI_STATE_COMMON;
|
||||
union acpi_operand_object *object;
|
||||
};
|
||||
|
||||
/*
|
||||
* Pkg state - used to traverse nested package structures
|
||||
*/
|
||||
struct acpi_pkg_state {
|
||||
ACPI_STATE_COMMON u32 index;
|
||||
ACPI_STATE_COMMON;
|
||||
u32 index;
|
||||
union acpi_operand_object *source_object;
|
||||
union acpi_operand_object *dest_object;
|
||||
struct acpi_walk_state *walk_state;
|
||||
@@ -591,7 +602,8 @@ struct acpi_pkg_state {
|
||||
* Allows nesting of these constructs
|
||||
*/
|
||||
struct acpi_control_state {
|
||||
ACPI_STATE_COMMON u16 opcode;
|
||||
ACPI_STATE_COMMON;
|
||||
u16 opcode;
|
||||
union acpi_parse_object *predicate_op;
|
||||
u8 *aml_predicate_start; /* Start of if/while predicate */
|
||||
u8 *package_end; /* End of if/while block */
|
||||
@@ -602,11 +614,13 @@ struct acpi_control_state {
|
||||
* Scope state - current scope during namespace lookups
|
||||
*/
|
||||
struct acpi_scope_state {
|
||||
ACPI_STATE_COMMON struct acpi_namespace_node *node;
|
||||
ACPI_STATE_COMMON;
|
||||
struct acpi_namespace_node *node;
|
||||
};
|
||||
|
||||
struct acpi_pscope_state {
|
||||
ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */
|
||||
ACPI_STATE_COMMON;
|
||||
u32 arg_count; /* Number of fixed arguments */
|
||||
union acpi_parse_object *op; /* Current op being parsed */
|
||||
u8 *arg_end; /* Current argument end */
|
||||
u8 *pkg_end; /* Current package end */
|
||||
@@ -618,7 +632,8 @@ struct acpi_pscope_state {
|
||||
* states are created when there are nested control methods executing.
|
||||
*/
|
||||
struct acpi_thread_state {
|
||||
ACPI_STATE_COMMON u8 current_sync_level; /* Mutex Sync (nested acquire) level */
|
||||
ACPI_STATE_COMMON;
|
||||
u8 current_sync_level; /* Mutex Sync (nested acquire) level */
|
||||
struct acpi_walk_state *walk_state_list; /* Head of list of walk_states for this thread */
|
||||
union acpi_operand_object *acquired_mutex_list; /* List of all currently acquired mutexes */
|
||||
acpi_thread_id thread_id; /* Running thread ID */
|
||||
@@ -629,8 +644,8 @@ struct acpi_thread_state {
|
||||
* AML arguments
|
||||
*/
|
||||
struct acpi_result_values {
|
||||
ACPI_STATE_COMMON
|
||||
union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
|
||||
ACPI_STATE_COMMON;
|
||||
union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
|
||||
};
|
||||
|
||||
typedef
|
||||
@@ -652,7 +667,8 @@ struct acpi_global_notify_handler {
|
||||
* handler/dispatcher.
|
||||
*/
|
||||
struct acpi_notify_info {
|
||||
ACPI_STATE_COMMON u8 handler_list_id;
|
||||
ACPI_STATE_COMMON;
|
||||
u8 handler_list_id;
|
||||
struct acpi_namespace_node *node;
|
||||
union acpi_operand_object *handler_list_head;
|
||||
struct acpi_global_notify_handler *global;
|
||||
|
||||
@@ -440,6 +440,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
|
||||
{{"_DOS", METHOD_1ARGS(ACPI_TYPE_INTEGER),
|
||||
METHOD_NO_RETURN_VALUE}},
|
||||
|
||||
{{"_DSC", METHOD_0ARGS,
|
||||
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
{{"_DSD", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
|
||||
PACKAGE_INFO(ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1,
|
||||
|
||||
@@ -1010,6 +1010,64 @@ void acpi_db_display_resources(char *object_arg)
|
||||
acpi_db_set_output_destination(ACPI_DB_CONSOLE_OUTPUT);
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_db_generate_ged
|
||||
*
|
||||
* PARAMETERS: ged_arg - Raw GED number, ascii string
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Simulate firing of a GED
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void acpi_db_generate_interrupt(char *gsiv_arg)
|
||||
{
|
||||
u32 gsiv_number;
|
||||
struct acpi_ged_handler_info *ged_info = acpi_gbl_ged_handler_list;
|
||||
|
||||
if (!ged_info) {
|
||||
acpi_os_printf("No GED handling present\n");
|
||||
}
|
||||
|
||||
gsiv_number = strtoul(gsiv_arg, NULL, 0);
|
||||
|
||||
while (ged_info) {
|
||||
|
||||
if (ged_info->int_id == gsiv_number) {
|
||||
struct acpi_object_list arg_list;
|
||||
union acpi_object arg0;
|
||||
acpi_handle evt_handle = ged_info->evt_method;
|
||||
acpi_status status;
|
||||
|
||||
acpi_os_printf("Evaluate GED _EVT (GSIV=%d)\n",
|
||||
gsiv_number);
|
||||
|
||||
if (!evt_handle) {
|
||||
acpi_os_printf("Undefined _EVT method\n");
|
||||
return;
|
||||
}
|
||||
|
||||
arg0.integer.type = ACPI_TYPE_INTEGER;
|
||||
arg0.integer.value = gsiv_number;
|
||||
|
||||
arg_list.count = 1;
|
||||
arg_list.pointer = &arg0;
|
||||
|
||||
status =
|
||||
acpi_evaluate_object(evt_handle, NULL, &arg_list,
|
||||
NULL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_os_printf("Could not evaluate _EVT\n");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
ged_info = ged_info->next;
|
||||
}
|
||||
}
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
||||
@@ -106,6 +106,7 @@ enum acpi_ex_debugger_commands {
|
||||
CMD_THREADS,
|
||||
|
||||
CMD_TEST,
|
||||
CMD_INTERRUPT,
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -185,6 +186,7 @@ static const struct acpi_db_command_info acpi_gbl_db_commands[] = {
|
||||
{"THREADS", 3},
|
||||
|
||||
{"TEST", 1},
|
||||
{"INTERRUPT", 1},
|
||||
#endif
|
||||
{NULL, 0}
|
||||
};
|
||||
@@ -318,6 +320,7 @@ static const struct acpi_db_command_help acpi_gbl_db_command_help[] = {
|
||||
{1, " Gpes", "Display info on all GPE devices\n"},
|
||||
{1, " Sci", "Generate an SCI\n"},
|
||||
{1, " Sleep [SleepState]", "Simulate sleep/wake sequence(s) (0-5)\n"},
|
||||
{1, " Interrupt <GSIV>", "Simulate an interrupt\n"},
|
||||
#endif
|
||||
{0, NULL, NULL}
|
||||
};
|
||||
@@ -1064,6 +1067,11 @@ acpi_db_command_dispatch(char *input_buffer,
|
||||
acpi_os_printf("Event command not implemented\n");
|
||||
break;
|
||||
|
||||
case CMD_INTERRUPT:
|
||||
|
||||
acpi_db_generate_interrupt(acpi_gbl_db_args[1]);
|
||||
break;
|
||||
|
||||
case CMD_GPE:
|
||||
|
||||
acpi_db_generate_gpe(acpi_gbl_db_args[1], acpi_gbl_db_args[2]);
|
||||
|
||||
@@ -146,8 +146,8 @@ acpi_ds_result_push(union acpi_operand_object *object,
|
||||
|
||||
if (!object) {
|
||||
ACPI_ERROR((AE_INFO,
|
||||
"Null Object! Obj=%p State=%p Num=%u",
|
||||
object, walk_state, walk_state->result_count));
|
||||
"Null Object! State=%p Num=%u",
|
||||
walk_state, walk_state->result_count));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
|
||||
@@ -343,8 +343,7 @@ acpi_ex_write_serial_bus(union acpi_operand_object *source_desc,
|
||||
/* Copy the input buffer data to the transfer buffer */
|
||||
|
||||
buffer = buffer_desc->buffer.pointer;
|
||||
data_length = (buffer_length < source_desc->buffer.length ?
|
||||
buffer_length : source_desc->buffer.length);
|
||||
data_length = ACPI_MIN(buffer_length, source_desc->buffer.length);
|
||||
memcpy(buffer, source_desc->buffer.pointer, data_length);
|
||||
|
||||
/* Lock entire transaction if requested */
|
||||
|
||||
@@ -603,7 +603,7 @@ const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
|
||||
|
||||
/* 7E */ ACPI_OP("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY,
|
||||
AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R,
|
||||
AML_FLAGS_EXEC_0A_0T_1R),
|
||||
AML_FLAGS_EXEC_0A_0T_1R | AML_NO_OPERAND_RESOLVE),
|
||||
|
||||
/* ACPI 5.0 opcodes */
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user