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

Pull ACPI fixes from Rafael Wysocki:
"This fixes a recently introduced build issue on ARM32 and a NULL
pointer dereference in the ACPI backlight driver due to a design issue
exposed by a recent change in the ACPI bus type code.

Specifics:

- Fix a recently introduced build issue on ARM32 platforms caused by
an inadvertent header file breakage (Dave Jiang)

- Eliminate questionable usage of acpi_driver_data() in the ACPI
backlight cooling device code that leads to NULL pointer
dereferences after recent ACPI core changes (Hans de Goede)"

* tag 'acpi-6.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
ACPI: video: Use acpi_video_device for cooling-dev driver data
ACPI: Fix ARM32 platforms compile issue introduced by fw_table changes

+20 -27
+5 -9
drivers/acpi/acpi_video.c
··· 253 253 static int video_get_max_state(struct thermal_cooling_device *cooling_dev, 254 254 unsigned long *state) 255 255 { 256 - struct acpi_device *device = cooling_dev->devdata; 257 - struct acpi_video_device *video = acpi_driver_data(device); 256 + struct acpi_video_device *video = cooling_dev->devdata; 258 257 259 258 *state = video->brightness->count - ACPI_VIDEO_FIRST_LEVEL - 1; 260 259 return 0; ··· 262 263 static int video_get_cur_state(struct thermal_cooling_device *cooling_dev, 263 264 unsigned long *state) 264 265 { 265 - struct acpi_device *device = cooling_dev->devdata; 266 - struct acpi_video_device *video = acpi_driver_data(device); 266 + struct acpi_video_device *video = cooling_dev->devdata; 267 267 unsigned long long level; 268 268 int offset; 269 269 ··· 281 283 static int 282 284 video_set_cur_state(struct thermal_cooling_device *cooling_dev, unsigned long state) 283 285 { 284 - struct acpi_device *device = cooling_dev->devdata; 285 - struct acpi_video_device *video = acpi_driver_data(device); 286 + struct acpi_video_device *video = cooling_dev->devdata; 286 287 int level; 287 288 288 289 if (state >= video->brightness->count - ACPI_VIDEO_FIRST_LEVEL) ··· 1122 1125 1123 1126 strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME); 1124 1127 strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS); 1125 - device->driver_data = data; 1126 1128 1127 1129 data->device_id = device_id; 1128 1130 data->video = video; ··· 1743 1747 device->backlight->props.brightness = 1744 1748 acpi_video_get_brightness(device->backlight); 1745 1749 1746 - device->cooling_dev = thermal_cooling_device_register("LCD", 1747 - device->dev, &video_cooling_ops); 1750 + device->cooling_dev = thermal_cooling_device_register("LCD", device, 1751 + &video_cooling_ops); 1748 1752 if (IS_ERR(device->cooling_dev)) { 1749 1753 /* 1750 1754 * Set cooling_dev to NULL so we don't crash trying to free it.
+14 -14
include/linux/acpi.h
··· 15 15 #include <linux/mod_devicetable.h> 16 16 #include <linux/property.h> 17 17 #include <linux/uuid.h> 18 - #include <linux/fw_table.h> 19 18 20 19 struct irq_domain; 21 20 struct irq_domain_ops; ··· 23 24 #define _LINUX 24 25 #endif 25 26 #include <acpi/acpi.h> 27 + 28 + #ifdef CONFIG_ACPI 29 + 30 + #include <linux/list.h> 31 + #include <linux/dynamic_debug.h> 32 + #include <linux/module.h> 33 + #include <linux/mutex.h> 34 + #include <linux/fw_table.h> 35 + 36 + #include <acpi/acpi_bus.h> 37 + #include <acpi/acpi_drivers.h> 38 + #include <acpi/acpi_numa.h> 39 + #include <acpi/acpi_io.h> 40 + #include <asm/acpi.h> 26 41 27 42 #ifdef CONFIG_ACPI_TABLE_LIB 28 43 #define EXPORT_SYMBOL_ACPI_LIB(x) EXPORT_SYMBOL_NS_GPL(x, ACPI) ··· 47 34 #define __init_or_acpilib __init 48 35 #define __initdata_or_acpilib __initdata 49 36 #endif 50 - 51 - #ifdef CONFIG_ACPI 52 - 53 - #include <linux/list.h> 54 - #include <linux/dynamic_debug.h> 55 - #include <linux/module.h> 56 - #include <linux/mutex.h> 57 - 58 - #include <acpi/acpi_bus.h> 59 - #include <acpi/acpi_drivers.h> 60 - #include <acpi/acpi_numa.h> 61 - #include <acpi/acpi_io.h> 62 - #include <asm/acpi.h> 63 37 64 38 static inline acpi_handle acpi_device_handle(struct acpi_device *adev) 65 39 {
-3
include/linux/fw_table.h
··· 25 25 int count; 26 26 }; 27 27 28 - #include <linux/acpi.h> 29 - #include <acpi/acpi.h> 30 - 31 28 union acpi_subtable_headers { 32 29 struct acpi_subtable_header common; 33 30 struct acpi_hmat_structure hmat;
+1 -1
lib/fw_table.c
··· 7 7 * Copyright (C) 2023 Intel Corp. 8 8 */ 9 9 #include <linux/errno.h> 10 - #include <linux/fw_table.h> 10 + #include <linux/acpi.h> 11 11 #include <linux/init.h> 12 12 #include <linux/kernel.h> 13 13 #include <linux/string.h>