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 branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6:
ACPI / Video: Probe for output switch method when searching video devices.
ACPI / Wakeup: Enable button GPEs unconditionally during initialization
ACPI / ACPICA: Avoid crashing if _PRW is defined for the root object
ACPI: Fix acpi_os_read_memory() and acpi_os_write_memory() (v2)

+55 -32
+27 -24
drivers/acpi/acpica/evxfgpe.c
··· 212 212 return_ACPI_STATUS(AE_BAD_PARAMETER); 213 213 } 214 214 215 - /* Validate wake_device is of type Device */ 216 - 217 - device_node = ACPI_CAST_PTR(struct acpi_namespace_node, wake_device); 218 - if (device_node->type != ACPI_TYPE_DEVICE) { 219 - return_ACPI_STATUS(AE_BAD_PARAMETER); 220 - } 221 - 222 215 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); 223 216 224 217 /* Ensure that we have a valid GPE number */ 225 218 226 219 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 227 - if (gpe_event_info) { 228 - /* 229 - * If there is no method or handler for this GPE, then the 230 - * wake_device will be notified whenever this GPE fires (aka 231 - * "implicit notify") Note: The GPE is assumed to be 232 - * level-triggered (for windows compatibility). 233 - */ 234 - if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 235 - ACPI_GPE_DISPATCH_NONE) { 236 - gpe_event_info->flags = 237 - (ACPI_GPE_DISPATCH_NOTIFY | 238 - ACPI_GPE_LEVEL_TRIGGERED); 239 - gpe_event_info->dispatch.device_node = device_node; 240 - } 241 - 242 - gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; 243 - status = AE_OK; 220 + if (!gpe_event_info) { 221 + goto unlock_and_exit; 244 222 } 245 223 224 + /* 225 + * If there is no method or handler for this GPE, then the 226 + * wake_device will be notified whenever this GPE fires (aka 227 + * "implicit notify") Note: The GPE is assumed to be 228 + * level-triggered (for windows compatibility). 229 + */ 230 + if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 231 + ACPI_GPE_DISPATCH_NONE) && (wake_device != ACPI_ROOT_OBJECT)) { 232 + 233 + /* Validate wake_device is of type Device */ 234 + 235 + device_node = ACPI_CAST_PTR(struct acpi_namespace_node, 236 + wake_device); 237 + if (device_node->type != ACPI_TYPE_DEVICE) { 238 + goto unlock_and_exit; 239 + } 240 + gpe_event_info->flags = (ACPI_GPE_DISPATCH_NOTIFY | 241 + ACPI_GPE_LEVEL_TRIGGERED); 242 + gpe_event_info->dispatch.device_node = device_node; 243 + } 244 + 245 + gpe_event_info->flags |= ACPI_GPE_CAN_WAKE; 246 + status = AE_OK; 247 + 248 + unlock_and_exit: 246 249 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 247 250 return_ACPI_STATUS(status); 248 251 }
+18 -7
drivers/acpi/osl.c
··· 636 636 acpi_status 637 637 acpi_os_read_memory(acpi_physical_address phys_addr, u32 * value, u32 width) 638 638 { 639 - u32 dummy; 640 639 void __iomem *virt_addr; 641 - int size = width / 8, unmap = 0; 640 + unsigned int size = width / 8; 641 + bool unmap = false; 642 + u32 dummy; 642 643 643 644 rcu_read_lock(); 644 645 virt_addr = acpi_map_vaddr_lookup(phys_addr, size); 645 - rcu_read_unlock(); 646 646 if (!virt_addr) { 647 + rcu_read_unlock(); 647 648 virt_addr = acpi_os_ioremap(phys_addr, size); 648 - unmap = 1; 649 + if (!virt_addr) 650 + return AE_BAD_ADDRESS; 651 + unmap = true; 649 652 } 653 + 650 654 if (!value) 651 655 value = &dummy; 652 656 ··· 670 666 671 667 if (unmap) 672 668 iounmap(virt_addr); 669 + else 670 + rcu_read_unlock(); 673 671 674 672 return AE_OK; 675 673 } ··· 680 674 acpi_os_write_memory(acpi_physical_address phys_addr, u32 value, u32 width) 681 675 { 682 676 void __iomem *virt_addr; 683 - int size = width / 8, unmap = 0; 677 + unsigned int size = width / 8; 678 + bool unmap = false; 684 679 685 680 rcu_read_lock(); 686 681 virt_addr = acpi_map_vaddr_lookup(phys_addr, size); 687 - rcu_read_unlock(); 688 682 if (!virt_addr) { 683 + rcu_read_unlock(); 689 684 virt_addr = acpi_os_ioremap(phys_addr, size); 690 - unmap = 1; 685 + if (!virt_addr) 686 + return AE_BAD_ADDRESS; 687 + unmap = true; 691 688 } 692 689 693 690 switch (width) { ··· 709 700 710 701 if (unmap) 711 702 iounmap(virt_addr); 703 + else 704 + rcu_read_unlock(); 712 705 713 706 return AE_OK; 714 707 }
+5
drivers/acpi/video_detect.c
··· 82 82 if (!device) 83 83 return 0; 84 84 85 + /* Is this device able to support video switching ? */ 86 + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) || 87 + ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy))) 88 + video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING; 89 + 85 90 /* Is this device able to retrieve a video ROM ? */ 86 91 if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy))) 87 92 video_caps |= ACPI_VIDEO_ROM_AVAILABLE;
+5 -1
drivers/acpi/wakeup.c
··· 86 86 struct acpi_device *dev = container_of(node, 87 87 struct acpi_device, 88 88 wakeup_list); 89 - if (device_can_wakeup(&dev->dev)) 89 + if (device_can_wakeup(&dev->dev)) { 90 + /* Button GPEs are supposed to be always enabled. */ 91 + acpi_enable_gpe(dev->wakeup.gpe_device, 92 + dev->wakeup.gpe_number); 90 93 device_set_wakeup_enable(&dev->dev, true); 94 + } 91 95 } 92 96 mutex_unlock(&acpi_device_lock); 93 97 return 0;