mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 06:31:49 +00:00
Merge branches 'pnp', 'acpi-init', 'acpi-sleep' and 'pm-cpufreq'
* pnp: PNP / ACPI: proper handling of ACPI IO/Memory resource parsing failures * acpi-init: ACPI / init: Invoke early ACPI initialization later * acpi-sleep: ACPI / sleep: Add extra checks for HW Reduced ACPI mode sleep states * pm-cpufreq: cpufreq: Skip current frequency initialization for ->setpolicy drivers
This commit is contained in:
commit
d5af40d6b3
@ -71,6 +71,17 @@ static int acpi_sleep_prepare(u32 acpi_state)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool acpi_sleep_state_supported(u8 sleep_state)
|
||||
{
|
||||
acpi_status status;
|
||||
u8 type_a, type_b;
|
||||
|
||||
status = acpi_get_sleep_type_data(sleep_state, &type_a, &type_b);
|
||||
return ACPI_SUCCESS(status) && (!acpi_gbl_reduced_hardware
|
||||
|| (acpi_gbl_FADT.sleep_control.address
|
||||
&& acpi_gbl_FADT.sleep_status.address));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_ACPI_SLEEP
|
||||
static u32 acpi_target_sleep_state = ACPI_STATE_S0;
|
||||
|
||||
@ -604,15 +615,9 @@ static void acpi_sleep_suspend_setup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++) {
|
||||
acpi_status status;
|
||||
u8 type_a, type_b;
|
||||
|
||||
status = acpi_get_sleep_type_data(i, &type_a, &type_b);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++)
|
||||
if (acpi_sleep_state_supported(i))
|
||||
sleep_states[i] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
suspend_set_ops(old_suspend_ordering ?
|
||||
&acpi_suspend_ops_old : &acpi_suspend_ops);
|
||||
@ -740,11 +745,7 @@ static const struct platform_hibernation_ops acpi_hibernation_ops_old = {
|
||||
|
||||
static void acpi_sleep_hibernate_setup(void)
|
||||
{
|
||||
acpi_status status;
|
||||
u8 type_a, type_b;
|
||||
|
||||
status = acpi_get_sleep_type_data(ACPI_STATE_S4, &type_a, &type_b);
|
||||
if (ACPI_FAILURE(status))
|
||||
if (!acpi_sleep_state_supported(ACPI_STATE_S4))
|
||||
return;
|
||||
|
||||
hibernation_set_ops(old_suspend_ordering ?
|
||||
@ -793,8 +794,6 @@ static void acpi_power_off(void)
|
||||
|
||||
int __init acpi_sleep_init(void)
|
||||
{
|
||||
acpi_status status;
|
||||
u8 type_a, type_b;
|
||||
char supported[ACPI_S_STATE_COUNT * 3 + 1];
|
||||
char *pos = supported;
|
||||
int i;
|
||||
@ -806,8 +805,7 @@ int __init acpi_sleep_init(void)
|
||||
acpi_sleep_suspend_setup();
|
||||
acpi_sleep_hibernate_setup();
|
||||
|
||||
status = acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
if (acpi_sleep_state_supported(ACPI_STATE_S5)) {
|
||||
sleep_states[ACPI_STATE_S5] = 1;
|
||||
pm_power_off_prepare = acpi_power_off_prepare;
|
||||
pm_power_off = acpi_power_off;
|
||||
|
@ -1129,7 +1129,7 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
|
||||
per_cpu(cpufreq_cpu_data, j) = policy;
|
||||
write_unlock_irqrestore(&cpufreq_driver_lock, flags);
|
||||
|
||||
if (cpufreq_driver->get) {
|
||||
if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
|
||||
policy->cur = cpufreq_driver->get(policy->cpu);
|
||||
if (!policy->cur) {
|
||||
pr_err("%s: ->get() failed\n", __func__);
|
||||
@ -2143,7 +2143,7 @@ int cpufreq_update_policy(unsigned int cpu)
|
||||
* BIOS might change freq behind our back
|
||||
* -> ask driver for current freq and notify governors about a change
|
||||
*/
|
||||
if (cpufreq_driver->get) {
|
||||
if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
|
||||
new_policy.cur = cpufreq_driver->get(cpu);
|
||||
if (!policy->cur) {
|
||||
pr_debug("Driver did not initialize current freq");
|
||||
|
@ -561,7 +561,6 @@ asmlinkage void __init start_kernel(void)
|
||||
init_timers();
|
||||
hrtimers_init();
|
||||
softirq_init();
|
||||
acpi_early_init();
|
||||
timekeeping_init();
|
||||
time_init();
|
||||
sched_clock_postinit();
|
||||
@ -613,6 +612,7 @@ asmlinkage void __init start_kernel(void)
|
||||
calibrate_delay();
|
||||
pidmap_init();
|
||||
anon_vma_init();
|
||||
acpi_early_init();
|
||||
#ifdef CONFIG_X86
|
||||
if (efi_enabled(EFI_RUNTIME_SERVICES))
|
||||
efi_enter_virtual_mode();
|
||||
|
Loading…
Reference in New Issue
Block a user