From owner-freebsd-acpi@FreeBSD.ORG Thu Apr 7 17:25:33 2011 Return-Path: Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 780B3106567C for ; Thu, 7 Apr 2011 17:25:33 +0000 (UTC) (envelope-from nate@root.org) Received: from mail.rootlabs.com (rootlabs.com [208.72.84.106]) by mx1.freebsd.org (Postfix) with ESMTP id 5722B8FC15 for ; Thu, 7 Apr 2011 17:25:33 +0000 (UTC) Received: (Postfix invoked from local network); Thu, 7 Apr 2011 10:25:32 -0700 (PDT) Message-ID: <4D9DF38B.8050703@root.org> Date: Thu, 07 Apr 2011 10:25:31 -0700 From: Nate Lawson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: freebsd-acpi@freebsd.org References: <201103281406.27334.jhb@freebsd.org> <201104061600.53572.jhb@freebsd.org> <4D9CE06C.3070002@root.org> <4D9DC1C6.4040700@FreeBSD.org> In-Reply-To: <4D9DC1C6.4040700@FreeBSD.org> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: Atheros 9285 & Atheros AR8131 X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2011 17:25:33 -0000 On 4/7/2011 6:53 AM, John Baldwin wrote: > On 4/6/11 5:51 PM, Nate Lawson wrote: >> Wow, awesome work. This is really useful for fixing a common problem. >> >> Should bus_adjust_resource() be a DEVMETHOD or is this something that >> should be done automatically within rman_alloc_resource(), possibly >> based on a device flag? > > Hmm, I had only thought of it as being a wrapper around > rman_adjust_resource(). I'm not sure what you mean by adjusting it > inside another method? Note that one of the reasons I have the current > method is that different devices may have different restrictions on how > resources can grow. For example, the PCI-PCI memory windows are aligned > on 1MB boundaries and are allocated in 1MB chunks while the I/O port > windows are aligned and allocated in 4K chunks. > > I also plan to make use of rman_adjust_resource() for PCI bus > renumbering, but in that case resources would only grow at the end, etc. > Given that, I want to keep the logic to determine which kind of > adjustment to perform in the relevant driver rather than having rman > attempt to use a generic algorithm for expanding a resource and > associated rman used for suballocation (if that makes sense). Yes, that makes sense. It's a question of complexity -- do you push a set of rules to rman and have it apply them? Or do you do the adjusting in the driver itself, which knows its own restrictions but may end up replicating some general purpose code for applying those restrictions? This seems great for now. I don't have any complaints, just musing about the future. -- Nate