mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 02:12:00 -04:00
Merge branches 'acpi-processor', 'acpi-cppc', 'acpi-apei' and 'acpi-sleep'
* acpi-processor:
ACPI: enable ACPI_PROCESSOR_IDLE on ARM64
arm64: add support for ACPI Low Power Idle(LPI)
drivers: firmware: psci: initialise idle states using ACPI LPI
cpuidle: introduce CPU_PM_CPU_IDLE_ENTER macro for ARM{32, 64}
arm64: cpuidle: drop __init section marker to arm_cpuidle_init
ACPI / processor_idle: Add support for Low Power Idle(LPI) states
ACPI / processor_idle: introduce ACPI_PROCESSOR_CSTATE
* acpi-cppc:
mailbox: pcc: Add PCC request and free channel declarations
ACPI / CPPC: Prevent cpc_desc_ptr points to the invalid data
ACPI: CPPC: Return error if _CPC is invalid on a CPU
* acpi-apei:
ACPI / APEI: Add Boot Error Record Table (BERT) support
ACPI / einj: Make error paths more talkative
ACPI / einj: Convert EINJ_PFX to proper pr_fmt
* acpi-sleep:
ACPI: Execute _PTS before system reboot
This commit is contained in:
@@ -15,10 +15,9 @@
|
||||
#define _CPPC_ACPI_H
|
||||
|
||||
#include <linux/acpi.h>
|
||||
#include <linux/mailbox_controller.h>
|
||||
#include <linux/mailbox_client.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <acpi/pcc.h>
|
||||
#include <acpi/processor.h>
|
||||
|
||||
/* Only support CPPCv2 for now. */
|
||||
@@ -130,8 +129,4 @@ extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
|
||||
extern int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps);
|
||||
extern int acpi_get_psd_map(struct cpudata **);
|
||||
|
||||
/* Methods to interact with the PCC mailbox controller. */
|
||||
extern struct mbox_chan *
|
||||
pcc_mbox_request_channel(struct mbox_client *, unsigned int);
|
||||
|
||||
#endif /* _CPPC_ACPI_H*/
|
||||
|
||||
29
include/acpi/pcc.h
Normal file
29
include/acpi/pcc.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* PCC (Platform Communications Channel) methods
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; version 2
|
||||
* of the License.
|
||||
*/
|
||||
|
||||
#ifndef _PCC_H
|
||||
#define _PCC_H
|
||||
|
||||
#include <linux/mailbox_controller.h>
|
||||
#include <linux/mailbox_client.h>
|
||||
|
||||
#ifdef CONFIG_PCC
|
||||
extern struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
|
||||
int subspace_id);
|
||||
extern void pcc_mbox_free_channel(struct mbox_chan *chan);
|
||||
#else
|
||||
static inline struct mbox_chan *pcc_mbox_request_channel(struct mbox_client *cl,
|
||||
int subspace_id)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
static inline void pcc_mbox_free_channel(struct mbox_chan *chan) { }
|
||||
#endif
|
||||
|
||||
#endif /* _PCC_H */
|
||||
@@ -39,6 +39,7 @@
|
||||
#define ACPI_CSTATE_SYSTEMIO 0
|
||||
#define ACPI_CSTATE_FFH 1
|
||||
#define ACPI_CSTATE_HALT 2
|
||||
#define ACPI_CSTATE_INTEGER 3
|
||||
|
||||
#define ACPI_CX_DESC_LEN 32
|
||||
|
||||
@@ -67,9 +68,25 @@ struct acpi_processor_cx {
|
||||
char desc[ACPI_CX_DESC_LEN];
|
||||
};
|
||||
|
||||
struct acpi_lpi_state {
|
||||
u32 min_residency;
|
||||
u32 wake_latency; /* worst case */
|
||||
u32 flags;
|
||||
u32 arch_flags;
|
||||
u32 res_cnt_freq;
|
||||
u32 enable_parent_state;
|
||||
u64 address;
|
||||
u8 index;
|
||||
u8 entry_method;
|
||||
char desc[ACPI_CX_DESC_LEN];
|
||||
};
|
||||
|
||||
struct acpi_processor_power {
|
||||
int count;
|
||||
struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
|
||||
union {
|
||||
struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
|
||||
struct acpi_lpi_state lpi_states[ACPI_PROCESSOR_MAX_POWER];
|
||||
};
|
||||
int timer_broadcast_on_state;
|
||||
};
|
||||
|
||||
@@ -189,6 +206,7 @@ struct acpi_processor_flags {
|
||||
u8 bm_control:1;
|
||||
u8 bm_check:1;
|
||||
u8 has_cst:1;
|
||||
u8 has_lpi:1;
|
||||
u8 power_setup_done:1;
|
||||
u8 bm_rld_set:1;
|
||||
u8 need_hotplug_init:1;
|
||||
@@ -242,7 +260,7 @@ extern int acpi_processor_get_performance_info(struct acpi_processor *pr);
|
||||
DECLARE_PER_CPU(struct acpi_processor *, processors);
|
||||
extern struct acpi_processor_errata errata;
|
||||
|
||||
#ifdef ARCH_HAS_POWER_INIT
|
||||
#if defined(ARCH_HAS_POWER_INIT) && defined(CONFIG_ACPI_PROCESSOR_CSTATE)
|
||||
void acpi_processor_power_init_bm_check(struct acpi_processor_flags *flags,
|
||||
unsigned int cpu);
|
||||
int acpi_processor_ffh_cstate_probe(unsigned int cpu,
|
||||
@@ -372,7 +390,7 @@ extern struct cpuidle_driver acpi_idle_driver;
|
||||
#ifdef CONFIG_ACPI_PROCESSOR_IDLE
|
||||
int acpi_processor_power_init(struct acpi_processor *pr);
|
||||
int acpi_processor_power_exit(struct acpi_processor *pr);
|
||||
int acpi_processor_cst_has_changed(struct acpi_processor *pr);
|
||||
int acpi_processor_power_state_has_changed(struct acpi_processor *pr);
|
||||
int acpi_processor_hotplug(struct acpi_processor *pr);
|
||||
#else
|
||||
static inline int acpi_processor_power_init(struct acpi_processor *pr)
|
||||
@@ -385,7 +403,7 @@ static inline int acpi_processor_power_exit(struct acpi_processor *pr)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static inline int acpi_processor_cst_has_changed(struct acpi_processor *pr)
|
||||
static inline int acpi_processor_power_state_has_changed(struct acpi_processor *pr)
|
||||
{
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@@ -457,8 +457,12 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
|
||||
#define OSC_SB_HOTPLUG_OST_SUPPORT 0x00000008
|
||||
#define OSC_SB_APEI_SUPPORT 0x00000010
|
||||
#define OSC_SB_CPC_SUPPORT 0x00000020
|
||||
#define OSC_SB_CPCV2_SUPPORT 0x00000040
|
||||
#define OSC_SB_PCLPI_SUPPORT 0x00000080
|
||||
#define OSC_SB_OSLPI_SUPPORT 0x00000100
|
||||
|
||||
extern bool osc_sb_apei_support_acked;
|
||||
extern bool osc_pc_lpi_support_confirmed;
|
||||
|
||||
/* PCI Host Bridge _OSC: Capabilities DWORD 2: Support Field */
|
||||
#define OSC_PCI_EXT_CONFIG_SUPPORT 0x00000001
|
||||
|
||||
@@ -252,4 +252,22 @@ static inline int cpuidle_register_governor(struct cpuidle_governor *gov)
|
||||
#define CPUIDLE_DRIVER_STATE_START 0
|
||||
#endif
|
||||
|
||||
#define CPU_PM_CPU_IDLE_ENTER(low_level_idle_enter, idx) \
|
||||
({ \
|
||||
int __ret; \
|
||||
\
|
||||
if (!idx) { \
|
||||
cpu_do_idle(); \
|
||||
return idx; \
|
||||
} \
|
||||
\
|
||||
__ret = cpu_pm_enter(); \
|
||||
if (!__ret) { \
|
||||
__ret = low_level_idle_enter(idx); \
|
||||
cpu_pm_exit(); \
|
||||
} \
|
||||
\
|
||||
__ret ? -1 : idx; \
|
||||
})
|
||||
|
||||
#endif /* _LINUX_CPUIDLE_H */
|
||||
|
||||
Reference in New Issue
Block a user