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

Commit ffaa5b98 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6:
  ACPI: Fix thermal shutdowns
  ACPI: bounds check IRQ to prevent memory corruption
  ACPI: Avoid bogus EC timeout when EC is in Polling mode
  ACPI : Add the EC dmi table to fix the incorrect ECDT table
  ACPI: Properly clear flags on false-positives and send uevent on sudden unplug
  acpi: trivial cleanups
  acer-wmi: Fix wireless and bluetooth on early AMW0 v2 laptops
  ACPI: WMI: Set instance for query block calls
  ACPICA: Additional error checking for pathname utilities
  ACPICA: Fix possible memory leak in Unload() operator
  ACPICA: Fix memory leak when deleting thermal/processor objects
parents 024b246e 0f245623
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -563,9 +563,6 @@ EXPORT_SYMBOL_GPL(unregister_hotplug_dock_device);
 */
 */
static int handle_eject_request(struct dock_station *ds, u32 event)
static int handle_eject_request(struct dock_station *ds, u32 event)
{
{
	if (!dock_present(ds))
		return -ENODEV;

	if (dock_in_progress(ds))
	if (dock_in_progress(ds))
		return -EBUSY;
		return -EBUSY;


@@ -573,8 +570,16 @@ static int handle_eject_request(struct dock_station *ds, u32 event)
	 * here we need to generate the undock
	 * here we need to generate the undock
	 * event prior to actually doing the undock
	 * event prior to actually doing the undock
	 * so that the device struct still exists.
	 * so that the device struct still exists.
	 * Also, even send the dock event if the
	 * device is not present anymore
	 */
	 */
	dock_event(ds, event, UNDOCK_EVENT);
	dock_event(ds, event, UNDOCK_EVENT);

	if (!dock_present(ds)) {
		complete_undock(ds);
		return -ENODEV;
	}

	hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
	hotplug_dock_devices(ds, ACPI_NOTIFY_EJECT_REQUEST);
	undock(ds);
	undock(ds);
	eject_dock(ds);
	eject_dock(ds);
+36 −0
Original line number Original line Diff line number Diff line
@@ -110,6 +110,31 @@ static struct acpi_ec {
	u8 handlers_installed;
	u8 handlers_installed;
} *boot_ec, *first_ec;
} *boot_ec, *first_ec;


/* 
 * Some Asus system have exchanged ECDT data/command IO addresses.
 */
static int print_ecdt_error(const struct dmi_system_id *id)
{
	printk(KERN_NOTICE PREFIX "%s detected - "
		"ECDT has exchanged control/data I/O address\n",
		id->ident);
	return 0;
}

static struct dmi_system_id __cpuinitdata ec_dmi_table[] = {
	{
	print_ecdt_error, "Asus L4R", {
	DMI_MATCH(DMI_BIOS_VERSION, "1008.006"),
	DMI_MATCH(DMI_PRODUCT_NAME, "L4R"),
	DMI_MATCH(DMI_BOARD_NAME, "L4R") }, NULL},
	{
	print_ecdt_error, "Asus M6R", {
	DMI_MATCH(DMI_BIOS_VERSION, "0207"),
	DMI_MATCH(DMI_PRODUCT_NAME, "M6R"),
	DMI_MATCH(DMI_BOARD_NAME, "M6R") }, NULL},
	{},
};

/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
                             Transaction Management
                             Transaction Management
   -------------------------------------------------------------------------- */
   -------------------------------------------------------------------------- */
@@ -196,6 +221,8 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
				return 0;
				return 0;
			msleep(1);
			msleep(1);
		}
		}
		if (acpi_ec_check_status(ec,event))
			return 0;
	}
	}
	pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n",
	pr_err(PREFIX "acpi_ec_wait timeout, status = 0x%2.2x, event = %s\n",
		acpi_ec_read_status(ec),
		acpi_ec_read_status(ec),
@@ -911,6 +938,15 @@ int __init acpi_ec_ecdt_probe(void)
		pr_info(PREFIX "EC description table is found, configuring boot EC\n");
		pr_info(PREFIX "EC description table is found, configuring boot EC\n");
		boot_ec->command_addr = ecdt_ptr->control.address;
		boot_ec->command_addr = ecdt_ptr->control.address;
		boot_ec->data_addr = ecdt_ptr->data.address;
		boot_ec->data_addr = ecdt_ptr->data.address;
		if (dmi_check_system(ec_dmi_table)) {
			/*
			 * If the board falls into ec_dmi_table, it means
			 * that ECDT table gives the incorrect command/status
			 * & data I/O address. Just fix it.
			 */
			boot_ec->data_addr = ecdt_ptr->control.address;
			boot_ec->command_addr = ecdt_ptr->data.address;
		}
		boot_ec->gpe = ecdt_ptr->gpe;
		boot_ec->gpe = ecdt_ptr->gpe;
		boot_ec->handle = ACPI_ROOT_OBJECT;
		boot_ec->handle = ACPI_ROOT_OBJECT;
		acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
		acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
+3 −0
Original line number Original line Diff line number Diff line
@@ -479,5 +479,8 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)


	acpi_tb_set_table_loaded_flag(table_index, FALSE);
	acpi_tb_set_table_loaded_flag(table_index, FALSE);


	/* Table unloaded, remove a reference to the ddb_handle object */

	acpi_ut_remove_reference(ddb_handle);
	return_ACPI_STATUS(AE_OK);
	return_ACPI_STATUS(AE_OK);
}
}
+22 −12
Original line number Original line Diff line number Diff line
@@ -56,13 +56,14 @@ ACPI_MODULE_NAME("nsnames")
 *              Size            - Size of the pathname
 *              Size            - Size of the pathname
 *              *name_buffer    - Where to return the pathname
 *              *name_buffer    - Where to return the pathname
 *
 *
 * RETURN:      Places the pathname into the name_buffer, in external format
 * RETURN:      Status
 *              Places the pathname into the name_buffer, in external format
 *              (name segments separated by path separators)
 *              (name segments separated by path separators)
 *
 *
 * DESCRIPTION: Generate a full pathaname
 * DESCRIPTION: Generate a full pathaname
 *
 *
 ******************************************************************************/
 ******************************************************************************/
