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

Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'acpi-resources'

* pm-cpuidle:
suspend-to-idle: Prevent RCU from complaining about tick_freeze()

* pm-cpufreq:
cpufreq: Allow freq_table to be obtained for offline CPUs
cpufreq: Initialize the governor again while restoring policy

* acpi-resources:
ACPI / PCI: Fix regressions caused by resource_size_t overflow with 32-bit kernel

+32 -20
+15 -9
drivers/acpi/resource.c
··· 193 193 u8 iodec = attr->granularity == 0xfff ? ACPI_DECODE_10 : ACPI_DECODE_16; 194 194 bool wp = addr->info.mem.write_protect; 195 195 u64 len = attr->address_length; 196 + u64 start, end, offset = 0; 196 197 struct resource *res = &win->res; 197 198 198 199 /* ··· 205 204 pr_debug("ACPI: Invalid address space min_addr_fix %d, max_addr_fix %d, len %llx\n", 206 205 addr->min_address_fixed, addr->max_address_fixed, len); 207 206 208 - res->start = attr->minimum; 209 - res->end = attr->maximum; 210 - 211 207 /* 212 208 * For bridges that translate addresses across the bridge, 213 209 * translation_offset is the offset that must be added to the ··· 212 214 * primary side. Non-bridge devices must list 0 for all Address 213 215 * Translation offset bits. 214 216 */ 215 - if (addr->producer_consumer == ACPI_PRODUCER) { 216 - res->start += attr->translation_offset; 217 - res->end += attr->translation_offset; 218 - } else if (attr->translation_offset) { 217 + if (addr->producer_consumer == ACPI_PRODUCER) 218 + offset = attr->translation_offset; 219 + else if (attr->translation_offset) 219 220 pr_debug("ACPI: translation_offset(%lld) is invalid for non-bridge device.\n", 220 221 attr->translation_offset); 222 + start = attr->minimum + offset; 223 + end = attr->maximum + offset; 224 + 225 + win->offset = offset; 226 + res->start = start; 227 + res->end = end; 228 + if (sizeof(resource_size_t) < sizeof(u64) && 229 + (offset != win->offset || start != res->start || end != res->end)) { 230 + pr_warn("acpi resource window ([%#llx-%#llx] ignored, not CPU addressable)\n", 231 + attr->minimum, attr->maximum); 232 + return false; 221 233 } 222 234 223 235 switch (addr->resource_type) { ··· 243 235 default: 244 236 return false; 245 237 } 246 - 247 - win->offset = attr->translation_offset; 248 238 249 239 if (addr->producer_consumer == ACPI_PRODUCER) 250 240 res->flags |= IORESOURCE_WINDOW;
+10
drivers/cpufreq/cpufreq.c
··· 169 169 } 170 170 EXPORT_SYMBOL_GPL(get_governor_parent_kobj); 171 171 172 + struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu) 173 + { 174 + struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu); 175 + 176 + return policy && !policy_is_inactive(policy) ? 177 + policy->freq_table : NULL; 178 + } 179 + EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table); 180 + 172 181 static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall) 173 182 { 174 183 u64 idle_time; ··· 1141 1132 1142 1133 down_write(&policy->rwsem); 1143 1134 policy->cpu = cpu; 1135 + policy->governor = NULL; 1144 1136 up_write(&policy->rwsem); 1145 1137 } 1146 1138
-9
drivers/cpufreq/freq_table.c
··· 297 297 } 298 298 EXPORT_SYMBOL_GPL(cpufreq_table_validate_and_show); 299 299 300 - struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu); 301 - 302 - struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu) 303 - { 304 - struct cpufreq_policy *policy = cpufreq_cpu_get_raw(cpu); 305 - return policy ? policy->freq_table : NULL; 306 - } 307 - EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table); 308 - 309 300 MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>"); 310 301 MODULE_DESCRIPTION("CPUfreq frequency table helpers"); 311 302 MODULE_LICENSE("GPL");
+7 -2
drivers/cpuidle/cpuidle.c
··· 112 112 static void enter_freeze_proper(struct cpuidle_driver *drv, 113 113 struct cpuidle_device *dev, int index) 114 114 { 115 - tick_freeze(); 115 + /* 116 + * trace_suspend_resume() called by tick_freeze() for the last CPU 117 + * executing it contains RCU usage regarded as invalid in the idle 118 + * context, so tell RCU about that. 119 + */ 120 + RCU_NONIDLE(tick_freeze()); 116 121 /* 117 122 * The state used here cannot be a "coupled" one, because the "coupled" 118 123 * cpuidle mechanism enables interrupts and doing that with timekeeping ··· 127 122 WARN_ON(!irqs_disabled()); 128 123 /* 129 124 * timekeeping_resume() that will be called by tick_unfreeze() for the 130 - * last CPU executing it calls functions containing RCU read-side 125 + * first CPU executing it calls functions containing RCU read-side 131 126 * critical sections, so tell RCU about that. 132 127 */ 133 128 RCU_NONIDLE(tick_unfreeze());