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

Pull ACPI fixes from Rafael Wysocki:
"Two fixes for problems introduced recently (ACPICA and the ACPI
backlight driver) and one fix for an older issue that prevents at
least one system from booting.

Specifics:

- Fix an incorrect check introduced by recent ACPICA changes which
causes problems with booting KVM guests to happen, among other
things (Lv Zheng).

- Fix a backlight issue introduced by recent changes to the ACPI
video driver (Aaron Lu).

- Fix the ACPI processor initialization which attempts to register an
IO region without checking if that really is necessary and
sometimes prevents drivers loaded subsequently from registering
their resources which leads to boot issues (Rafael Wysocki)"

* tag 'acpi-4.7-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI / processor: Avoid reserving IO regions too early
ACPICA / Hardware: Fix old register check in acpi_hw_get_access_bit_width()
ACPI / Thermal / video: fix max_level incorrect value

+29 -29
-9
drivers/acpi/acpi_processor.c
··· 331 331 pr->throttling.duty_width = acpi_gbl_FADT.duty_width; 332 332 333 333 pr->pblk = object.processor.pblk_address; 334 - 335 - /* 336 - * We don't care about error returns - we just try to mark 337 - * these reserved so that nobody else is confused into thinking 338 - * that this region might be unused.. 339 - * 340 - * (In particular, allocating the IO range for Cardbus) 341 - */ 342 - request_region(pr->throttling.address, 6, "ACPI CPU throttle"); 343 334 } 344 335 345 336 /*
+6 -3
drivers/acpi/acpi_video.c
··· 754 754 } 755 755 756 756 int acpi_video_get_levels(struct acpi_device *device, 757 - struct acpi_video_device_brightness **dev_br) 757 + struct acpi_video_device_brightness **dev_br, 758 + int *pmax_level) 758 759 { 759 760 union acpi_object *obj = NULL; 760 761 int i, max_level = 0, count = 0, level_ac_battery = 0; ··· 842 841 843 842 br->count = count; 844 843 *dev_br = br; 844 + if (pmax_level) 845 + *pmax_level = max_level; 845 846 846 847 out: 847 848 kfree(obj); ··· 872 869 struct acpi_video_device_brightness *br = NULL; 873 870 int result = -EINVAL; 874 871 875 - result = acpi_video_get_levels(device->dev, &br); 872 + result = acpi_video_get_levels(device->dev, &br, &max_level); 876 873 if (result) 877 874 return result; 878 875 device->brightness = br; ··· 1740 1737 1741 1738 mutex_lock(&video->device_list_lock); 1742 1739 list_for_each_entry(dev, &video->video_device_list, entry) { 1743 - if (!acpi_video_device_lcd_query_levels(dev, &levels)) 1740 + if (!acpi_video_device_lcd_query_levels(dev->dev->handle, &levels)) 1744 1741 kfree(levels); 1745 1742 } 1746 1743 mutex_unlock(&video->device_list_lock);
+9 -14
drivers/acpi/acpica/hwregs.c
··· 83 83 static u8 84 84 acpi_hw_get_access_bit_width(struct acpi_generic_address *reg, u8 max_bit_width) 85 85 { 86 - u64 address; 87 - 88 86 if (!reg->access_width) { 87 + if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { 88 + max_bit_width = 32; 89 + } 90 + 89 91 /* 90 92 * Detect old register descriptors where only the bit_width field 91 - * makes senses. The target address is copied to handle possible 92 - * alignment issues. 93 + * makes senses. 93 94 */ 94 - ACPI_MOVE_64_TO_64(&address, &reg->address); 95 - if (!reg->bit_offset && reg->bit_width && 95 + if (reg->bit_width < max_bit_width && 96 + !reg->bit_offset && reg->bit_width && 96 97 ACPI_IS_POWER_OF_TWO(reg->bit_width) && 97 - ACPI_IS_ALIGNED(reg->bit_width, 8) && 98 - ACPI_IS_ALIGNED(address, reg->bit_width)) { 98 + ACPI_IS_ALIGNED(reg->bit_width, 8)) { 99 99 return (reg->bit_width); 100 - } else { 101 - if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { 102 - return (32); 103 - } else { 104 - return (max_bit_width); 105 - } 106 100 } 101 + return (max_bit_width); 107 102 } else { 108 103 return (1 << (reg->access_width + 2)); 109 104 }
+9
drivers/acpi/processor_throttling.c
··· 676 676 if (!pr->flags.throttling) 677 677 return -ENODEV; 678 678 679 + /* 680 + * We don't care about error returns - we just try to mark 681 + * these reserved so that nobody else is confused into thinking 682 + * that this region might be unused.. 683 + * 684 + * (In particular, allocating the IO range for Cardbus) 685 + */ 686 + request_region(pr->throttling.address, 6, "ACPI CPU throttle"); 687 + 679 688 pr->throttling.state = 0; 680 689 681 690 duty_mask = pr->throttling.state_count - 1;
+1 -1
drivers/thermal/int340x_thermal/int3406_thermal.c
··· 177 177 return -ENODEV; 178 178 d->raw_bd = bd; 179 179 180 - ret = acpi_video_get_levels(ACPI_COMPANION(&pdev->dev), &d->br); 180 + ret = acpi_video_get_levels(ACPI_COMPANION(&pdev->dev), &d->br, NULL); 181 181 if (ret) 182 182 return ret; 183 183
+4 -2
include/acpi/video.h
··· 51 51 */ 52 52 extern bool acpi_video_handles_brightness_key_presses(void); 53 53 extern int acpi_video_get_levels(struct acpi_device *device, 54 - struct acpi_video_device_brightness **dev_br); 54 + struct acpi_video_device_brightness **dev_br, 55 + int *pmax_level); 55 56 #else 56 57 static inline int acpi_video_register(void) { return 0; } 57 58 static inline void acpi_video_unregister(void) { return; } ··· 73 72 return false; 74 73 } 75 74 static inline int acpi_video_get_levels(struct acpi_device *device, 76 - struct acpi_video_device_brightness **dev_br) 75 + struct acpi_video_device_brightness **dev_br, 76 + int *pmax_level) 77 77 { 78 78 return -ENODEV; 79 79 }