From owner-freebsd-hardware@FreeBSD.ORG Fri May 3 17:20:21 2013 Return-Path: Delivered-To: hardware@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E520449B; Fri, 3 May 2013 17:20:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id C4F6F12D7; Fri, 3 May 2013 17:20:21 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2E6F0B9BB; Fri, 3 May 2013 13:20:21 -0400 (EDT) From: John Baldwin To: Alex Keda Subject: Re: No ATA disks on 9.1 Date: Fri, 3 May 2013 12:41:36 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <5182CA25.9030001@lissyara.su> In-Reply-To: <5182CA25.9030001@lissyara.su> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201305031241.36538.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 03 May 2013 13:20:21 -0400 (EDT) Cc: hardware@freebsd.org, current@freebsd.org X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 May 2013 17:20:22 -0000 On Thursday, May 02, 2013 4:18:45 pm Alex Keda wrote: > see begin in: > http://lists.freebsd.org/pipermail/freebsd-current/2012-November/038000.html Hmm, what I see is that hdac0 is affected by this, but it's a bit odd. Can you try the patch below, but can you also get the output of 'devinfo -u' and 'devinfo -rv' from the 9.0 kernel? Index: /home/jhb/work/freebsd/svn/head/sys/dev/pci/pci.c =================================================================== --- /home/jhb/work/freebsd/svn/head/sys/dev/pci/pci.c (revision 250212) +++ /home/jhb/work/freebsd/svn/head/sys/dev/pci/pci.c (working copy) @@ -2816,13 +2816,37 @@ */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, prefetch ? RF_PREFETCHABLE : 0); +#if 0 + if (res == NULL && (start != 0 || end != ~0ul)) { + /* + * If the allocation fails, try to allocate a resource for + * this BAR using any available range. The firmware felt + * it was important enough to assign a resource, so don't + * disable decoding if we can help it. + */ + resource_list_delete(rl, type, reg); + start = 0; + end = ~0ul; + resource_list_add(rl, type, reg, 0, ~0ul, count); + resource_list_add(rl, type, reg, start, end, count); + res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, + count, prefetch ? RF_PREFETCHABLE : 0); + } +#endif if (res == NULL) { /* * If the allocation fails, delete the resource list entry - * to force pci_alloc_resource() to allocate resources - * from the parent. + * and disable decoding for this device. + * + * If the driver requests this resource in the future, + * pci_reserve_map() will try to allocate fresh resources. */ resource_list_delete(rl, type, reg); + pci_disable_io(dev, type); + device_printf(bus, + "pci%d:%d:%d:%d bar %#x failed to allocate\n", + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev), reg); } else { start = rman_get_start(res); pci_write_bar(dev, pm, start); -- John Baldwin