Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108499
b: refs/heads/master
c: 2500822
h: refs/heads/master
i:
  108497: a6fc3a1
  108495: ee1b029
v: v3
  • Loading branch information
Zhao Yakui authored and Andi Kleen committed Aug 15, 2008
1 parent 9f8353e commit 8ceeabb
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 55 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c7db22a194d3b53584047425af82b4e1e03d9f7
refs/heads/master: 2500822bf4eb0179ef80e5b072c1e0fa83037381
34 changes: 34 additions & 0 deletions trunk/drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@ static struct acpi_ec {
u8 handlers_installed;
} *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
-------------------------------------------------------------------------- */
Expand Down Expand Up @@ -911,6 +936,15 @@ int __init acpi_ec_ecdt_probe(void)
pr_info(PREFIX "EC description table is found, configuring boot EC\n");
boot_ec->command_addr = ecdt_ptr->control.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->handle = ACPI_ROOT_OBJECT;
acpi_get_handle(ACPI_ROOT_OBJECT, ecdt_ptr->id, &boot_ec->handle);
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/acpi/executer/exconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,5 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle)

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);
}
34 changes: 12 additions & 22 deletions trunk/drivers/acpi/namespace/nsnames.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,13 @@ ACPI_MODULE_NAME("nsnames")
* Size - Size of the pathname
* *name_buffer - Where to return the pathname
*
* RETURN: Status
* Places the pathname into the name_buffer, in external format
* RETURN: Places the pathname into the name_buffer, in external format
* (name segments separated by path separators)
*
* DESCRIPTION: Generate a full pathaname
*
******************************************************************************/
acpi_status
void
acpi_ns_build_external_path(struct acpi_namespace_node *node,
acpi_size size, char *name_buffer)
{
Expand All @@ -78,7 +77,7 @@ acpi_ns_build_external_path(struct acpi_namespace_node *node,
if (index < ACPI_NAME_SIZE) {
name_buffer[0] = AML_ROOT_PREFIX;
name_buffer[1] = 0;
return (AE_OK);
return;
}

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

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

return (AE_BAD_PARAMETER);
}

return (AE_OK);
return;
}

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

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

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

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

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

/* Build the path in the allocated buffer */

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

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

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

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

/* Build the path in the caller buffer */

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

ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%X]\n",
(char *)buffer->pointer, (u32) required_size));
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/acpi/resources/rscalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,9 +587,6 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,
} else {
temp_size_needed +=
acpi_ns_get_pathname_length((*sub_object_list)->reference.node);
if (!temp_size_needed) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}
}
} else {
/*
Expand Down
8 changes: 3 additions & 5 deletions trunk/drivers/acpi/utilities/utalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,10 @@ acpi_ut_initialize_buffer(struct acpi_buffer * buffer,
{
acpi_status status = AE_OK;

/* Parameter validation */

if (!buffer || !required_length) {
return (AE_BAD_PARAMETER);
if (!required_length) {
WARN_ON(1);
return AE_ERROR;
}

switch (buffer->length) {
case ACPI_NO_BUFFER:

Expand Down
13 changes: 2 additions & 11 deletions trunk/drivers/acpi/utilities/utdelete.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,25 +135,16 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
obj_pointer = object->package.elements;
break;

/*
* These objects have a possible list of notify handlers.
* Device object also may have a GPE block.
*/
case ACPI_TYPE_DEVICE:

if (object->device.gpe_block) {
(void)acpi_ev_delete_gpe_block(object->device.
gpe_block);
}

/*lint -fallthrough */

case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL:

/* Walk the notify handler list for this object */
/* Walk the handler list for this device */

handler_desc = object->common_notify.handler;
handler_desc = object->device.handler;
while (handler_desc) {
next_desc = handler_desc->address_space.next;
acpi_ut_remove_reference(handler_desc);
Expand Down
13 changes: 4 additions & 9 deletions trunk/drivers/acpi/utilities/utobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,6 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
acpi_size * obj_length)
{
acpi_size length;
acpi_size size;
acpi_status status = AE_OK;

ACPI_FUNCTION_TRACE_PTR(ut_get_simple_object_size, internal_object);
Expand Down Expand Up @@ -485,14 +484,10 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
* Get the actual length of the full pathname to this object.
* The reference will be converted to the pathname to the object
*/
size =
acpi_ns_get_pathname_length(internal_object->
reference.node);
if (!size) {
return_ACPI_STATUS(AE_BAD_PARAMETER);
}

length += ACPI_ROUND_UP_TO_NATIVE_WORD(size);
length +=
ACPI_ROUND_UP_TO_NATIVE_WORD
(acpi_ns_get_pathname_length
(internal_object->reference.node));
break;

default:
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/acpi/acnamesp.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info *info);
*/
u32 acpi_ns_opens_scope(acpi_object_type type);

acpi_status
void
acpi_ns_build_external_path(struct acpi_namespace_node *node,
acpi_size size, char *name_buffer);

Expand Down

0 comments on commit 8ceeabb

Please sign in to comment.