From owner-freebsd-current@FreeBSD.ORG Fri Apr 6 22:23:45 2007 Return-Path: X-Original-To: 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 E28D916A403; Fri, 6 Apr 2007 22:23:45 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 5CE8613C458; Fri, 6 Apr 2007 22:23:44 +0000 (UTC) (envelope-from keramida@freebsd.org) Received: from kobe.laptop (dialup137.ach.sch.gr [81.186.70.137]) (authenticated bits=128) by igloo.linux.gr (8.13.8/8.13.8/Debian-3) with ESMTP id l36MMbGg020539 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sat, 7 Apr 2007 01:22:45 +0300 Received: from kobe.laptop (kobe.laptop [127.0.0.1]) by kobe.laptop (8.13.8/8.13.8) with ESMTP id l36MMU9k040573; Sat, 7 Apr 2007 01:22:31 +0300 (EEST) (envelope-from keramida@freebsd.org) Received: (from keramida@localhost) by kobe.laptop (8.13.8/8.13.8/Submit) id l36MMSTY040572; Sat, 7 Apr 2007 01:22:28 +0300 (EEST) (envelope-from keramida@freebsd.org) Date: Sat, 7 Apr 2007 01:22:27 +0300 From: Giorgos Keramidas To: John Baldwin , Ariff Abdullah Message-ID: <20070406222227.GA1839@kobe.laptop> References: <4608A5D9.2010902@root.org> <20070327151058.5qk9etifk880g4cc@webmail.leidinger.net> <20070327140741.GA60454@kobe.laptop> <200703271227.14308.jhb@freebsd.org> <20070406211229.GB1078@kobe.laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070406211229.GB1078@kobe.laptop> X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.079, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.32, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@freebsd.org X-Spam-Status: No Cc: Alexander Leidinger , freebsd-current@freebsd.org, current@freebsd.org, S?ren Schmidt , Nate Lawson 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: Fri, 06 Apr 2007 22:23:46 -0000 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?