From owner-cvs-all Tue Oct 8 8:55:40 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ADFA737B401 for ; Tue, 8 Oct 2002 08:55:38 -0700 (PDT) Received: from mail.speakeasy.net (mail14.speakeasy.net [216.254.0.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 989DA43E65 for ; Tue, 8 Oct 2002 08:55:37 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 14148 invoked from network); 8 Oct 2002 15:55:37 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail14.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 8 Oct 2002 15:55:37 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id g98FtZn5006444; Tue, 8 Oct 2002 11:55:35 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200210081544.g98FiakT043704@freefall.freebsd.org> Date: Tue, 08 Oct 2002 11:55:39 -0400 (EDT) From: John Baldwin To: John Baldwin Subject: RE: cvs commit: src/sys/dev/acpica acpi.c Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 08-Oct-2002 John Baldwin wrote: > jhb 2002/10/08 08:44:36 PDT > > Modified files: > sys/dev/acpica acpi.c > Log: > Don't panic for a bad ivar request, just return ENOENT. This isn't fully correct, but it lets the TX2 probe ok. Actually, we have a rather long list of bugs here related to this: 1) PCI and ISA ivars overlap. This means a bus can't have both ISA and PCI children. Conceptually, this would be nice, but acpi0 currently breaks that rule if you consider Host/PCI bridges PCI devices. 2) None of our Host/PCI bridge parent devices provide PCI ivars for those devices, so trying to read the PCI ivars of a grandparent of a PCI device is not safe. 3) The BUS_ACCESSOR helper function (pci_get_devid(), isa_get_irq(), etc.) ignore failures. In the case of a write, we just silently fail. In the case of a read we return garbage from the stack. Some things I would like to do to address these issues: 1) Change PCI ivars base so they don't overlap with ISA. Long-term it would be nice to allow multiple named sets of ivars for a device. 2) Possibly add PCI ivars for Host/PCI bridges, though I don't think anyone really needs them to be honest. 3) Change how BUS_ACCESSOR's work so that they return an error code. Read accessors would have to take an argument to store the value in instead of returning the value. Alternatively, we could change the BUS_ACCESSOR macros to KASSERT() that the READ_IVAR and WRITE_IVAR methods never fail, and the places that it can fail (like in the ATA driver where it tries to read PCI ivars of its grandparent) would have to switch to using explicit BUS_READ_IVAR() calls so that they can detect and handle error conditions. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message