From 7beeeb163123683dc991ec457a0298e4411c61e3 Mon Sep 17 00:00:00 2001 From: YONETANI Tomokazu Date: Sat, 16 Apr 2005 08:17:02 +0000 Subject: [PATCH] Add a debug knob debug.acpi.avoid.paths, a variant of debug.acpi.avoid but without totally disabling execution of _INI and _STA. Maybe useful to narrow down the portion of namespace causing problems without messing with editing and compiling ASL. Disablement of _INI and _STA when debug.acpi.avoid is specified has been added years before to workaround interpreter crash on some systems, and I'm not sure whether the recent ACPI-CA code still crashes on those systems, but I'll leave it as is anyway for compatibility with FreeBSD. Suggested-by: Sepherosa Ziehau --- share/man/man4/acpi.4 | 6 +++++- sys/dev/acpica5/acpi.c | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/share/man/man4/acpi.4 b/share/man/man4/acpi.4 index e8b619102e..c96ed31943 100644 --- a/share/man/man4/acpi.4 +++ b/share/man/man4/acpi.4 @@ -24,7 +24,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD: src/share/man/man4/acpi.4,v 1.50 2005/02/23 07:23:35 trhodes Exp $ -.\" $DragonFly: src/share/man/man4/acpi.4,v 1.1 2005/04/06 03:25:46 y0netan1 Exp $ +.\" $DragonFly: src/share/man/man4/acpi.4,v 1.2 2005/04/16 08:17:02 y0netan1 Exp $ .\" .Dd February 13, 2005 .Dt ACPI 4 @@ -239,7 +239,11 @@ Supports acpi_video which may conflict with agp device. It is also possible to avoid portions of the ACPI namespace which may be causing problems, by listing the full path of the root of the region to be avoided in the kernel environment variable +.Va debug.acpi.avoid.paths , +or .Va debug.acpi.avoid . +The latter also disables initialization of ACPI namespace as a +workaround for systems where not doing so crashes interpreter. The object and all of its children will be ignored during the bus/children scan of the namespace. The ACPI CA code will still know about the avoided region. diff --git a/sys/dev/acpica5/acpi.c b/sys/dev/acpica5/acpi.c index b2c3c4f916..dc3d1ecd0a 100644 --- a/sys/dev/acpica5/acpi.c +++ b/sys/dev/acpica5/acpi.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.156 2004/06/05 07:25:58 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.9 2004/09/15 16:46:19 joerg Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.10 2005/04/16 08:17:02 y0netan1 Exp $ */ #include "opt_acpi.h" @@ -441,6 +441,8 @@ acpi_attach(device_t dev) * object init pass. * * For these devices, we set ACPI_NO_DEVICE_INIT and ACPI_NO_OBJECT_INIT). + * For avoiding portions of the namespace without totally disabling _INI + * and _STA, use "debug.acpi.avoid.paths". * * XXX We should arrange for the object init pass after we have attached * all our child devices, but on many systems it works here. @@ -1105,8 +1107,11 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status) ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); /* Skip this device if we think we'll have trouble with it. */ - if (acpi_avoid(handle)) + if (acpi_avoid(handle)) { + ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "not scanning '%s'\n", + acpi_name(handle))); return_ACPI_STATUS (AE_OK); + } if (ACPI_SUCCESS(AcpiGetType(handle, &type))) { switch(type) { @@ -2265,7 +2270,8 @@ acpi_avoid(ACPI_HANDLE handle) np = acpi_name(handle); if (*np == '\\') np++; - if ((env = getenv("debug.acpi.avoid")) == NULL) + if ((env = getenv("debug.acpi.avoid.paths")) == NULL && + (env = getenv("debug.acpi.avoid")) == NULL) return (0); /* Scan the avoid list checking for a match */ -- 2.11.4.GIT