Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Dec 2012 21:25:41 +0200
From:      Andriy Gapon <avg@FreeBSD.org>
To:        Stefan Farfeleder <stefanf@FreeBSD.org>
Cc:        freebsd-acpi@FreeBSD.org
Subject:   Re: ACPI panic
Message-ID:  <50D75AB5.1040803@FreeBSD.org>
In-Reply-To: <50BF0E60.30705@FreeBSD.org>
References:  <20121125140008.GA1497@mole.fafoe.narf.at> <50B244A1.1040800@FreeBSD.org> <20121126091101.GA1469@mole.fafoe.narf.at> <50B33693.2060000@FreeBSD.org> <20121126093704.GB1469@mole.fafoe.narf.at> <50B34484.1090807@FreeBSD.org> <20121126104737.GC1469@mole.fafoe.narf.at> <50B34EEA.4000209@FreeBSD.org> <20121129084627.GA1450@mole.fafoe.narf.at> <50B7D717.4030402@FreeBSD.org> <20121204085000.GA1445@mole.fafoe.narf.at> <50BF0E60.30705@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Stefan,

long time, no news...

So, I decided to attempt a different approach to the problem.
Could you please try the following patch if you are still experiencing the
problem?  Could you please report how it goes?

My hope is that, even if the problem persist, it will be easier to debug it
using FreeBSD built-in debugging capabilities like INVARIANTS, WITNESS,
DEBUG_MEMGUARD, etc.

commit 12a6b3610b82e5370bf32f3c3ea5ac1fae46bb63
Author: Andriy Gapon <avg@icyb.net.ua>
Date:   Sun Dec 23 19:52:26 2012 +0200

    [test] acpi: use uma instead of acpica internal object cache implementation

diff --git a/sys/contrib/dev/acpica/include/platform/acfreebsd.h
b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
index d7aa7ed..2f2abd6 100644
--- a/sys/contrib/dev/acpica/include/platform/acfreebsd.h
+++ b/sys/contrib/dev/acpica/include/platform/acfreebsd.h
@@ -54,7 +54,6 @@
 #define ACPI_UINTPTR_T      uintptr_t

 #define ACPI_USE_DO_WHILE_0
-#define ACPI_USE_LOCAL_CACHE
 #define ACPI_USE_SYSTEM_CLIBRARY

 #ifdef _KERNEL
@@ -64,9 +63,11 @@
 #include <sys/systm.h>
 #include <sys/libkern.h>
 #include <machine/stdarg.h>
+#include <vm/uma.h>

 #include "opt_acpi.h"

+#define ACPI_CACHE_T        struct uma_zone
 #define ACPI_MUTEX_TYPE     ACPI_OSL_MUTEX

 #ifdef ACPI_DEBUG
diff --git a/sys/dev/acpica/Osd/OsdMemory.c b/sys/dev/acpica/Osd/OsdMemory.c
index b806642..5108f04 100644
--- a/sys/dev/acpica/Osd/OsdMemory.c
+++ b/sys/dev/acpica/Osd/OsdMemory.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/malloc.h>
 #include <vm/vm.h>
 #include <vm/pmap.h>
+#include <vm/uma.h>

 static MALLOC_DEFINE(M_ACPICA, "acpica", "ACPI CA memory pool");

@@ -143,3 +144,39 @@ AcpiOsWriteMemory(ACPI_PHYSICAL_ADDRESS Address, UINT64
Value, UINT32 Width)

     return (AE_OK);
 }
+
+ACPI_STATUS
+AcpiOsCreateCache(char *CacheName, UINT16 ObjectSize, UINT16 MaxDepth,
+    ACPI_CACHE_T **ReturnCache)
+{
+    *ReturnCache = uma_zcreate(CacheName, ObjectSize, NULL, NULL, NULL, NULL,
+	UMA_ALIGN_PTR, 0);
+    return (AE_OK);
+}
+
+ACPI_STATUS
+AcpiOsDeleteCache(ACPI_CACHE_T *Cache)
+{
+    uma_zdestroy(Cache);
+    return (AE_OK);
+}
+
+ACPI_STATUS
+AcpiOsPurgeCache(ACPI_CACHE_T *Cache)
+{
+    zone_drain(Cache);
+    return (AE_OK);
+}
+
+void *
+AcpiOsAcquireObject(ACPI_CACHE_T *Cache)
+{
+    return uma_zalloc(Cache, M_ZERO | M_WAITOK);
+}
+
+ACPI_STATUS
+AcpiOsReleaseObject(ACPI_CACHE_T *Cache, void *Object)
+{
+    uma_zfree(Cache, Object);
+    return (AE_OK);
+}

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50D75AB5.1040803>