From owner-cvs-src@FreeBSD.ORG Thu May 20 17:54:27 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 19B8E16A4CE for ; Thu, 20 May 2004 17:54:27 -0700 (PDT) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id E8BA943D39 for ; Thu, 20 May 2004 17:54:26 -0700 (PDT) (envelope-from nate@root.org) Received: (qmail 44468 invoked by uid 1000); 21 May 2004 00:54:28 -0000 Date: Thu, 20 May 2004 17:54:28 -0700 (PDT) From: Nate Lawson To: Peter Edwards In-Reply-To: <40AD42E5.7050101@freebsd.org> Message-ID: <20040520174908.I44439@root.org> References: <200405181653.i4IGrU6g062365@repoman.freebsd.org> <40AD42E5.7050101@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/acpica acpivar.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 00:54:27 -0000 Interesting, I didn't get that in my testing. Try this patch: Index: /sys/sys/bus.h =================================================================== RCS file: /home/ncvs/src/sys/sys/bus.h,v retrieving revision 1.58 diff -u -r1.58 bus.h --- /sys/sys/bus.h 17 Mar 2004 17:40:34 -0000 1.58 +++ /sys/sys/bus.h 21 May 2004 00:48:23 -0000 @@ -456,8 +456,9 @@ static __inline type varp ## _get_ ## var(device_t dev) \ { \ uintptr_t v; \ - BUS_READ_IVAR(device_get_parent(dev), dev, \ - ivarp ## _IVAR_ ## ivar, &v); \ + if (BUS_READ_IVAR(device_get_parent(dev), dev, \ + ivarp ## _IVAR_ ## ivar, &v) != 0) \ + v = (type) 0; \ return ((type) v); \ } \ \ I don't know if this change will be acceptable though. It's probably better to change the get function to take a pointer argument and return the value from BUS_READ_IVAR. -Nate On Fri, 21 May 2004, Peter Edwards wrote: > Hi Nate, > This appears to be the cause of a boot-time panic for me, which for some > reason only manifests itself when I've modules other than ACPI brought > in by the loader (any of agp, vesa or snd_ich) > > Unlike the methods they replace, the __BUS_ACCESSOR methods from > sys/bus.h don't seem to check the return code of BUS_READ_IVAR to return > NULL on failure. The first few frames of the panic look like this > (sorry, too early in the boot process for a dump: I can transcribe more > if you need it) > > > AcpiNsWalkNamespace() + 0x53 (contrib/dev/acpica/nswalk.c:291) > > AcpiWalkNamespace() + 0x47 (contrib/dev/acpica/nsxfeval.c:525) > > acpi_pci_attach() > > At the site of the crash: > > ChildType = ChildNode->Type > > The value of ChildNode appears to be 0xffffffff (taken from EAX), so it > looks like that's what the __BUS_ACCESSOR method is returning for a > failure. Rolling back the commit fixes the issue. > > Nate Lawson wrote: > > >njl 2004/05/18 09:53:29 PDT > > > > FreeBSD src repository > > > > Modified files: > > sys/dev/acpica acpivar.h > > Log: > > Use the simpler __BUS_ACCESSOR macros for ivars instead of defining them > > ourselves. > > > > Revision Changes Path > > 1.65 +3 -56 src/sys/dev/acpica/acpivar.h > > > > > > >