void
acpi_status
acpi_ns_build_external_path(struct acpi_namespace_node *node,
acpi_ns_build_external_path(struct acpi_namespace_node *node,
			    acpi_size size, char *name_buffer)
			    acpi_size size, char *name_buffer)
{
{
@@ -77,7 +78,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
	if (index < ACPI_NAME_SIZE) {
	if (index < ACPI_NAME_SIZE) {
		name_buffer[0] = AML_ROOT_PREFIX;
		name_buffer[0] = AML_ROOT_PREFIX;
		name_buffer[1] = 0;
		name_buffer[1] = 0;
		return;
		return (AE_OK);
	}
	}


	/* Store terminator byte, then build name backwards */
	/* Store terminator byte, then build name backwards */
@@ -105,11 +106,13 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,


	if (index != 0) {
	if (index != 0) {
		ACPI_ERROR((AE_INFO,
		ACPI_ERROR((AE_INFO,
			    "Could not construct pathname; index=%X, size=%X, Path=%s",
			    "Could not construct external pathname; index=%X, size=%X, Path=%s",
			    (u32) index, (u32) size, &name_buffer[size]));
			    (u32) index, (u32) size, &name_buffer[size]));

		return (AE_BAD_PARAMETER);
	}
	}


	return;
	return (AE_OK);
}
}


#ifdef ACPI_DEBUG_OUTPUT
#ifdef ACPI_DEBUG_OUTPUT
@@ -129,6 +132,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,


char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)
{
{
	acpi_status status;
	char *name_buffer;
	char *name_buffer;
	acpi_size size;
	acpi_size size;


@@ -138,8 +142,7 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)


	size = acpi_ns_get_pathname_length(node);
	size = acpi_ns_get_pathname_length(node);
	if (!size) {
	if (!size) {
		ACPI_ERROR((AE_INFO, "Invalid node failure"));
		return (NULL);
		return_PTR(NULL);
	}
	}


	/* Allocate a buffer to be returned to caller */
	/* Allocate a buffer to be returned to caller */
@@ -152,7 +155,11 @@ char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node)


	/* Build the path in the allocated buffer */
	/* Build the path in the allocated buffer */


	acpi_ns_build_external_path(node, size, name_buffer);
	status = acpi_ns_build_external_path(node, size, name_buffer);
	if (ACPI_FAILURE(status)) {
		return (NULL);
	}

	return_PTR(name_buffer);
	return_PTR(name_buffer);
}
}
#endif
#endif
@@ -186,7 +193,7 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
	while (next_node && (next_node != acpi_gbl_root_node)) {
	while (next_node && (next_node != acpi_gbl_root_node)) {
		if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) {
		if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) {
			ACPI_ERROR((AE_INFO,
			ACPI_ERROR((AE_INFO,
				    "Invalid NS Node (%p) while traversing path",
				    "Invalid Namespace Node (%p) while traversing namespace",
				    next_node));
				    next_node));
			return 0;
			return 0;
		}
		}
@@ -234,8 +241,7 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,


	required_size = acpi_ns_get_pathname_length(node);
	required_size = acpi_ns_get_pathname_length(node);
	if (!required_size) {
	if (!required_size) {
		ACPI_ERROR((AE_INFO, "Invalid node failure"));
		return_ACPI_STATUS(AE_BAD_PARAMETER);
		return_ACPI_STATUS(AE_ERROR);
	}
	}


	/* Validate/Allocate/Clear caller buffer */
	/* Validate/Allocate/Clear caller buffer */
@@ -247,7 +253,11 @@ acpi_ns_handle_to_pathname(acpi_handle target_handle,


	/* Build the path in the caller buffer */
	/* Build the path in the caller buffer */


	status =
	    acpi_ns_build_external_path(node, required_size, buffer->pointer);
	    acpi_ns_build_external_path(node, required_size, buffer->pointer);
	if (ACPI_FAILURE(status)) {
		return_ACPI_STATUS(status);
	}


	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n",
	ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n",
			  (char *)buffer->pointer, (u32) required_size));
			  (char *)buffer->pointer, (u32) required_size));
+7 −5
Original line number Original line Diff line number Diff line
@@ -849,7 +849,7 @@ static int __init acpi_irq_penalty_update(char *str, int used)
		if (irq < 0)
		if (irq < 0)
			continue;
			continue;


		if (irq >= ACPI_MAX_IRQS)
		if (irq >= ARRAY_SIZE(acpi_irq_penalty))
			continue;
			continue;


		if (used)
		if (used)
@@ -872,11 +872,13 @@ static int __init acpi_irq_penalty_update(char *str, int used)
 */
 */
void acpi_penalize_isa_irq(int irq, int active)
void acpi_penalize_isa_irq(int irq, int active)
{
{
	if (irq >= 0 && irq < ARRAY_SIZE(acpi_irq_penalty)) {
		if (active)
		if (active)
			acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
			acpi_irq_penalty[irq] += PIRQ_PENALTY_ISA_USED;
		else
		else
			acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
			acpi_irq_penalty[irq] += PIRQ_PENALTY_PCI_USING;
	}
	}
}


/*
/*
 * Over-ride default table to reserve additional IRQs for use by ISA
 * Over-ride default table to reserve additional IRQs for use by ISA
Loading