Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 May 2013 12:41:36 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Alex Keda <admin@lissyara.su>
Cc:        hardware@freebsd.org, current@freebsd.org
Subject:   Re: No ATA disks on 9.1
Message-ID:  <201305031241.36538.jhb@freebsd.org>
In-Reply-To: <5182CA25.9030001@lissyara.su>
References:  <5182CA25.9030001@lissyara.su>

next in thread | previous in thread | raw e-mail | index | archive | help
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, &reg, 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, &reg, 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305031241.36538.jhb>