From owner-p4-projects@FreeBSD.ORG Wed Jul 10 01:30:37 2013 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0054AAAF; Wed, 10 Jul 2013 01:30:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B2B22AA9 for ; Wed, 10 Jul 2013 01:30:36 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [8.8.178.74]) by mx1.freebsd.org (Postfix) with ESMTP id 8BDFB1AB5 for ; Wed, 10 Jul 2013 01:30:36 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.7/8.14.7) with ESMTP id r6A1UadX011129 for ; Wed, 10 Jul 2013 01:30:36 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.7/8.14.6/Submit) id r6A1UaRp011126 for perforce@freebsd.org; Wed, 10 Jul 2013 01:30:36 GMT (envelope-from jhb@freebsd.org) Date: Wed, 10 Jul 2013 01:30:36 GMT Message-Id: <201307100130.r6A1UaRp011126@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin Subject: PERFORCE change 230945 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.14 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2013 01:30:37 -0000 http://p4web.freebsd.org/@@230945?ac=10 Change 230945 by jhb@jhb_pippin on 2013/07/10 01:30:20 Whack at this. Affected files ... .. //depot/projects/pci/sys/x86/x86/nexus.c#13 edit Differences ... ==== //depot/projects/pci/sys/x86/x86/nexus.c#13 (text+ko) ==== @@ -372,13 +372,28 @@ struct rman *rm; int needactivate = flags & RF_ACTIVE; +#ifdef PCI_RES_BUS + if (type == PCI_RES_BUS) { + /* + * PCI bus number resources are allocated from a + * specific PCI domain. The child device must be a + * 'pcib' device which implements the pcib ivars. We + * depend on that to determine which PCI domain to + * allocate from. + */ + return (pci_domain_alloc_bus(pcib_get_domain(child), child, rid, + start, end, count, flags)); + } +#endif + /* - * If this is an allocation of the "default" range for a given RID, and - * we know what the resources for this device are (ie. they aren't maintained - * by a child bus), then work out the start/end values. + * If this is an allocation of the "default" range for a given + * RID, and we know what the resources for this device are + * (ie. they aren't maintained by a child bus), then work out + * the start/end values. */ if ((start == 0UL) && (end == ~0UL) && (count == 1)) { - if (ndev == NULL) + if (device_get_parent(child) != bus || ndev == NULL) return(NULL); rle = resource_list_find(&ndev->nx_resources, type, *rid); if (rle == NULL) @@ -388,23 +403,6 @@ count = rle->count; } -#ifdef PCI_RES_BUS - if (type == PCI_RES_BUS) { - /* - * PCI bus number resources are allocated from a - * specific PCI domain. The child device must be a - * 'pcib' device which implements the pcib ivars. We - * depend on that to determine which PCI domain to - * allocate from. - */ - rv = pci_domain_alloc_bus(pcib_get_domain(child), child, rid, - start, end, count, flags); - if (rv == NULL) - return (NULL); - rman_set_rid(rv, *rid); - return (rv); - } -#endif flags &= ~RF_ACTIVE; rm = nexus_rman(type); if (rm == NULL)