Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'pm+acpi-4.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael Wysocki:
"These fix two recent regressions (ACPICA, the generic power domains
framework) and one crash that may happen on specific hardware
supported since 4.1 (intel_pstate).

Specifics:

- Fix a regression introduced by a recent ACPICA cleanup that
uncovered a latent bug (Lv Zheng).

- Fix a recent regression in the generic power domains framework that
may cause it to violate PM QoS latency constraints in some cases
(Ulf Hansson).

- Fix an intel_pstate driver crash on the Knights Landing chips that
do not update the MPERF counter as often as expected by the driver
which may result in a divide by 0 (Srinivas Pandruvada)"

* tag 'pm+acpi-4.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
cpufreq: intel_pstate: Fix divide by zero on Knights Landing (KNL)
ACPICA: Tables: Fix FADT dependency regression
PM / Domains: Fix validation of latency constraints in genpd governor

+21 -49
+1
drivers/acpi/acpica/acglobal.h
··· 61 61 ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX); 62 62 ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX); 63 63 ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX); 64 + ACPI_INIT_GLOBAL(u32, acpi_gbl_fadt_index, ACPI_INVALID_TABLE_INDEX); 64 65 65 66 #if (!ACPI_REDUCED_HARDWARE) 66 67 ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
+1 -3
drivers/acpi/acpica/actables.h
··· 85 85 /* 86 86 * tbfadt - FADT parse/convert/validate 87 87 */ 88 - void acpi_tb_parse_fadt(u32 table_index); 88 + void acpi_tb_parse_fadt(void); 89 89 90 90 void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length); 91 91 ··· 137 137 * tbutils - table manager utilities 138 138 */ 139 139 acpi_status acpi_tb_initialize_facs(void); 140 - 141 - u8 acpi_tb_tables_loaded(void); 142 140 143 141 void 144 142 acpi_tb_print_table_header(acpi_physical_address address,
+1 -1
drivers/acpi/acpica/evxfevnt.c
··· 71 71 72 72 /* ACPI tables must be present */ 73 73 74 - if (!acpi_tb_tables_loaded()) { 74 + if (acpi_gbl_fadt_index == ACPI_INVALID_TABLE_INDEX) { 75 75 return_ACPI_STATUS(AE_NO_ACPI_TABLES); 76 76 } 77 77
+5 -5
drivers/acpi/acpica/tbfadt.c
··· 298 298 * 299 299 * FUNCTION: acpi_tb_parse_fadt 300 300 * 301 - * PARAMETERS: table_index - Index for the FADT 301 + * PARAMETERS: None 302 302 * 303 303 * RETURN: None 304 304 * ··· 307 307 * 308 308 ******************************************************************************/ 309 309 310 - void acpi_tb_parse_fadt(u32 table_index) 310 + void acpi_tb_parse_fadt(void) 311 311 { 312 312 u32 length; 313 313 struct acpi_table_header *table; ··· 319 319 * Get a local copy of the FADT and convert it to a common format 320 320 * Map entire FADT, assumed to be smaller than one page. 321 321 */ 322 - length = acpi_gbl_root_table_list.tables[table_index].length; 322 + length = acpi_gbl_root_table_list.tables[acpi_gbl_fadt_index].length; 323 323 324 324 table = 325 - acpi_os_map_memory(acpi_gbl_root_table_list.tables[table_index]. 326 - address, length); 325 + acpi_os_map_memory(acpi_gbl_root_table_list. 326 + tables[acpi_gbl_fadt_index].address, length); 327 327 if (!table) { 328 328 return; 329 329 }
+2 -24
drivers/acpi/acpica/tbutils.c
··· 99 99 100 100 /******************************************************************************* 101 101 * 102 - * FUNCTION: acpi_tb_tables_loaded 103 - * 104 - * PARAMETERS: None 105 - * 106 - * RETURN: TRUE if required ACPI tables are loaded 107 - * 108 - * DESCRIPTION: Determine if the minimum required ACPI tables are present 109 - * (FADT, FACS, DSDT) 110 - * 111 - ******************************************************************************/ 112 - 113 - u8 acpi_tb_tables_loaded(void) 114 - { 115 - 116 - if (acpi_gbl_root_table_list.current_table_count >= 4) { 117 - return (TRUE); 118 - } 119 - 120 - return (FALSE); 121 - } 122 - 123 - /******************************************************************************* 124 - * 125 102 * FUNCTION: acpi_tb_check_dsdt_header 126 103 * 127 104 * PARAMETERS: None ··· 369 392 ACPI_COMPARE_NAME(&acpi_gbl_root_table_list. 370 393 tables[table_index].signature, 371 394 ACPI_SIG_FADT)) { 372 - acpi_tb_parse_fadt(table_index); 395 + acpi_gbl_fadt_index = table_index; 396 + acpi_tb_parse_fadt(); 373 397 } 374 398 375 399 next_table:
+6 -16
drivers/base/power/domain_governor.c
··· 77 77 dev_update_qos_constraint); 78 78 79 79 if (constraint_ns > 0) { 80 - constraint_ns -= td->start_latency_ns; 80 + constraint_ns -= td->save_state_latency_ns + 81 + td->stop_latency_ns + 82 + td->start_latency_ns + 83 + td->restore_state_latency_ns; 81 84 if (constraint_ns == 0) 82 85 return false; 83 86 } 84 87 td->effective_constraint_ns = constraint_ns; 85 - td->cached_stop_ok = constraint_ns > td->stop_latency_ns || 86 - constraint_ns == 0; 88 + td->cached_stop_ok = constraint_ns >= 0; 89 + 87 90 /* 88 91 * The children have been suspended already, so we don't need to take 89 92 * their stop latencies into account here. ··· 129 126 130 127 off_on_time_ns = genpd->power_off_latency_ns + 131 128 genpd->power_on_latency_ns; 132 - /* 133 - * It doesn't make sense to remove power from the domain if saving 134 - * the state of all devices in it and the power off/power on operations 135 - * take too much time. 136 - * 137 - * All devices in this domain have been stopped already at this point. 138 - */ 139 - list_for_each_entry(pdd, &genpd->dev_list, list_node) { 140 - if (pdd->dev->driver) 141 - off_on_time_ns += 142 - to_gpd_data(pdd)->td.save_state_latency_ns; 143 - } 144 129 145 130 min_off_time_ns = -1; 146 131 /* ··· 184 193 * constraint_ns cannot be negative here, because the device has 185 194 * been suspended. 186 195 */ 187 - constraint_ns -= td->restore_state_latency_ns; 188 196 if (constraint_ns <= off_on_time_ns) 189 197 return false; 190 198
+5
drivers/cpufreq/intel_pstate.c
··· 776 776 local_irq_save(flags); 777 777 rdmsrl(MSR_IA32_APERF, aperf); 778 778 rdmsrl(MSR_IA32_MPERF, mperf); 779 + if (cpu->prev_mperf == mperf) { 780 + local_irq_restore(flags); 781 + return; 782 + } 783 + 779 784 tsc = rdtsc(); 780 785 local_irq_restore(flags); 781 786