Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eb10a7b7 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 50163203 60c07f80
Loading
Loading
Loading
Loading
+0 −9
Original line number Original line Diff line number Diff line
@@ -331,15 +331,6 @@ static int acpi_processor_get_info(struct acpi_device *device)
		pr->throttling.duty_width = acpi_gbl_FADT.duty_width;
		pr->throttling.duty_width = acpi_gbl_FADT.duty_width;


		pr->pblk = object.processor.pblk_address;
		pr->pblk = object.processor.pblk_address;

		/*
		 * We don't care about error returns - we just try to mark
		 * these reserved so that nobody else is confused into thinking
		 * that this region might be unused..
		 *
		 * (In particular, allocating the IO range for Cardbus)
		 */
		request_region(pr->throttling.address, 6, "ACPI CPU throttle");
	}
	}


	/*
	/*
+6 −3
Original line number Original line Diff line number Diff line
@@ -754,7 +754,8 @@ static int acpi_video_bqc_quirk(struct acpi_video_device *device,
}
}


int acpi_video_get_levels(struct acpi_device *device,
int acpi_video_get_levels(struct acpi_device *device,
			  struct acpi_video_device_brightness **dev_br)
			  struct acpi_video_device_brightness **dev_br,
			  int *pmax_level)
{
{
	union acpi_object *obj = NULL;
	union acpi_object *obj = NULL;
	int i, max_level = 0, count = 0, level_ac_battery = 0;
	int i, max_level = 0, count = 0, level_ac_battery = 0;
@@ -841,6 +842,8 @@ int acpi_video_get_levels(struct acpi_device *device,


	br->count = count;
	br->count = count;
	*dev_br = br;
	*dev_br = br;
	if (pmax_level)
		*pmax_level = max_level;


out:
out:
	kfree(obj);
	kfree(obj);
@@ -869,7 +872,7 @@ acpi_video_init_brightness(struct acpi_video_device *device)
	struct acpi_video_device_brightness *br = NULL;
	struct acpi_video_device_brightness *br = NULL;
	int result = -EINVAL;
	int result = -EINVAL;


	result = acpi_video_get_levels(device->dev, &br);
	result = acpi_video_get_levels(device->dev, &br, &max_level);
	if (result)
	if (result)
		return result;
		return result;
	device->brightness = br;
	device->brightness = br;
@@ -1737,7 +1740,7 @@ static void acpi_video_run_bcl_for_osi(struct acpi_video_bus *video)


	mutex_lock(&video->device_list_lock);
	mutex_lock(&video->device_list_lock);
	list_for_each_entry(dev, &video->video_device_list, entry) {
	list_for_each_entry(dev, &video->video_device_list, entry) {
		if (!acpi_video_device_lcd_query_levels(dev, &levels))
		if (!acpi_video_device_lcd_query_levels(dev->dev->handle, &levels))
			kfree(levels);
			kfree(levels);
	}
	}
	mutex_unlock(&video->device_list_lock);
	mutex_unlock(&video->device_list_lock);
+9 −14
Original line number Original line Diff line number Diff line
@@ -83,27 +83,22 @@ acpi_hw_write_multiple(u32 value,
static u8
static u8
acpi_hw_get_access_bit_width(struct acpi_generic_address *reg, u8 max_bit_width)
acpi_hw_get_access_bit_width(struct acpi_generic_address *reg, u8 max_bit_width)
{
{
	u64 address;

	if (!reg->access_width) {
	if (!reg->access_width) {
		if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
			max_bit_width = 32;
		}

		/*
		/*
		 * Detect old register descriptors where only the bit_width field
		 * Detect old register descriptors where only the bit_width field
		 * makes senses. The target address is copied to handle possible
		 * makes senses.
		 * alignment issues.
		 */
		 */
		ACPI_MOVE_64_TO_64(&address, &reg->address);
		if (reg->bit_width < max_bit_width &&
		if (!reg->bit_offset && reg->bit_width &&
		    !reg->bit_offset && reg->bit_width &&
		    ACPI_IS_POWER_OF_TWO(reg->bit_width) &&
		    ACPI_IS_POWER_OF_TWO(reg->bit_width) &&
		    ACPI_IS_ALIGNED(reg->bit_width, 8) &&
		    ACPI_IS_ALIGNED(reg->bit_width, 8)) {
		    ACPI_IS_ALIGNED(address, reg->bit_width)) {
			return (reg->bit_width);
			return (reg->bit_width);
		} else {
			if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) {
				return (32);
			} else {
				return (max_bit_width);
			}
		}
		}
		return (max_bit_width);
	} else {
	} else {
		return (1 << (reg->access_width + 2));
		return (1 << (reg->access_width + 2));
	}
	}
+9 −0
Original line number Original line Diff line number Diff line
@@ -676,6 +676,15 @@ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr)
	if (!pr->flags.throttling)
	if (!pr->flags.throttling)
		return -ENODEV;
		return -ENODEV;


	/*
	 * We don't care about error returns - we just try to mark
	 * these reserved so that nobody else is confused into thinking
	 * that this region might be unused..
	 *
	 * (In particular, allocating the IO range for Cardbus)
	 */
	request_region(pr->throttling.address, 6, "ACPI CPU throttle");

	pr->throttling.state = 0;
	pr->throttling.state = 0;


	duty_mask = pr->throttling.state_count - 1;
	duty_mask = pr->throttling.state_count - 1;
+1 −1
Original line number Original line Diff line number Diff line
@@ -177,7 +177,7 @@ static int int3406_thermal_probe(struct platform_device *pdev)
		return -ENODEV;
		return -ENODEV;
	d->raw_bd = bd;
	d->raw_bd = bd;


	ret = acpi_video_get_levels(ACPI_COMPANION(&pdev->dev), &d->br);
	ret = acpi_video_get_levels(ACPI_COMPANION(&pdev->dev), &d->br, NULL);
	if (ret)
	if (ret)
		return ret;
		return ret;


Loading