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

Commit f4cb707e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ACPI and power management fixes from Rafael Wysocki:
 "These are regression fixes (ACPI hotplug, cpufreq, hibernation, ACPI
  LPSS driver), fixes for stuff that never worked correctly (ACPI GPIO
  support in some cases and a wrong sign of an error code in the ACPI
  core in one place), and one blacklist item for ACPI backlight
  handling.

  Specifics:

   - Revert of a recent hibernation core commit that introduced a NULL
     pointer dereference during resume for at least one user (Rafael J
     Wysocki).

   - Fix for the ACPI LPSS (Low-Power Subsystem) driver to disable
     asynchronous PM callback execution for LPSS devices during system
     suspend/resume (introduced in 3.16) which turns out to break
     ordering expectations on some systems.  From Fu Zhonghui.

   - cpufreq core fix related to the handling of sysfs nodes during
     system suspend/resume that has been broken for intel_pstate since
     3.15 from Lan Tianyu.

   - Restore the generation of "online" uevents for ACPI container
     devices that was removed in 3.14, but some user space utilities
     turn out to need them (Rafael J Wysocki).

   - The cpufreq core fails to release a lock in an error code path
     after changes made in 3.14.  Fix from Prarit Bhargava.

   - ACPICA and ACPI/GPIO fixes to make the handling of ACPI GPIO
     operation regions (which means AML using GPIOs) work correctly in
     all cases from Bob Moore and Srinivas Pandruvada.

   - Fix for a wrong sign of the ACPI core's create_modalias() return
     value in case of an error from Mika Westerberg.

   - ACPI backlight blacklist entry for ThinkPad X201s from Aaron Lu"

* tag 'pm+acpi-3.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  Revert "PM / Hibernate: Iterate over set bits instead of PFNs in swsusp_free()"
  gpio / ACPI: Use pin index and bit length
  ACPICA: Update to GPIO region handler interface.
  ACPI / platform / LPSS: disable async suspend/resume of LPSS devices
  cpufreq: release policy->rwsem on error
  cpufreq: fix cpufreq suspend/resume for intel_pstate
  ACPI / scan: Correct error return value of create_modalias()
  ACPI / video: disable native backlight for ThinkPad X201s
  ACPI / hotplug: Generate online uevents for ACPI containers
parents 12df9f37 381e63da
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -419,7 +419,6 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
	adev->driver_data = pdata;
	adev->driver_data = pdata;
	pdev = acpi_create_platform_device(adev);
	pdev = acpi_create_platform_device(adev);
	if (!IS_ERR_OR_NULL(pdev)) {
	if (!IS_ERR_OR_NULL(pdev)) {
		device_enable_async_suspend(&pdev->dev);
		return 1;
		return 1;
	}
	}


+1 −0
Original line number Original line Diff line number Diff line
@@ -254,6 +254,7 @@ struct acpi_create_field_info {
	u32 field_bit_position;
	u32 field_bit_position;
	u32 field_bit_length;
	u32 field_bit_length;
	u16 resource_length;
	u16 resource_length;
	u16 pin_number_index;
	u8 field_flags;
	u8 field_flags;
	u8 attribute;
	u8 attribute;
	u8 field_type;
	u8 field_type;
+1 −0
Original line number Original line Diff line number Diff line
@@ -264,6 +264,7 @@ struct acpi_object_region_field {
	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO u16 resource_length;
	ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO u16 resource_length;
	union acpi_operand_object *region_obj;	/* Containing op_region object */
	union acpi_operand_object *region_obj;	/* Containing op_region object */
	u8 *resource_buffer;	/* resource_template for serial regions/fields */
	u8 *resource_buffer;	/* resource_template for serial regions/fields */
	u16 pin_number_index;	/* Index relative to previous Connection/Template */
};
};


struct acpi_object_bank_field {
struct acpi_object_bank_field {
+2 −0
Original line number Original line Diff line number Diff line
@@ -360,6 +360,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
			 */
			 */
			info->resource_buffer = NULL;
			info->resource_buffer = NULL;
			info->connection_node = NULL;
			info->connection_node = NULL;
			info->pin_number_index = 0;


