Date: Tue, 08 Oct 2002 11:55:39 -0400 (EDT) From: John Baldwin <jhb@FreeBSD.org> To: John Baldwin <jhb@FreeBSD.org> Cc: cvs-all@FreeBSD.org, cvs-committers@FreeBSD.org Subject: RE: cvs commit: src/sys/dev/acpica acpi.c Message-ID: <XFMail.20021008115539.jhb@FreeBSD.org> In-Reply-To: <200210081544.g98FiakT043704@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.20021008115539.jhb>