fix for ThinkPad 'large reference count' problem.

from shaohua.li at intel.com
This commit is contained in:
kochi 2003-11-20 15:42:16 +00:00
parent 7959ce3d95
commit e712db964a

View File

@ -115,7 +115,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: utdelete.c,v 1.8 2003/11/09 11:51:01 kochi Exp $");
__KERNEL_RCSID(0, "$NetBSD: utdelete.c,v 1.9 2003/11/20 15:42:16 kochi Exp $");
#define __UTDELETE_C__
@ -513,6 +513,7 @@ AcpiUtUpdateObjectReference (
UINT32 i;
ACPI_GENERIC_STATE *StateList = NULL;
ACPI_GENERIC_STATE *State;
ACPI_OPERAND_OBJECT *tmp;
ACPI_FUNCTION_TRACE_PTR ("UtUpdateObjectReference", Object);
@ -549,8 +550,15 @@ AcpiUtUpdateObjectReference (
{
case ACPI_TYPE_DEVICE:
AcpiUtUpdateRefCount (Object->Device.SystemNotify, Action);
AcpiUtUpdateRefCount (Object->Device.DeviceNotify, Action);
tmp = Object->Device.SystemNotify;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->Device.SystemNotify = NULL;
AcpiUtUpdateRefCount (tmp, Action);
tmp = Object->Device.DeviceNotify;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->Device.DeviceNotify = NULL;
AcpiUtUpdateRefCount (tmp, Action);
break;
@ -573,6 +581,10 @@ AcpiUtUpdateObjectReference (
{
goto ErrorExit;
}
tmp = Object->Package.Elements[i];
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->Package.Elements[i] = NULL;
}
break;
@ -585,6 +597,10 @@ AcpiUtUpdateObjectReference (
{
goto ErrorExit;
}
tmp = Object->BufferField.BufferObj;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->BufferField.BufferObj = NULL;
break;
@ -596,6 +612,10 @@ AcpiUtUpdateObjectReference (
{
goto ErrorExit;
}
tmp = Object->Field.RegionObj;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->Field.RegionObj = NULL;
break;
@ -608,12 +628,20 @@ AcpiUtUpdateObjectReference (
goto ErrorExit;
}
tmp = Object->BankField.BankObj;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->BankField.BankObj = NULL;
Status = AcpiUtCreateUpdateStateAndPush (
Object->BankField.RegionObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
tmp = Object->BankField.RegionObj;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->BankField.RegionObj = NULL;
break;
@ -626,12 +654,20 @@ AcpiUtUpdateObjectReference (
goto ErrorExit;
}
tmp = Object->IndexField.IndexObj;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->IndexField.IndexObj = NULL;
Status = AcpiUtCreateUpdateStateAndPush (
Object->IndexField.DataObj, Action, &StateList);
if (ACPI_FAILURE (Status))
{
goto ErrorExit;
}
tmp = Object->IndexField.DataObj;
if (tmp && (tmp->Common.ReferenceCount <= 1) && Action == REF_DECREMENT)
Object->IndexField.DataObj = NULL;
break;