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

Merge branches 'release', 'bugzilla-6217', 'bugzilla-6629', 'bugzilla-6933', 'bugzilla-7186', 'bugzilla-8269', 'bugzilla-8570', 'bugzilla-9139', 'bugzilla-9277', 'bugzilla-9341', 'bugzilla-9444', 'bugzilla-9614', 'bugzilla-9643' and 'bugzilla-9644' into release

Len Brown c64768a7 8f859016

+209 -125
+3
Documentation/00-INDEX
··· 14 14 - this file. 15 15 ABI/ 16 16 - info on kernel <-> userspace ABI and relative interface stability. 17 + 17 18 BUG-HUNTING 18 19 - brute force method of doing binary search of patches to find bug. 19 20 Changes ··· 67 66 - how to change your VGA cursor from a blinking underscore. 68 67 accounting/ 69 68 - documentation on accounting and taskstats. 69 + acpi/ 70 + - info on ACPI-specific hooks in the kernel. 70 71 aoe/ 71 72 - description of AoE (ATA over Ethernet) along with config examples. 72 73 applying-patches.txt
+26
Documentation/acpi/method-tracing.txt
··· 1 + /sys/module/acpi/parameters/: 2 + 3 + trace_method_name 4 + The AML method name that the user wants to trace 5 + 6 + trace_debug_layer 7 + The temporary debug_layer used when tracing the method. 8 + Using 0xffffffff by default if it is 0. 9 + 10 + trace_debug_level 11 + The temporary debug_level used when tracing the method. 12 + Using 0x00ffffff by default if it is 0. 13 + 14 + trace_state 15 + The status of the tracing feature. 16 + 17 + "enabled" means this feature is enabled 18 + and the AML method is traced every time it's executed. 19 + 20 + "1" means this feature is enabled and the AML method 21 + will only be traced during the next execution. 22 + 23 + "disabled" means this feature is disabled. 24 + Users can enable/disable this debug tracing feature by 25 + "echo string > /sys/module/acpi/parameters/trace_state". 26 + "string" should be one of "enable", "disable" and "1".
+14 -12
arch/ia64/kernel/acpi.c
··· 69 69 70 70 unsigned long acpi_wakeup_address = 0; 71 71 72 + #ifdef CONFIG_IA64_GENERIC 73 + static unsigned long __init acpi_find_rsdp(void) 74 + { 75 + unsigned long rsdp_phys = 0; 76 + 77 + if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) 78 + rsdp_phys = efi.acpi20; 79 + else if (efi.acpi != EFI_INVALID_TABLE_ADDR) 80 + printk(KERN_WARNING PREFIX 81 + "v1.0/r0.71 tables no longer supported\n"); 82 + return rsdp_phys; 83 + } 84 + #endif 85 + 72 86 const char __init * 73 87 acpi_get_sysname(void) 74 88 { ··· 643 629 644 630 acpi_register_gsi(fadt->sci_interrupt, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW); 645 631 return 0; 646 - } 647 - 648 - unsigned long __init acpi_find_rsdp(void) 649 - { 650 - unsigned long rsdp_phys = 0; 651 - 652 - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) 653 - rsdp_phys = efi.acpi20; 654 - else if (efi.acpi != EFI_INVALID_TABLE_ADDR) 655 - printk(KERN_WARNING PREFIX 656 - "v1.0/r0.71 tables no longer supported\n"); 657 - return rsdp_phys; 658 632 } 659 633 660 634 int __init acpi_boot_init(void)
-40
arch/x86/kernel/acpi/boot.c
··· 587 587 588 588 EXPORT_SYMBOL(acpi_unregister_ioapic); 589 589 590 - static unsigned long __init 591 - acpi_scan_rsdp(unsigned long start, unsigned long length) 592 - { 593 - unsigned long offset = 0; 594 - unsigned long sig_len = sizeof("RSD PTR ") - 1; 595 - 596 - /* 597 - * Scan all 16-byte boundaries of the physical memory region for the 598 - * RSDP signature. 599 - */ 600 - for (offset = 0; offset < length; offset += 16) { 601 - if (strncmp((char *)(phys_to_virt(start) + offset), "RSD PTR ", sig_len)) 602 - continue; 603 - return (start + offset); 604 - } 605 - 606 - return 0; 607 - } 608 - 609 590 static int __init acpi_parse_sbf(struct acpi_table_header *table) 610 591 { 611 592 struct acpi_table_boot *sb; ··· 727 746 pmtmr_ioport); 728 747 #endif 729 748 return 0; 730 - } 731 - 732 - unsigned long __init acpi_find_rsdp(void) 733 - { 734 - unsigned long rsdp_phys = 0; 735 - 736 - if (efi_enabled) { 737 - if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) 738 - return efi.acpi20; 739 - else if (efi.acpi != EFI_INVALID_TABLE_ADDR) 740 - return efi.acpi; 741 - } 742 - /* 743 - * Scan memory looking for the RSDP signature. First search EBDA (low 744 - * memory) paragraphs and then search upper memory (E0000-FFFFF). 745 - */ 746 - rsdp_phys = acpi_scan_rsdp(0, 0x400); 747 - if (!rsdp_phys) 748 - rsdp_phys = acpi_scan_rsdp(0xE0000, 0x20000); 749 - 750 - return rsdp_phys; 751 749 } 752 750 753 751 #ifdef CONFIG_X86_LOCAL_APIC
+1 -4
arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
··· 189 189 printk(KERN_DEBUG "speedstep-lib: couldn't detect FSB speed. Please send an e-mail to <linux@brodo.de>\n"); 190 190 191 191 /* Multiplier. */ 192 - if (c->x86_model < 2) 193 - mult = msr_lo >> 27; 194 - else 195 - mult = msr_lo >> 24; 192 + mult = msr_lo >> 24; 196 193 197 194 dprintk("P4 - FSB %u kHz; Multiplier %u; Speed %u kHz\n", fsb, mult, (fsb * mult)); 198 195
+1 -1
arch/x86/kernel/srat_32.c
··· 274 274 int tables = 0; 275 275 int i = 0; 276 276 277 - rsdp_address = acpi_find_rsdp(); 277 + rsdp_address = acpi_os_get_root_pointer(); 278 278 if (!rsdp_address) { 279 279 printk("%s: System description tables not found\n", 280 280 __FUNCTION__);
-2
drivers/acpi/blacklist.c
··· 70 70 /* IBM 600E - _ADR should return 7, but it returns 1 */ 71 71 {"IBM ", "TP600E ", 0x00000105, ACPI_SIG_DSDT, less_than_or_equal, 72 72 "Incorrect _ADR", 1}, 73 - {"ASUS\0\0", "P2B-S ", 0, ACPI_SIG_DSDT, all_versions, 74 - "Bogus PCI routing", 1}, 75 73 76 74 {""} 77 75 };
+57
drivers/acpi/debug.c
··· 130 130 module_param_call(debug_layer, param_set_uint, param_get_debug_layer, &acpi_dbg_layer, 0644); 131 131 module_param_call(debug_level, param_set_uint, param_get_debug_level, &acpi_dbg_level, 0644); 132 132 133 + static char trace_method_name[6]; 134 + module_param_string(trace_method_name, trace_method_name, 6, 0644); 135 + static unsigned int trace_debug_layer; 136 + module_param(trace_debug_layer, uint, 0644); 137 + static unsigned int trace_debug_level; 138 + module_param(trace_debug_level, uint, 0644); 139 + 140 + static int param_set_trace_state(const char *val, struct kernel_param *kp) 141 + { 142 + int result = 0; 143 + 144 + if (!strncmp(val, "enable", strlen("enable") - 1)) { 145 + result = acpi_debug_trace(trace_method_name, trace_debug_level, 146 + trace_debug_layer, 0); 147 + if (result) 148 + result = -EBUSY; 149 + goto exit; 150 + } 151 + 152 + if (!strncmp(val, "disable", strlen("disable") - 1)) { 153 + int name = 0; 154 + result = acpi_debug_trace((char *)&name, trace_debug_level, 155 + trace_debug_layer, 0); 156 + if (result) 157 + result = -EBUSY; 158 + goto exit; 159 + } 160 + 161 + if (!strncmp(val, "1", 1)) { 162 + result = acpi_debug_trace(trace_method_name, trace_debug_level, 163 + trace_debug_layer, 1); 164 + if (result) 165 + result = -EBUSY; 166 + goto exit; 167 + } 168 + 169 + result = -EINVAL; 170 + exit: 171 + return result; 172 + } 173 + 174 + static int param_get_trace_state(char *buffer, struct kernel_param *kp) 175 + { 176 + if (!acpi_gbl_trace_method_name) 177 + return sprintf(buffer, "disable"); 178 + else { 179 + if (acpi_gbl_trace_flags & 1) 180 + return sprintf(buffer, "1"); 181 + else 182 + return sprintf(buffer, "enable"); 183 + } 184 + return 0; 185 + } 186 + 187 + module_param_call(trace_state, param_set_trace_state, param_get_trace_state, 188 + NULL, 0644); 189 + 133 190 /* -------------------------------------------------------------------------- 134 191 FS Interface (/proc) 135 192 -------------------------------------------------------------------------- */
+15 -4
drivers/acpi/ec.c
··· 573 573 void *handler_context, void *region_context) 574 574 { 575 575 struct acpi_ec *ec = handler_context; 576 - int result = 0, i = 0; 576 + int result = 0, i; 577 577 u8 temp = 0; 578 578 579 579 if ((address > 0xFF) || !value || !handler_context) ··· 585 585 if (bits != 8 && acpi_strict) 586 586 return AE_BAD_PARAMETER; 587 587 588 - while (bits - i > 0) { 588 + acpi_ec_burst_enable(ec); 589 + 590 + if (function == ACPI_READ) { 591 + result = acpi_ec_read(ec, address, &temp); 592 + *value = temp; 593 + } else { 594 + temp = 0xff & (*value); 595 + result = acpi_ec_write(ec, address, temp); 596 + } 597 + 598 + for (i = 8; unlikely(bits - i > 0); i += 8) { 599 + ++address; 589 600 if (function == ACPI_READ) { 590 601 result = acpi_ec_read(ec, address, &temp); 591 602 (*value) |= ((acpi_integer)temp) << i; ··· 604 593 temp = 0xff & ((*value) >> i); 605 594 result = acpi_ec_write(ec, address, temp); 606 595 } 607 - i += 8; 608 - ++address; 609 596 } 597 + 598 + acpi_ec_burst_disable(ec); 610 599 611 600 switch (result) { 612 601 case -EINVAL:
+4 -4
drivers/acpi/events/evgpe.c
··· 270 270 case ACPI_GPE_TYPE_WAKE_RUN: 271 271 ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_WAKE_ENABLED); 272 272 273 - /*lint -fallthrough */ 273 + /* fallthrough */ 274 274 275 275 case ACPI_GPE_TYPE_RUNTIME: 276 276 277 277 /* Disable the requested runtime GPE */ 278 278 279 279 ACPI_CLEAR_BIT(gpe_event_info->flags, ACPI_GPE_RUN_ENABLED); 280 - status = acpi_hw_write_gpe_enable_reg(gpe_event_info); 281 - break; 280 + 281 + /* fallthrough */ 282 282 283 283 default: 284 - return_ACPI_STATUS(AE_BAD_PARAMETER); 284 + acpi_hw_write_gpe_enable_reg(gpe_event_info); 285 285 } 286 286 287 287 return_ACPI_STATUS(AE_OK);
+6 -2
drivers/acpi/osl.c
··· 250 250 "System description tables not found\n"); 251 251 return 0; 252 252 } 253 - } else 254 - return acpi_find_rsdp(); 253 + } else { 254 + acpi_physical_address pa = 0; 255 + 256 + acpi_find_root_pointer(&pa); 257 + return pa; 258 + } 255 259 } 256 260 257 261 void __iomem *acpi_os_map_memory(acpi_physical_address phys, acpi_size size)
+12 -5
drivers/acpi/processor_core.c
··· 812 812 813 813 814 814 status = acpi_evaluate_integer(handle, "_STA", NULL, &sta); 815 - if (ACPI_FAILURE(status) || !(sta & ACPI_STA_DEVICE_PRESENT)) { 816 - ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present")); 817 - return 0; 818 - } 819 - return 1; 815 + /* 816 + * if a processor object does not have an _STA object, 817 + * OSPM assumes that the processor is present. 818 + */ 819 + if (status == AE_NOT_FOUND) 820 + return 1; 821 + 822 + if (ACPI_SUCCESS(status) && (sta & ACPI_STA_DEVICE_PRESENT)) 823 + return 1; 824 + 825 + ACPI_EXCEPTION((AE_INFO, status, "Processor Device is not present")); 826 + return 0; 820 827 } 821 828 822 829 static
+15 -31
drivers/acpi/sleep/proc.c
··· 178 178 * Try to find delimeter, only to insert null. The end of the 179 179 * string won't have one, but is still valid. 180 180 */ 181 + if (*p == NULL) 182 + return result; 183 + 181 184 next = strpbrk(*p, "- :"); 182 185 if (next) 183 186 *next++ = '\0'; ··· 193 190 194 191 if (next) 195 192 *p = next; 193 + else 194 + *p = NULL; 196 195 197 196 return result; 198 197 } ··· 256 251 if ((result = get_date_field(&p, &sec))) 257 252 goto end; 258 253 259 - if (sec > 59) { 260 - min += 1; 261 - sec -= 60; 262 - } 263 - if (min > 59) { 264 - hr += 1; 265 - min -= 60; 266 - } 267 - if (hr > 23) { 268 - day += 1; 269 - hr -= 24; 270 - } 271 - if (day > 31) { 272 - mo += 1; 273 - day -= 31; 274 - } 275 - if (mo > 12) { 276 - yr += 1; 277 - mo -= 12; 278 - } 279 - 280 254 spin_lock_irq(&rtc_lock); 281 255 282 256 rtc_control = CMOS_READ(RTC_CONTROL); ··· 272 288 spin_unlock_irq(&rtc_lock); 273 289 274 290 if (sec > 59) { 275 - min++; 276 - sec -= 60; 291 + min += sec/60; 292 + sec = sec%60; 277 293 } 278 294 if (min > 59) { 279 - hr++; 280 - min -= 60; 295 + hr += min/60; 296 + min = min%60; 281 297 } 282 298 if (hr > 23) { 283 - day++; 284 - hr -= 24; 299 + day += hr/24; 300 + hr = hr%24; 285 301 } 286 302 if (day > 31) { 287 - mo++; 288 - day -= 31; 303 + mo += day/32; 304 + day = day%32; 289 305 } 290 306 if (mo > 12) { 291 - yr++; 292 - mo -= 12; 307 + yr += mo/13; 308 + mo = mo%13; 293 309 } 294 310 295 311 spin_lock_irq(&rtc_lock);
+1 -1
drivers/acpi/tables/Makefile
··· 2 2 # Makefile for all Linux ACPI interpreter subdirectories 3 3 # 4 4 5 - obj-y := tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o 5 + obj-y := tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o 6 6 7 7 EXTRA_CFLAGS += $(ACPI_CFLAGS)
+1 -3
drivers/acpi/tables/tbxfroot.c
··· 100 100 101 101 /******************************************************************************* 102 102 * 103 - * FUNCTION: acpi_tb_find_rsdp 103 + * FUNCTION: acpi_find_root_pointer 104 104 * 105 105 * PARAMETERS: table_address - Where the table pointer is returned 106 106 * ··· 218 218 ACPI_ERROR((AE_INFO, "A valid RSDP was not found")); 219 219 return_ACPI_STATUS(AE_NOT_FOUND); 220 220 } 221 - 222 - ACPI_EXPORT_SYMBOL(acpi_find_root_pointer) 223 221 224 222 /******************************************************************************* 225 223 *
+10 -7
drivers/acpi/thermal.c
··· 492 492 493 493 static int acpi_thermal_critical(struct acpi_thermal *tz) 494 494 { 495 - if (!tz || !tz->trips.critical.flags.valid || nocrt) 495 + if (!tz || !tz->trips.critical.flags.valid) 496 496 return -EINVAL; 497 497 498 498 if (tz->temperature >= tz->trips.critical.temperature) { ··· 501 501 } else if (tz->trips.critical.flags.enabled) 502 502 tz->trips.critical.flags.enabled = 0; 503 503 504 - printk(KERN_EMERG 505 - "Critical temperature reached (%ld C), shutting down.\n", 506 - KELVIN_TO_CELSIUS(tz->temperature)); 507 504 acpi_bus_generate_proc_event(tz->device, ACPI_THERMAL_NOTIFY_CRITICAL, 508 505 tz->trips.critical.flags.enabled); 509 506 acpi_bus_generate_netlink_event(tz->device->pnp.device_class, ··· 508 511 ACPI_THERMAL_NOTIFY_CRITICAL, 509 512 tz->trips.critical.flags.enabled); 510 513 511 - orderly_poweroff(true); 514 + /* take no action if nocrt is set */ 515 + if(!nocrt) { 516 + printk(KERN_EMERG 517 + "Critical temperature reached (%ld C), shutting down.\n", 518 + KELVIN_TO_CELSIUS(tz->temperature)); 519 + orderly_poweroff(true); 520 + } 512 521 513 522 return 0; 514 523 } 515 524 516 525 static int acpi_thermal_hot(struct acpi_thermal *tz) 517 526 { 518 - if (!tz || !tz->trips.hot.flags.valid || nocrt) 527 + if (!tz || !tz->trips.hot.flags.valid) 519 528 return -EINVAL; 520 529 521 530 if (tz->temperature >= tz->trips.hot.temperature) { ··· 537 534 ACPI_THERMAL_NOTIFY_HOT, 538 535 tz->trips.hot.flags.enabled); 539 536 540 - /* TBD: Call user-mode "sleep(S4)" function */ 537 + /* TBD: Call user-mode "sleep(S4)" function if nocrt is cleared */ 541 538 542 539 return 0; 543 540 }
+42 -7
drivers/acpi/video.c
··· 292 292 static int acpi_video_get_brightness(struct backlight_device *bd) 293 293 { 294 294 unsigned long cur_level; 295 + int i; 295 296 struct acpi_video_device *vd = 296 297 (struct acpi_video_device *)bl_get_data(bd); 297 298 acpi_video_device_lcd_get_level_current(vd, &cur_level); 298 - return (int) cur_level; 299 + for (i = 2; i < vd->brightness->count; i++) { 300 + if (vd->brightness->levels[i] == cur_level) 301 + /* The first two entries are special - see page 575 302 + of the ACPI spec 3.0 */ 303 + return i-2; 304 + } 305 + return 0; 299 306 } 300 307 301 308 static int acpi_video_set_brightness(struct backlight_device *bd) 302 309 { 303 - int request_level = bd->props.brightness; 310 + int request_level = bd->props.brightness+2; 304 311 struct acpi_video_device *vd = 305 312 (struct acpi_video_device *)bl_get_data(bd); 306 - acpi_video_device_lcd_set_level(vd, request_level); 313 + acpi_video_device_lcd_set_level(vd, 314 + vd->brightness->levels[request_level]); 307 315 return 0; 308 316 } 309 317 ··· 660 652 kfree(obj); 661 653 662 654 if (device->cap._BCL && device->cap._BCM && device->cap._BQC && max_level > 0){ 663 - unsigned long tmp; 664 655 static int count = 0; 665 656 char *name; 666 657 name = kzalloc(MAX_NAME_LEN, GFP_KERNEL); ··· 667 660 return; 668 661 669 662 sprintf(name, "acpi_video%d", count++); 670 - acpi_video_device_lcd_get_level_current(device, &tmp); 671 663 device->backlight = backlight_device_register(name, 672 664 NULL, device, &acpi_backlight_ops); 673 - device->backlight->props.max_brightness = max_level; 674 - device->backlight->props.brightness = (int)tmp; 665 + device->backlight->props.max_brightness = device->brightness->count-3; 666 + device->backlight->props.brightness = acpi_video_get_brightness(device->backlight); 675 667 backlight_update_status(device->backlight); 676 668 677 669 kfree(name); ··· 1262 1256 1263 1257 static int acpi_video_bus_add_fs(struct acpi_device *device) 1264 1258 { 1259 + long device_id; 1260 + int status; 1265 1261 struct proc_dir_entry *entry = NULL; 1266 1262 struct acpi_video_bus *video; 1263 + struct device *dev; 1264 + 1265 + status = 1266 + acpi_evaluate_integer(device->handle, "_ADR", NULL, &device_id); 1267 + 1268 + if (!ACPI_SUCCESS(status)) 1269 + return -ENODEV; 1270 + 1271 + /* We need to attempt to determine whether the _ADR refers to a 1272 + PCI device or not. There's no terribly good way to do this, 1273 + so the best we can hope for is to assume that there'll never 1274 + be a video device in the host bridge */ 1275 + if (device_id >= 0x10000) { 1276 + /* It looks like a PCI device. Does it exist? */ 1277 + dev = acpi_get_physical_device(device->handle); 1278 + } else { 1279 + /* It doesn't look like a PCI device. Does its parent 1280 + exist? */ 1281 + acpi_handle phandle; 1282 + if (acpi_get_parent(device->handle, &phandle)) 1283 + return -ENODEV; 1284 + dev = acpi_get_physical_device(phandle); 1285 + } 1286 + if (!dev) 1287 + return -ENODEV; 1288 + put_device(dev); 1289 + 1267 1290 1268 1291 1269 1292 video = acpi_driver_data(device);
+1 -1
drivers/pnp/pnpacpi/core.c
··· 183 183 if (ACPI_SUCCESS(status)) 184 184 dev->capabilities |= PNP_CONFIGURABLE; 185 185 dev->capabilities |= PNP_READ; 186 - if (device->flags.dynamic_status) 186 + if (device->flags.dynamic_status && (dev->capabilities & PNP_CONFIGURABLE)) 187 187 dev->capabilities |= PNP_WRITE; 188 188 if (device->flags.removable) 189 189 dev->capabilities |= PNP_REMOVABLE;
-1
include/linux/acpi.h
··· 80 80 typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); 81 81 82 82 char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 83 - unsigned long acpi_find_rsdp (void); 84 83 int acpi_boot_init (void); 85 84 int acpi_boot_table_init (void); 86 85 int acpi_numa_init (void);