From owner-freebsd-acpi@FreeBSD.ORG Tue Jun 1 15:11:10 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 A891216A4CE; Tue, 1 Jun 2004 15:11:10 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24DE843D58; Tue, 1 Jun 2004 15:11:10 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from ns1.xcllnt.net (localhost [127.0.0.1]) by ns1.xcllnt.net (8.12.11/8.12.11) with ESMTP id i51MB9jH021195; Tue, 1 Jun 2004 15:11:09 -0700 (PDT) (envelope-from marcel@ns1.xcllnt.net) Received: (from marcel@localhost) by ns1.xcllnt.net (8.12.11/8.12.11/Submit) id i51MB9kw021194; Tue, 1 Jun 2004 15:11:09 -0700 (PDT) (envelope-from marcel) Date: Tue, 1 Jun 2004 15:11:09 -0700 From: Marcel Moolenaar To: John Baldwin Message-ID: <20040601221109.GA21063@ns1.xcllnt.net> References: <200406011531.09077.jhb@FreeBSD.org> <200406011638.04400.jhb@FreeBSD.org> <20040601141424.I29932@root.org> <200406011742.57991.jhb@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200406011742.57991.jhb@FreeBSD.org> User-Agent: Mutt/1.5.5.1i 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: Tue, 01 Jun 2004 22:11:10 -0000 On Tue, Jun 01, 2004 at 05:42:57PM -0400, John Baldwin wrote: > > > > > I need the patch below in order to turn on bus_config_intr() when > > > > > using the I/O APICs. *snip* > > > > I appreciate what you're trying to do but I don't like this approach. *snip* > > > Well, arguably it exposes an improper layering violation when > > > bus_config_intr() was added. *snip* > > I still don't like this. *snip* > FreeBSD has no format for this and I don't really have time to add multiple > resource types (which is what ACPI does, and probably what we will need to do > eventually) to struct resource. Ok, let's relax for a minute. Clearly, the addition of bus_config_intr() was done in a biggest-bang-for-the-buck approach and I think we can assume for now that it's there in a way that isn't easily extensible. So, the root problem now is that we need to consume the ACPI info in a way that makes it available for later use, i.e., when we actually allocate the IRQ resource. The solution needs to be simple so that jhb@ can close the immediate problem and it should also be a step in the right direction, or at least not a step in the opposite direction, so that njl@ doesn't get cornered by it at some later time. Let me give the numbers: o We need 2 bits for the polarity, o We need 2 bits for the trigger mode, o r_flags is 32 bits of which only 16 are in use. Can we not stick the IRQ properties in r_flags, just like we stick the alignment properties there, remove bus_config_intr() and make sure the MD backend queries the flags for polarity and trigger (0 values will mean "default" and thus preserve backward compatibility)? This change should only affect 2 places: the place where we set the resource and the place where we actually install the interrupt and its handler. It's roughly in line with what jhb@ wants to achieve and I think it removes the code that njl@ is objecting to the most, right? Oh, and it's not intended to be pretty. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net