Re: No ATA disks on 9.1

John Baldwin <[email protected]>
Newsgroups gmane.os.freebsd.devel.hardware
Message-ID <201305031241.36538.jhb__33162.0280318477$1367601649$gmane$org@freebsd.org>
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
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hardware
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.