From owner-freebsd-current@FreeBSD.ORG Tue Apr 10 23:22:21 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6F6516A416; Tue, 10 Apr 2007 23:22:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF4A13C4AD; Tue, 10 Apr 2007 23:22:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from zion.baldwin.cx (zion.baldwin.cx [192.168.0.7]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l3ANMGl5068169; Tue, 10 Apr 2007 19:22:18 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Giorgos Keramidas Date: Tue, 10 Apr 2007 19:16:59 -0400 User-Agent: KMail/1.9.4 References: <4608A5D9.2010902@root.org> <20070406211229.GB1078@kobe.laptop> <20070406222227.GA1839@kobe.laptop> In-Reply-To: <20070406222227.GA1839@kobe.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200704101917.00245.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [192.168.0.1]); Tue, 10 Apr 2007 19:22:19 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3064/Tue Apr 10 12:25:23 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: current@freebsd.org, Ariff Abdullah , freebsd-current@freebsd.org, Nate Lawson , Alexander Leidinger , S?ren Schmidt Subject: Re: recent commits break via 8235 ata X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Apr 2007 23:22:21 -0000 On Friday 06 April 2007 18:22, Giorgos Keramidas wrote: > On 2007-04-07 00:12, Giorgos Keramidas wrote: > > On 2007-03-27 12:27, John Baldwin wrote: > > > If that is the case it's because code was using > > > rman_get_bus(handle|tag) on a resource that wasn't activated yet which > > > wouldn't have worked before the nexus changes either. Well, the bus > > > tag might have been right, but the handle for SYS_RES_MEMORY would > > > have been wrong. > > > > This is the change which stops snd_hda from working here: > > > > % Revision Changes Path > > % 1.233 +39 -55 src/sys/dev/acpica/acpi.c > > There's only one place in the sound/pci/hda/* source tree where > rman_get_bus(handle|tag)() calls are used: > > keramida@kobe:/home/keramida/hg/freebsd/src/sys/dev/sound/pci/hda$ grep -n 'rman_get_bus\(handle\|tag\)' * > hdac.c:1301: mem->mem_tag = rman_get_bustag(mem->mem_res); > hdac.c:1302: mem->mem_handle = rman_get_bushandle(mem->mem_res); > keramida@kobe:/home/keramida/hg/freebsd/src/sys/dev/sound/pci/hda$ > > [...] > > 1281 /**************************************************************************** > 1282 * int hdac_mem_alloc(struct hdac_softc *) > 1283 * > 1284 * Allocate all the bus resources necessary to speak with the physical > 1285 * controller. > 1286 ****************************************************************************/ > 1287 static int > 1288 hdac_mem_alloc(struct hdac_softc *sc) > 1289 { > 1290 struct hdac_mem *mem; > 1291 > 1292 mem = &sc->mem; > 1293 mem->mem_rid = PCIR_BAR(0); > 1294 mem->mem_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, > 1295 &mem->mem_rid, RF_ACTIVE); > 1296 if (mem->mem_res == NULL) { > 1297 device_printf(sc->dev, > 1298 "%s: Unable to allocate memory resource\n", __func__); > 1299 return (ENOMEM); > 1300 } > 1301 mem->mem_tag = rman_get_bustag(mem->mem_res); > 1302 mem->mem_handle = rman_get_bushandle(mem->mem_res); > 1303 > 1304 return (0); > 1305 } > > I'm not very familiar with the rman_get_xxx() functions, but is > there a better way to write the hdac_mem_alloc() function so that > it works with the recent acpi.c versions? This is fine, you just have to use them after activating the resource either via bus_activate_resource() or passing RF_ACTIVE to bus_alloc_resource() which the above does. -- John Baldwin