From owner-freebsd-acpi@FreeBSD.ORG Wed Jun 2 16:27:17 2004 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF1A016A4CE for ; Wed, 2 Jun 2004 16:27:17 -0700 (PDT) Received: from root.org (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id B6F4143D41 for ; Wed, 2 Jun 2004 16:27:17 -0700 (PDT) (envelope-from nate@root.org) Received: (qmail 38357 invoked by uid 1000); 2 Jun 2004 23:27:19 -0000 Date: Wed, 2 Jun 2004 16:27:19 -0700 (PDT) From: Nate Lawson To: John Baldwin In-Reply-To: <200406021358.17521.jhb@FreeBSD.org> Message-ID: <20040602160338.T38138@root.org> References: <20040601141424.I29932@root.org> <20040601.163316.88476133.imp@bsdimp.com> <200406021358.17521.jhb@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-acpi@FreeBSD.org Subject: Re: Patch: Defer bus_config_intr() until bus_alloc_resource().. X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Jun 2004 23:27:18 -0000 On Wed, 2 Jun 2004, John Baldwin wrote: > Ok, summary of PITAs after an hour or so of looking into it: I appreciate your efforts. Just to recap, we're trying to work around an API design problem with bus_config_intr(). > - For the PIC mode on i386, we use bus_config_intr() after bus_setup_intr() to > set the interrupt to level/low. This can be worked around by deferring > handler setup until after acpica_machdep_init() and calling > AcpiEnableSubsystem() twice. > - There is no way (currently) to get a pointer to the resource structure > associated with rid X w/o calling bus_alloc_resource(). In fact, there is > no resource structure in which to place the IRQ configuration flags until > bus_alloc_resource(), thus for the bus_config_intr() that sets the mode for > the SCI for PIC mode above there is no resource (once you defer the > interrupt setup) and for all of the resources set via bus_set_resource() in > acpi_parse_resources() there is no resource to set the flags in, so that > info is lost unless we also hack on the resource list items to add flag > members and change that API to allow for flags to be passed around. How about adding bus_{get,set}_resource_flags(dev, int rid, int flags) and adding an "int flags" field to struct resource_list_entry? Or break the API now and add flags to the normal bus_{get,set}_resource(). This is going to be needed for other resource types in the future that have modes. > I really don't want to spend a lot of time implementing all this. Does > somebody else want to do this? The change I posted earlier is a _lot_ > simpler and smaller. Just because bus_config_intr doesn't have a counterpart for storing the config doesn't mean the right thing to do is to force every user of it to re-parse/fetch the settings they already set. I understand this is a pain but the time to contain the damage is now rather than letting it spread more. -Nate