Re: No ATA disks on 9.1

From: John Baldwin <jhb_at_freebsd.org>
Date: Fri, 3 May 2013 12:41:36 -0400
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)
_at__at_ -2816,13 +2816,37 _at__at_
 	 */
 	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
Received on Fri May 03 2013 - 15:20:21 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:37 UTC