			/*
			/*
			 * A Connection() is either an actual resource descriptor (buffer)
			 * A Connection() is either an actual resource descriptor (buffer)
@@ -437,6 +438,7 @@ acpi_ds_get_field_names(struct acpi_create_field_info *info,
			}
			}


			info->field_bit_position += info->field_bit_length;
			info->field_bit_position += info->field_bit_length;
			info->pin_number_index++;	/* Index relative to previous Connection() */
			break;
			break;


		default:
		default:
+31 −16
Original line number Original line Diff line number Diff line
@@ -142,6 +142,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
	union acpi_operand_object *region_obj2;
	union acpi_operand_object *region_obj2;
	void *region_context = NULL;
	void *region_context = NULL;
	struct acpi_connection_info *context;
	struct acpi_connection_info *context;
	acpi_physical_address address;


	ACPI_FUNCTION_TRACE(ev_address_space_dispatch);
	ACPI_FUNCTION_TRACE(ev_address_space_dispatch);


@@ -231,25 +232,32 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
	/* We have everything we need, we can invoke the address space handler */
	/* We have everything we need, we can invoke the address space handler */


	handler = handler_desc->address_space.handler;
	handler = handler_desc->address_space.handler;

	address = (region_obj->region.address + region_offset);
	ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
			  "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
			  &region_obj->region.handler->address_space, handler,
			  ACPI_FORMAT_NATIVE_UINT(region_obj->region.address +
						  region_offset),
			  acpi_ut_get_region_name(region_obj->region.
						  space_id)));


	/*
	/*
	 * Special handling for generic_serial_bus and general_purpose_io:
	 * Special handling for generic_serial_bus and general_purpose_io:
	 * There are three extra parameters that must be passed to the
	 * There are three extra parameters that must be passed to the
	 * handler via the context:
	 * handler via the context:
	 *   1) Connection buffer, a resource template from Connection() op.
	 *   1) Connection buffer, a resource template from Connection() op
	 *   2) Length of the above buffer.
	 *   2) Length of the above buffer
	 *   3) Actual access length from the access_as() op.
	 *   3) Actual access length from the access_as() op
	 *
	 * In addition, for general_purpose_io, the Address and bit_width fields
	 * are defined as follows:
	 *   1) Address is the pin number index of the field (bit offset from
	 *      the previous Connection)
	 *   2) bit_width is the actual bit length of the field (number of pins)
	 */
	 */
	if (((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) ||
	if ((region_obj->region.space_id == ACPI_ADR_SPACE_GSBUS) &&
	     (region_obj->region.space_id == ACPI_ADR_SPACE_GPIO)) &&
	    context && field_obj) {

		/* Get the Connection (resource_template) buffer */

		context->connection = field_obj->field.resource_buffer;
		context->length = field_obj->field.resource_length;
		context->access_length = field_obj->field.access_length;
	}
	if ((region_obj->region.space_id == ACPI_ADR_SPACE_GPIO) &&
	    context && field_obj) {
	    context && field_obj) {


		/* Get the Connection (resource_template) buffer */
		/* Get the Connection (resource_template) buffer */
@@ -257,8 +265,17 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
		context->connection = field_obj->field.resource_buffer;
		context->connection = field_obj->field.resource_buffer;
		context->length = field_obj->field.resource_length;
		context->length = field_obj->field.resource_length;
		context->access_length = field_obj->field.access_length;
		context->access_length = field_obj->field.access_length;
		address = field_obj->field.pin_number_index;
		bit_width = field_obj->field.bit_length;
	}
	}


	ACPI_DEBUG_PRINT((ACPI_DB_OPREGION,
			  "Handler %p (@%p) Address %8.8X%8.8X [%s]\n",
			  &region_obj->region.handler->address_space, handler,
			  ACPI_FORMAT_NATIVE_UINT(address),
			  acpi_ut_get_region_name(region_obj->region.
						  space_id)));

	if (!(handler_desc->address_space.handler_flags &
	if (!(handler_desc->address_space.handler_flags &
	      ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
	      ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)) {
		/*
		/*
@@ -271,9 +288,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,


	/* Call the handler */
	/* Call the handler */


	status = handler(function,
	status = handler(function, address, bit_width, value, context,
			 (region_obj->region.address + region_offset),
			 bit_width, value, context,
			 region_obj2->extra.region_context);
			 region_obj2->extra.region_context);


	if (ACPI_FAILURE(status)) {
	if (ACPI_FAILURE(status)) {
Loading