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-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI and power management fixes from Rafael Wysocki:
"These include a fix for a recent ACPI regression related to device
notifications, intel_idle fix related to IvyTown support, fix for a
buffer size issue in ACPICA, PM core fix related to the "freeze" sleep
state, four fixes for various types of breakage in cpufreq drivers, a
PNP workaround for a wrong memory region size in ACPI tables, and a
fix and cleanup for the ACPI tools Makefile.

Specifics:

- Fix for broken ACPI notifications on some systems caused by a
recent ACPI hotplug commit that blocked the propagation of unknown
type notifications to device drivers inadvertently.

- intel_idle fix to make the IvyTown C-states handling (added
recently) work as intended which now is broken due to missing
braces. From Christoph Jaeger.

- ACPICA fix to make it allocate buffers of the right sizes for the
Generic Serial Bus operation region access. From Lv Zheng.

- PM core fix unblocking cpuidle before entering the "freeze" sleep
state which causes that state to be able to actually save more
energy than runtime idle.

- Configuration and build fixes for the highbank and powernv cpufreq
drivers from Kefeng Wang and Srivatsa S Bhat.

- Coccinelle warning fix related to error pointers for the unicore32
cpufreq driver from Duan Jiong.

- Integer overflow fix for the ppc-corenet cpufreq driver from Geert
Uytterhoeven.

- Workaround for BIOSes that don't report the entire Intel MCH area
in their ACPI tables from Bjorn Helgaas.

- ACPI tools Makefile fix and cleanup from Thomas Renninger"

* tag 'pm+acpi-3.15-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / notify: Do not block unknown type notifications in root handler
PNP: Work around BIOS defects in Intel MCH area reporting
cpufreq: highbank: fix ARM_HIGHBANK_CPUFREQ dependency warning
cpufreq: ppc: Fix integer overflow in expression
cpufreq, powernv: Fix build failure on UP
cpufreq: unicore32: replace IS_ERR and PTR_ERR with PTR_ERR_OR_ZERO
PM / suspend: Make cpuidle work in the "freeze" state
intel_idle: fix IVT idle state table setting
ACPICA: Fix buffer allocation issue for generic_serial_bus region accesses.
tools/power/acpi: Minor bugfixes

+188 -30
+97 -7
drivers/acpi/acpica/exfield.c
··· 45 45 #include "accommon.h" 46 46 #include "acdispat.h" 47 47 #include "acinterp.h" 48 + #include "amlcode.h" 48 49 49 50 #define _COMPONENT ACPI_EXECUTER 50 51 ACPI_MODULE_NAME("exfield") 52 + 53 + /* Local prototypes */ 54 + static u32 55 + acpi_ex_get_serial_access_length(u32 accessor_type, u32 access_length); 56 + 57 + /******************************************************************************* 58 + * 59 + * FUNCTION: acpi_get_serial_access_bytes 60 + * 61 + * PARAMETERS: accessor_type - The type of the protocol indicated by region 62 + * field access attributes 63 + * access_length - The access length of the region field 64 + * 65 + * RETURN: Decoded access length 66 + * 67 + * DESCRIPTION: This routine returns the length of the generic_serial_bus 68 + * protocol bytes 69 + * 70 + ******************************************************************************/ 71 + 72 + static u32 73 + acpi_ex_get_serial_access_length(u32 accessor_type, u32 access_length) 74 + { 75 + u32 length; 76 + 77 + switch (accessor_type) { 78 + case AML_FIELD_ATTRIB_QUICK: 79 + 80 + length = 0; 81 + break; 82 + 83 + case AML_FIELD_ATTRIB_SEND_RCV: 84 + case AML_FIELD_ATTRIB_BYTE: 85 + 86 + length = 1; 87 + break; 88 + 89 + case AML_FIELD_ATTRIB_WORD: 90 + case AML_FIELD_ATTRIB_WORD_CALL: 91 + 92 + length = 2; 93 + break; 94 + 95 + case AML_FIELD_ATTRIB_MULTIBYTE: 96 + case AML_FIELD_ATTRIB_RAW_BYTES: 97 + case AML_FIELD_ATTRIB_RAW_PROCESS: 98 + 99 + length = access_length; 100 + break; 101 + 102 + case AML_FIELD_ATTRIB_BLOCK: 103 + case AML_FIELD_ATTRIB_BLOCK_CALL: 104 + default: 105 + 106 + length = ACPI_GSBUS_BUFFER_SIZE; 107 + break; 108 + } 109 + 110 + return (length); 111 + } 51 112 52 113 /******************************************************************************* 53 114 * ··· 124 63 * Buffer, depending on the size of the field. 125 64 * 126 65 ******************************************************************************/ 66 + 127 67 acpi_status 128 - acpi_ex_read_data_from_field(struct acpi_walk_state *walk_state, 68 + acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, 129 69 union acpi_operand_object *obj_desc, 130 70 union acpi_operand_object **ret_buffer_desc) 131 71 { ··· 135 73 acpi_size length; 136 74 void *buffer; 137 75 u32 function; 76 + u16 accessor_type; 138 77 139 78 ACPI_FUNCTION_TRACE_PTR(ex_read_data_from_field, obj_desc); 140 79 ··· 179 116 ACPI_READ | (obj_desc->field.attribute << 16); 180 117 } else if (obj_desc->field.region_obj->region.space_id == 181 118 ACPI_ADR_SPACE_GSBUS) { 182 - length = ACPI_GSBUS_BUFFER_SIZE; 183 - function = 184 - ACPI_READ | (obj_desc->field.attribute << 16); 119 + accessor_type = obj_desc->field.attribute; 120 + length = acpi_ex_get_serial_access_length(accessor_type, 121 + obj_desc-> 122 + field. 123 + access_length); 124 + 125 + /* 126 + * Add additional 2 bytes for modeled generic_serial_bus data buffer: 127 + * typedef struct { 128 + * BYTEStatus; // Byte 0 of the data buffer 129 + * BYTELength; // Byte 1 of the data buffer 130 + * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, 131 + * } 132 + */ 133 + length += 2; 134 + function = ACPI_READ | (accessor_type << 16); 185 135 } else { /* IPMI */ 186 136 187 137 length = ACPI_IPMI_BUFFER_SIZE; ··· 307 231 void *buffer; 308 232 union acpi_operand_object *buffer_desc; 309 233 u32 function; 234 + u16 accessor_type; 310 235 311 236 ACPI_FUNCTION_TRACE_PTR(ex_write_data_to_field, obj_desc); 312 237 ··· 361 284 ACPI_WRITE | (obj_desc->field.attribute << 16); 362 285 } else if (obj_desc->field.region_obj->region.space_id == 363 286 ACPI_ADR_SPACE_GSBUS) { 364 - length = ACPI_GSBUS_BUFFER_SIZE; 365 - function = 366 - ACPI_WRITE | (obj_desc->field.attribute << 16); 287 + accessor_type = obj_desc->field.attribute; 288 + length = acpi_ex_get_serial_access_length(accessor_type, 289 + obj_desc-> 290 + field. 291 + access_length); 292 + 293 + /* 294 + * Add additional 2 bytes for modeled generic_serial_bus data buffer: 295 + * typedef struct { 296 + * BYTEStatus; // Byte 0 of the data buffer 297 + * BYTELength; // Byte 1 of the data buffer 298 + * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, 299 + * } 300 + */ 301 + length += 2; 302 + function = ACPI_WRITE | (accessor_type << 16); 367 303 } else { /* IPMI */ 368 304 369 305 length = ACPI_IPMI_BUFFER_SIZE;
+2 -3
drivers/acpi/bus.c
··· 380 380 break; 381 381 382 382 default: 383 - acpi_handle_warn(handle, "Unsupported event type 0x%x\n", type); 384 - ost_code = ACPI_OST_SC_UNRECOGNIZED_NOTIFY; 385 - goto err; 383 + acpi_handle_debug(handle, "Unknown event type 0x%x\n", type); 384 + break; 386 385 } 387 386 388 387 adev = acpi_bus_get_acpi_device(handle);
+1 -5
drivers/cpufreq/Kconfig.arm
··· 92 92 93 93 config ARM_HIGHBANK_CPUFREQ 94 94 tristate "Calxeda Highbank-based" 95 - depends on ARCH_HIGHBANK 96 - select GENERIC_CPUFREQ_CPU0 97 - select PM_OPP 98 - select REGULATOR 99 - 95 + depends on ARCH_HIGHBANK && GENERIC_CPUFREQ_CPU0 && REGULATOR 100 96 default m 101 97 help 102 98 This adds the CPUFreq driver for Calxeda Highbank SoC
+1
drivers/cpufreq/powernv-cpufreq.c
··· 29 29 30 30 #include <asm/cputhreads.h> 31 31 #include <asm/reg.h> 32 + #include <asm/smp.h> /* Required for cpu_sibling_mask() in UP configs */ 32 33 33 34 #define POWERNV_MAX_PSTATES 256 34 35
+1 -1
drivers/cpufreq/ppc-corenet-cpufreq.c
··· 206 206 per_cpu(cpu_data, i) = data; 207 207 208 208 policy->cpuinfo.transition_latency = 209 - (12 * NSEC_PER_SEC) / fsl_get_sys_freq(); 209 + (12ULL * NSEC_PER_SEC) / fsl_get_sys_freq(); 210 210 of_node_put(np); 211 211 212 212 return 0;
+1 -3
drivers/cpufreq/unicore2-cpufreq.c
··· 60 60 policy->max = policy->cpuinfo.max_freq = 1000000; 61 61 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 62 62 policy->clk = clk_get(NULL, "MAIN_CLK"); 63 - if (IS_ERR(policy->clk)) 64 - return PTR_ERR(policy->clk); 65 - return 0; 63 + return PTR_ERR_OR_ZERO(policy->clk); 66 64 } 67 65 68 66 static struct cpufreq_driver ucv2_driver = {
+2 -1
drivers/idle/intel_idle.c
··· 750 750 if (package_num + 1 > num_sockets) { 751 751 num_sockets = package_num + 1; 752 752 753 - if (num_sockets > 4) 753 + if (num_sockets > 4) { 754 754 cpuidle_state_table = ivt_cstates_8s; 755 755 return; 756 + } 756 757 } 757 758 } 758 759
+79
drivers/pnp/quirks.c
··· 15 15 16 16 #include <linux/types.h> 17 17 #include <linux/kernel.h> 18 + #include <linux/pci.h> 18 19 #include <linux/string.h> 19 20 #include <linux/slab.h> 20 21 #include <linux/pnp.h> ··· 335 334 } 336 335 #endif 337 336 337 + #ifdef CONFIG_X86 338 + /* Device IDs of parts that have 32KB MCH space */ 339 + static const unsigned int mch_quirk_devices[] = { 340 + 0x0154, /* Ivy Bridge */ 341 + 0x0c00, /* Haswell */ 342 + }; 343 + 344 + static struct pci_dev *get_intel_host(void) 345 + { 346 + int i; 347 + struct pci_dev *host; 348 + 349 + for (i = 0; i < ARRAY_SIZE(mch_quirk_devices); i++) { 350 + host = pci_get_device(PCI_VENDOR_ID_INTEL, mch_quirk_devices[i], 351 + NULL); 352 + if (host) 353 + return host; 354 + } 355 + return NULL; 356 + } 357 + 358 + static void quirk_intel_mch(struct pnp_dev *dev) 359 + { 360 + struct pci_dev *host; 361 + u32 addr_lo, addr_hi; 362 + struct pci_bus_region region; 363 + struct resource mch; 364 + struct pnp_resource *pnp_res; 365 + struct resource *res; 366 + 367 + host = get_intel_host(); 368 + if (!host) 369 + return; 370 + 371 + /* 372 + * MCHBAR is not an architected PCI BAR, so MCH space is usually 373 + * reported as a PNP0C02 resource. The MCH space was originally 374 + * 16KB, but is 32KB in newer parts. Some BIOSes still report a 375 + * PNP0C02 resource that is only 16KB, which means the rest of the 376 + * MCH space is consumed but unreported. 377 + */ 378 + 379 + /* 380 + * Read MCHBAR for Host Member Mapped Register Range Base 381 + * https://www-ssl.intel.com/content/www/us/en/processors/core/4th-gen-core-family-desktop-vol-2-datasheet 382 + * Sec 3.1.12. 383 + */ 384 + pci_read_config_dword(host, 0x48, &addr_lo); 385 + region.start = addr_lo & ~0x7fff; 386 + pci_read_config_dword(host, 0x4c, &addr_hi); 387 + region.start |= (u64) addr_hi << 32; 388 + region.end = region.start + 32*1024 - 1; 389 + 390 + memset(&mch, 0, sizeof(mch)); 391 + mch.flags = IORESOURCE_MEM; 392 + pcibios_bus_to_resource(host->bus, &mch, &region); 393 + 394 + list_for_each_entry(pnp_res, &dev->resources, list) { 395 + res = &pnp_res->res; 396 + if (res->end < mch.start || res->start > mch.end) 397 + continue; /* no overlap */ 398 + if (res->start == mch.start && res->end == mch.end) 399 + continue; /* exact match */ 400 + 401 + dev_info(&dev->dev, FW_BUG "PNP resource %pR covers only part of %s Intel MCH; extending to %pR\n", 402 + res, pci_name(host), &mch); 403 + res->start = mch.start; 404 + res->end = mch.end; 405 + break; 406 + } 407 + 408 + pci_dev_put(host); 409 + } 410 + #endif 411 + 338 412 /* 339 413 * PnP Quirks 340 414 * Cards or devices that need some tweaking due to incomplete resource info ··· 439 363 {"PNP0c02", quirk_system_pci_resources}, 440 364 #ifdef CONFIG_AMD_NB 441 365 {"PNP0c01", quirk_amd_mmconfig_area}, 366 + #endif 367 + #ifdef CONFIG_X86 368 + {"PNP0c02", quirk_intel_mch}, 442 369 #endif 443 370 {""} 444 371 };
+3
kernel/power/suspend.c
··· 14 14 #include <linux/init.h> 15 15 #include <linux/console.h> 16 16 #include <linux/cpu.h> 17 + #include <linux/cpuidle.h> 17 18 #include <linux/syscalls.h> 18 19 #include <linux/gfp.h> 19 20 #include <linux/io.h> ··· 54 53 55 54 static void freeze_enter(void) 56 55 { 56 + cpuidle_resume(); 57 57 wait_event(suspend_freeze_wait_head, suspend_freeze_wake); 58 + cpuidle_pause(); 58 59 } 59 60 60 61 void freeze_wake(void)
+1 -10
tools/power/acpi/Makefile
··· 89 89 STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment 90 90 endif 91 91 92 - # if DEBUG is enabled, then we do not strip or optimize 93 - ifeq ($(strip $(DEBUG)),true) 94 - CFLAGS += -O1 -g -DDEBUG 95 - STRIPCMD = /bin/true -Since_we_are_debugging 96 - else 97 - CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer 98 - STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment 99 - endif 100 - 101 92 # --- ACPIDUMP BEGIN --- 102 93 103 94 vpath %.c \ ··· 119 128 -rm -f $(OUTPUT)acpidump 120 129 121 130 install-tools: 122 - $(INSTALL) -d $(DESTDIR)${bindir} 131 + $(INSTALL) -d $(DESTDIR)${sbindir} 123 132 $(INSTALL_PROGRAM) $(OUTPUT)acpidump $(DESTDIR)${sbindir} 124 133 125 134 install-man: