AcpiOsAcquireObject crash [Was: 9-Stable panic: resource_list_unreserve: can't find resource]

Andriy Gapon avg at FreeBSD.org
Fri Nov 9 13:46:07 UTC 2012


on 09/11/2012 14:17 Tom Lislegaard said the following:
> kgdb) up 7
> #7  0xffffffff802d1bdd in AcpiOsAcquireObject (Cache=0xfffffe00052bac60) at /usr/src/sys/contrib/dev/acpica/utilities/utcache.c:316
> 316	        ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
> (kgdb) x/9a Cache->ListHead
> 0xfffffffeec85c730:	Cannot access memory at address 0xfffffffeec85c730

[Slaps forehead] Ah, right, indeed.
I guess the problem hasn't happened again since then?
Does the patch appear to work OK so far (with respect to the original problem)?

I have a suspicion about what causes the new problem.
If it is correct then the following experimental patch may help with it:

--- a/sys/contrib/dev/acpica/components/utilities/utdelete.c
+++ b/sys/contrib/dev/acpica/components/utilities/utdelete.c
@@ -415,6 +415,8 @@ AcpiUtUpdateRefCount (
         return;
     }

+    (void) AcpiUtAcquireMutex (ACPI_MTX_REFCOUNTS);
+
     Count = Object->Common.ReferenceCount;
     NewCount = Count;

@@ -490,6 +492,8 @@ AcpiUtUpdateRefCount (
         ACPI_WARNING ((AE_INFO,
             "Large Reference Count (0x%X) in object %p", Count, Object));
     }
+
+    (void) AcpiUtReleaseMutex (ACPI_MTX_REFCOUNTS);
 }



--- a/sys/contrib/dev/acpica/include/aclocal.h
+++ b/sys/contrib/dev/acpica/include/aclocal.h
@@ -89,8 +89,9 @@ union acpi_parse_object;
 #define ACPI_MTX_MEMORY                 5   /* Debug memory tracking lists */
 #define ACPI_MTX_DEBUG_CMD_COMPLETE     6   /* AML debugger */
 #define ACPI_MTX_DEBUG_CMD_READY        7   /* AML debugger */
+#define ACPI_MTX_REFCOUNTS              8   /* ACPI object reference counts */

-#define ACPI_MAX_MUTEX                  7
+#define ACPI_MAX_MUTEX                  8
 #define ACPI_NUM_MUTEX                  ACPI_MAX_MUTEX+1



-- 
Andriy Gapon


More information about the freebsd-acpi mailing list