Date: Wed, 10 Jul 2013 01:30:36 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 230945 for review Message-ID: <201307100130.r6A1UaRp011126@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307100130.r6A1UaRp011126>
