Date: Tue, 02 Feb 2010 10:40:23 +0800 From: Lin Ming <ming.m.lin@intel.com> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-acpi@FreeBSD.org Cc: "Moore, Robert" <robert.moore@intel.com> Subject: Re: kern/143432: [acpi] [patch] Two bugs in acpica in AcpiExReleaseMutex Message-ID: <1265078423.14186.15.camel@minggr.sh.intel.com> Resent-Message-ID: <4B719E59.4010909@icyb.net.ua> In-Reply-To: <4911F71203A09E4D9981D27F9D83085855BBCFC8@orsmsx503.amr.corp.intel.com> References: <4911F71203A09E4D9981D27F9D83085855BBCFC8@orsmsx503.amr.corp.intel.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-+akFnwk/NjPxo18vPa8t Content-Type: text/plain Content-Transfer-Encoding: 7bit Problem 1 was already fixed in release 20091214, see http://git.moblin.org/cgit.cgi/acpica/commit/?id=93324dd734d70c4aa451c3aa24dfe91b7b8ef7f9 Problem 2 is same with http://www.freebsd.org/cgi/query-pr.cgi?pr=140979 and fixed by the attached patch. We will merge it into next release. Lin Ming > -----Original Message----- > From: owner-freebsd-acpi@freebsd.org [mailto:owner-freebsd-acpi@freebsd.org] On Behalf Of linimon@FreeBSD.org > Sent: Monday, February 01, 2010 4:08 PM > To: linimon@FreeBSD.org; freebsd-bugs@FreeBSD.org; freebsd-acpi@FreeBSD.org > Subject: Re: kern/143432: [acpi] [patch] Two bugs in acpica in AcpiExReleaseMutex > > Old Synopsis: Two bugs in acpica in AcpiExReleaseMutex > New Synopsis: [acpi] [patch] Two bugs in acpica in AcpiExReleaseMutex > > Responsible-Changed-From-To: freebsd-bugs->freebsd-acpi > Responsible-Changed-By: linimon > Responsible-Changed-When: Tue Feb 2 00:07:42 UTC 2010 > Responsible-Changed-Why: > Over to maintainer(s). > > http://www.freebsd.org/cgi/query-pr.cgi?pr=143432 > _______________________________________________ > freebsd-acpi@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-acpi > To unsubscribe, send any mail to "freebsd-acpi-unsubscribe@freebsd.org" --=-+akFnwk/NjPxo18vPa8t Content-Disposition: attachment; filename="mutex.patch" Content-Type: text/x-patch; name="mutex.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit diff --git a/source/components/executer/exmutex.c b/source/components/executer/exmutex.c index d0aa9de..0a4048d 100644 --- a/source/components/executer/exmutex.c +++ b/source/components/executer/exmutex.c @@ -471,6 +471,7 @@ AcpiExReleaseMutex ( { ACPI_STATUS Status = AE_OK; UINT8 PreviousSyncLevel; + ACPI_THREAD_STATE *OwnerThread; ACPI_FUNCTION_TRACE (ExReleaseMutex); @@ -481,9 +482,11 @@ AcpiExReleaseMutex ( return_ACPI_STATUS (AE_BAD_PARAMETER); } + OwnerThread = ObjDesc->Mutex.OwnerThread; + /* The mutex must have been previously acquired in order to release it */ - if (!ObjDesc->Mutex.OwnerThread) + if (!OwnerThread) { ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], not acquired", AcpiUtGetNodeName (ObjDesc->Mutex.Node))); @@ -503,14 +506,14 @@ AcpiExReleaseMutex ( * The Mutex is owned, but this thread must be the owner. * Special case for Global Lock, any thread can release */ - if ((ObjDesc->Mutex.OwnerThread->ThreadId != WalkState->Thread->ThreadId) && + if ((OwnerThread->ThreadId != WalkState->Thread->ThreadId) && (ObjDesc != AcpiGbl_GlobalLockMutex)) { ACPI_ERROR ((AE_INFO, "Thread %p cannot release Mutex [%4.4s] acquired by thread %p", ACPI_CAST_PTR (void, WalkState->Thread->ThreadId), AcpiUtGetNodeName (ObjDesc->Mutex.Node), - ACPI_CAST_PTR (void, ObjDesc->Mutex.OwnerThread->ThreadId))); + ACPI_CAST_PTR (void, OwnerThread->ThreadId))); return_ACPI_STATUS (AE_AML_NOT_OWNER); } @@ -521,7 +524,7 @@ AcpiExReleaseMutex ( * different level can only mean that the mutex ordering rule is being * violated. This behavior is clarified in ACPI 4.0 specification. */ - if (ObjDesc->Mutex.SyncLevel != WalkState->Thread->CurrentSyncLevel) + if (ObjDesc->Mutex.SyncLevel != OwnerThread->CurrentSyncLevel) { ACPI_ERROR ((AE_INFO, "Cannot release Mutex [%4.4s], SyncLevel mismatch: mutex %d current %d", @@ -536,7 +539,7 @@ AcpiExReleaseMutex ( * acquired, but are not released in reverse order. */ PreviousSyncLevel = - WalkState->Thread->AcquiredMutexList->Mutex.OriginalSyncLevel; + OwnerThread->AcquiredMutexList->Mutex.OriginalSyncLevel; Status = AcpiExReleaseMutexObject (ObjDesc); if (ACPI_FAILURE (Status)) @@ -548,7 +551,7 @@ AcpiExReleaseMutex ( { /* Restore the previous SyncLevel */ - WalkState->Thread->CurrentSyncLevel = PreviousSyncLevel; + OwnerThread->CurrentSyncLevel = PreviousSyncLevel; } return_ACPI_STATUS (Status); } --=-+akFnwk/NjPxo18vPa8t Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org" --=-+akFnwk/NjPxo18vPa8t--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1265078423.14186.15.camel>