From owner-freebsd-current@FreeBSD.ORG Fri Jun 10 16:00:53 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92FC71065676 for ; Fri, 10 Jun 2011 16:00:53 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 532098FC19 for ; Fri, 10 Jun 2011 16:00:53 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id DF43D46B09; Fri, 10 Jun 2011 12:00:52 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 812C68A01F; Fri, 10 Jun 2011 12:00:52 -0400 (EDT) From: John Baldwin To: John Date: Fri, 10 Jun 2011 12:00:51 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110325; KDE/4.5.5; amd64; ; ) References: <20110606002353.GA2518@slowblink.com> <201106090857.33479.jhb@freebsd.org> <20110610150015.GA78095@FreeBSD.org> In-Reply-To: <20110610150015.GA78095@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201106101200.51969.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Fri, 10 Jun 2011 12:00:52 -0400 (EDT) Cc: freebsd-current@freebsd.org Subject: Re: NEW_PCIB? pcib1: failed to allocate initial I/O port window: 0x4000-0x4fff X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2011 16:00:53 -0000 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