Commit 82c86a33 authored by Len Brown's avatar Len Brown

Merge intel.com:/home/lenb/bk/linux-2.6.0

into intel.com:/home/lenb/bk/linux-acpi-test-2.6.0
parents 740ba8b9 e7360c40
......@@ -360,7 +360,7 @@ acpi_battery_read_info (
ACPI_FUNCTION_TRACE("acpi_battery_read_info");
if (!battery)
if (!battery || (off != 0))
goto end;
if (battery->flags.present)
......@@ -459,7 +459,7 @@ acpi_battery_read_state (
ACPI_FUNCTION_TRACE("acpi_battery_read_state");
if (!battery)
if (!battery || (off != 0))
goto end;
if (battery->flags.present)
......@@ -543,7 +543,7 @@ acpi_battery_read_alarm (
ACPI_FUNCTION_TRACE("acpi_battery_read_alarm");
if (!battery)
if (!battery || (off != 0))
goto end;
if (!battery->flags.present) {
......
......@@ -94,6 +94,13 @@ static struct acpi_ec *ec_ecdt;
/* External interfaces use first EC only, so remember */
static struct acpi_device *first_ec;
/*
* We use kernel thread to handle ec's gpe query, so the query may defer.
* The query need a context, which can be freed when we replace ec_ecdt
* with EC device. So defered query may have a wrong context.
* We use an indication to avoid it
*/
static int ec_device_init = 0;
/* --------------------------------------------------------------------------
Transaction Management
-------------------------------------------------------------------------- */
......@@ -393,8 +400,11 @@ acpi_ec_gpe_handler (
acpi_disable_gpe(NULL, ec->gpe_bit, ACPI_ISR);
status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
acpi_ec_gpe_query, ec);
if (!ec_device_init)
acpi_ec_gpe_query(ec); /* directly query when device didn't init */
else
status = acpi_os_queue_for_execution(OSD_PRIORITY_GPE,
acpi_ec_gpe_query, ec);
}
/* --------------------------------------------------------------------------
......@@ -589,6 +599,8 @@ acpi_ec_add (
we now have the *real* EC info, so kill the makeshift one.*/
acpi_evaluate_integer(ec->handle, "_UID", NULL, &uid);
if (ec_ecdt && ec_ecdt->uid == uid) {
acpi_disable_gpe(NULL, ec_ecdt->gpe_bit, ACPI_NOT_ISR);
ec_device_init = 1;
acpi_remove_address_space_handler(ACPI_ROOT_OBJECT,
ACPI_ADR_SPACE_EC, &acpi_ec_space_handler);
......
......@@ -217,8 +217,8 @@ acpi_ev_gpe_detect (
gpe_number = (i * ACPI_GPE_REGISTER_WIDTH) + j;
int_status |= acpi_ev_gpe_dispatch (
&gpe_block->event_info[gpe_number],
gpe_number + gpe_block->register_info[gpe_number].base_gpe_number);
&gpe_block->event_info[gpe_number],
j + gpe_register_info->base_gpe_number);
}
}
}
......
......@@ -416,7 +416,7 @@ acpi_ut_update_object_reference (
u32 i;
union acpi_generic_state *state_list = NULL;
union acpi_generic_state *state;
union acpi_operand_object *tmp;
ACPI_FUNCTION_TRACE_PTR ("ut_update_object_reference", object);
......@@ -448,8 +448,16 @@ acpi_ut_update_object_reference (
switch (ACPI_GET_OBJECT_TYPE (object)) {
case ACPI_TYPE_DEVICE:
acpi_ut_update_ref_count (object->device.system_notify, action);
acpi_ut_update_ref_count (object->device.device_notify, action);
tmp = object->device.system_notify;
if (tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->device.system_notify = NULL;
acpi_ut_update_ref_count (tmp, action);
tmp = object->device.device_notify;
if (tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->device.device_notify = NULL;
acpi_ut_update_ref_count (tmp, action);
break;
......@@ -470,6 +478,10 @@ acpi_ut_update_object_reference (
if (ACPI_FAILURE (status)) {
goto error_exit;
}
tmp = object->package.elements[i];
if (tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->package.elements[i] = NULL;
}
break;
......@@ -481,6 +493,10 @@ acpi_ut_update_object_reference (
if (ACPI_FAILURE (status)) {
goto error_exit;
}
tmp = object->buffer_field.buffer_obj;
if ( tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->buffer_field.buffer_obj = NULL;
break;
......@@ -491,6 +507,10 @@ acpi_ut_update_object_reference (
if (ACPI_FAILURE (status)) {
goto error_exit;
}
tmp = object->field.region_obj;
if ( tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->field.region_obj = NULL;
break;
......@@ -502,11 +522,19 @@ acpi_ut_update_object_reference (
goto error_exit;
}
tmp = object->bank_field.bank_obj;
if ( tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->bank_field.bank_obj = NULL;
status = acpi_ut_create_update_state_and_push (
object->bank_field.region_obj, action, &state_list);
if (ACPI_FAILURE (status)) {
goto error_exit;
}
tmp = object->bank_field.region_obj;
if ( tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->bank_field.region_obj = NULL;
break;
......@@ -518,11 +546,19 @@ acpi_ut_update_object_reference (
goto error_exit;
}
tmp = object->index_field.index_obj;
if ( tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->index_field.index_obj = NULL;
status = acpi_ut_create_update_state_and_push (
object->index_field.data_obj, action, &state_list);
if (ACPI_FAILURE (status)) {
goto error_exit;
}
tmp = object->index_field.data_obj;
if ( tmp && (tmp->common.reference_count <= 1) && action == REF_DECREMENT)
object->index_field.data_obj = NULL;
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment