Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jun 2011 12:00:51 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        John <jwd@slowblink.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: NEW_PCIB? pcib1: failed to allocate initial I/O port window: 0x4000-0x4fff
Message-ID:  <201106101200.51969.jhb@freebsd.org>
In-Reply-To: <20110610150015.GA78095@FreeBSD.org>
References:  <20110606002353.GA2518@slowblink.com> <201106090857.33479.jhb@freebsd.org> <20110610150015.GA78095@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, June 10, 2011 11:00:15 am John wrote:
> ----- John Baldwin's Original Message -----
> > On Thursday, June 09, 2011 2:11:16 am Andriy Gapon wrote:
> > > on 09/06/2011 01:30 John said the following:
> > > > Sorry John, here's the verbose dmesg output with your patch applied.
> > > > 
> > > > This is at the tail of the console:
> > > > 
> > > > pcib1: allocated memory range (0xf6000000-0xf6ffffff) for rid 10 of pci0:1:3:0
> > > >         map[14]: type I/O Port, range 32, base 0x4400, size  8, enabled
> > > > pcib1: failed to allocate initial I/O port window (0x4000-0x4fff,0x1000)
> > > >         map[18]: type Memory, range 32, base 0xf5ff0000, size 12, enabled
> > > > 
> > > > 
> > > > Output ends with a single 'M', not MCA as earlier.
> > > 
> > > 
> > > Just a wild guess - what happens if you revert r222537 (you might need to revert
> > > r222804 first)?
> > 
> > I think he's getting a MCA due to writing to a bad address and getting a
> > PCI-e target abort equivalent and that the screen output is broken
> > because the VGA device is what is probably getting hosed by the pcib driver.
> > 
> > Given that, I doubt the printf changes are related.
> 
> Just for grins, I decided to completely remove usb from the kernel
> to see if it might help. Nolonger prints the MCA and/or M, just
> hangs while printing out the no driver attached messages. Still
> prints out the failed to allocate messages... 

Hmmm.  Your case is a bit different.  PCI-PCI bridges have to allocate I/O
space on 4KB boundarys, so the smallest chunk it can allocate for the
resources behind your bridge is 0x4000-0x4fff which is what keeps failing.

Hmm, it's claiming that brgphy1 has some I/O ports that conflict allocated.
That makes no sense.  brgphy devices have no I/O port resources.  I think
the device_t got reused.

Can you try this perhaps to get started relative to sys/x86/x86/nexus.c:

Index: nexus.c
===================================================================
--- nexus.c	(revision 222932)
+++ nexus.c	(working copy)
@@ -388,6 +388,27 @@ nexus_alloc_resource(device_t bus, device_t child,
 	if (rm == NULL)
 		return (NULL);
 
+	/* XXX: Hack */
+	if (type == SYS_RES_IOPORT && start >= 0x4000 && start <= 0x4ffff) {
+		char *buf;
+
+		device_printf(bus, "allocating range %#lx-%#lx for child",
+		    start, end);
+		if (device_get_nameunit(child) != NULL)
+			printf(" %s", device_get_nameunit(child));
+		printf(" of %s\n", device_get_nameunit(
+		    device_get_parent(child)));
+		buf = malloc(1024, M_DEVBUF, M_WAITOK);
+		*buf = '\0';
+		bus_child_pnpinfo_str(dev, buf, 1024);
+		if (*buf != '\0')
+			printf("\t%s\n", buf);
+		*buf = '\0';
+		bus_child_location_str(dev, buf, 1024);
+		if (*buf != '\0')
+			printf("\tat %s\n", buf);
+		free(buf, M_DEVBUF);
+	}
 	rv = rman_reserve_resource(rm, start, end, count, flags, child);
 	if (rv == 0)
 		return 0;


-- 
John Baldwin



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