From owner-p4-projects@FreeBSD.ORG Mon Mar 23 06:06:03 2015 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8D85A552; Mon, 23 Mar 2015 06:06:03 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E73A550 for ; Mon, 23 Mar 2015 06:06:03 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 201521B7 for ; Mon, 23 Mar 2015 06:06:03 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id t2N662qB045293 for ; Mon, 23 Mar 2015 06:06:02 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id t2N662P9045290 for perforce@freebsd.org; Mon, 23 Mar 2015 06:06:02 GMT (envelope-from jmg@freebsd.org) Date: Mon, 23 Mar 2015 06:06:02 GMT Message-Id: <201503230606.t2N662P9045290@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney Subject: PERFORCE change 1207527 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 06:06:03 -0000 http://p4web.freebsd.org/@@1207527?ac=10 Change 1207527 by jmg@jmg_pciehp on 2015/03/23 06:06:00 add a dtrace script that dumps the various debug points for PCIe-HP... Sponsored by: FreeBSD Foundation Affected files ... .. //depot/projects/pciehotplug/misc/pciehp.d#1 add Differences ... From owner-p4-projects@FreeBSD.ORG Mon Mar 23 06:17:16 2015 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id DF85C782; Mon, 23 Mar 2015 06:17:15 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A160D780 for ; Mon, 23 Mar 2015 06:17:15 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C58429B for ; Mon, 23 Mar 2015 06:17:15 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id t2N6HFIO048968 for ; Mon, 23 Mar 2015 06:17:15 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id t2N6HFwm048965 for perforce@freebsd.org; Mon, 23 Mar 2015 06:17:15 GMT (envelope-from jmg@freebsd.org) Date: Mon, 23 Mar 2015 06:17:15 GMT Message-Id: <201503230617.t2N6HFwm048965@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney Subject: PERFORCE change 1207528 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 06:17:16 -0000 http://p4web.freebsd.org/@@1207528?ac=10 Change 1207528 by jmg@jmg_pciehp on 2015/03/23 06:16:43 This gets pciehp working again.. turns out that you call pcib_ functions on the bus, which is dev here, not on the pcib device... You are accessing the parent's ivars, which here, pcib is the parent.. This means I can push stuff down again.. Sponsored by: The FreeBSD Foundation Affected files ... .. //depot/projects/pciehotplug/sys/dev/pci/pci.c#6 edit Differences ... ==== //depot/projects/pciehotplug/sys/dev/pci/pci.c#6 (text+ko) ==== @@ -3517,8 +3517,8 @@ int first_func; pcib = device_get_parent(dev); - domain = pcib_get_domain(pcib); - busno = pcib_get_bus(pcib); + domain = pcib_get_domain(dev); + busno = pcib_get_bus(dev); /* * Try to detect a device at slot 0, function 0. If it exists, try to From owner-p4-projects@FreeBSD.ORG Mon Mar 23 06:36:36 2015 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9DB7CA74; Mon, 23 Mar 2015 06:36:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DB16A72 for ; Mon, 23 Mar 2015 06:36:36 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48A13648 for ; Mon, 23 Mar 2015 06:36:36 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id t2N6aaLg054064 for ; Mon, 23 Mar 2015 06:36:36 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id t2N6aaSN054061 for perforce@freebsd.org; Mon, 23 Mar 2015 06:36:36 GMT (envelope-from jmg@freebsd.org) Date: Mon, 23 Mar 2015 06:36:36 GMT Message-Id: <201503230636.t2N6aaSN054061@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney Subject: PERFORCE change 1207529 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 06:36:36 -0000 http://p4web.freebsd.org/@@1207529?ac=10 Change 1207529 by jmg@jmg_pciehp on 2015/03/23 06:36:26 don't pass the domain and bus as we can easily get those from the dev... Sponsored by: FreeBSD Foundation Affected files ... .. //depot/projects/pciehotplug/sys/dev/acpica/acpi_pci.c#4 edit .. //depot/projects/pciehotplug/sys/dev/pci/pci.c#7 edit .. //depot/projects/pciehotplug/sys/dev/pci/pci_if.m#4 edit .. //depot/projects/pciehotplug/sys/dev/pci/pci_private.h#5 edit Differences ... ==== //depot/projects/pciehotplug/sys/dev/acpica/acpi_pci.c#4 (text+ko) ==== @@ -83,8 +83,7 @@ int state); static void acpi_pci_update_device(ACPI_HANDLE handle, device_t pci_child); static bus_dma_tag_t acpi_pci_get_dma_tag(device_t bus, device_t child); -static device_t acpi_pci_add_child_method(device_t, uint32_t, uint8_t, uint8_t, - uint8_t); +static device_t acpi_pci_add_child_method(device_t, uint8_t, uint8_t); #ifdef PCI_IOV static device_t acpi_pci_create_iov_child(device_t bus, device_t pf, @@ -227,12 +226,11 @@ } static device_t -acpi_pci_add_child_method(device_t dev, uint32_t d, uint8_t b, uint8_t s, +acpi_pci_add_child_method(device_t dev, uint8_t s, uint8_t f) { - return pci_add_child_size(dev, d, b, s, f, - sizeof(struct acpi_pci_devinfo)); + return pci_add_child_size(dev, s, f, sizeof(struct acpi_pci_devinfo)); } static void ==== //depot/projects/pciehotplug/sys/dev/pci/pci.c#7 (text+ko) ==== @@ -122,8 +122,7 @@ static uint16_t pci_get_rid_method(device_t dev, device_t child); static int pci_child_present(device_t, uint8_t, uint8_t, uint8_t); static int pci_bus_child_present(device_t dev, device_t child); -static device_t pci_add_child_method(device_t, uint32_t, uint8_t, - uint8_t, uint8_t); +static device_t pci_add_child_method(device_t, uint8_t, uint8_t); static struct pci_devinfo *pci_fill_devinfo(device_t pcib, int d, int b, int s, int f, uint16_t vid, uint16_t did, size_t size); @@ -3528,7 +3527,7 @@ */ if (pci_child_present(pcib, busno, 0, 0) == -1 && pci_find_dbsf(domain, busno, 0, 0) == NULL) { - child = PCI_ADD_CHILD(dev, domain, busno, 0, 0); + child = PCI_ADD_CHILD(dev, 0, 0); if (pci_enable_ari) PCIB_TRY_ENABLE_ARI(pcib, child); } @@ -3543,7 +3542,6 @@ for (s = 0; s <= maxslots; s++, first_func = 0) { pcifunchigh = 0; f = 0; - DELAY(1); /* work around AMD8111 probe failures */ hdrtype = PCIB_READ_CONFIG(pcib, busno, s, f, PCIR_HDRTYPE, 1); if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) continue; @@ -3552,7 +3550,7 @@ for (f = first_func; f <= pcifunchigh; f++) { if (pci_child_present(pcib, busno, s, f) == -1 && pci_find_dbsf(domain, busno, s, f) == NULL) - PCI_ADD_CHILD(dev, domain, busno, s, f); + PCI_ADD_CHILD(dev, s, f); } } } @@ -3623,20 +3621,24 @@ } static device_t -pci_add_child_method(device_t dev, uint32_t d, uint8_t b, uint8_t s, uint8_t f) +pci_add_child_method(device_t dev, uint8_t s, uint8_t f) { - return pci_add_child_size(dev, d, b, s, f, sizeof(struct pci_devinfo)); + return pci_add_child_size(dev, s, f, sizeof(struct pci_devinfo)); } device_t -pci_add_child_size(device_t dev, uint32_t d, uint8_t b, uint8_t s, uint8_t f, +pci_add_child_size(device_t dev, uint8_t s, uint8_t f, size_t dinfo_size) { device_t pcib; struct pci_devinfo *dinfo; + uint32_t d; + uint8_t b; pcib = device_get_parent(dev); + d = pcib_get_domain(dev); + b = pcib_get_bus(dev); dinfo = pci_read_device(pcib, d, b, s, f, dinfo_size); if (dinfo == NULL) ==== //depot/projects/pciehotplug/sys/dev/pci/pci_if.m#4 (text+ko) ==== @@ -210,8 +210,6 @@ # METHOD device_t add_child { device_t dev; - uint32_t domain; - uint8_t bus; uint8_t slot; uint8_t func; }; ==== //depot/projects/pciehotplug/sys/dev/pci/pci_private.h#5 (text+ko) ==== @@ -50,8 +50,8 @@ void pci_add_children(device_t dev); void pci_add_child(device_t bus, struct pci_devinfo *dinfo); -device_t pci_add_child_size(device_t dev, uint32_t d, uint8_t b, - uint8_t s, uint8_t f, size_t dinfo_size); +device_t pci_add_child_size(device_t dev, uint8_t s, uint8_t f, + size_t dinfo_size); device_t pci_add_iov_child(device_t bus, device_t pf, size_t dinfo_size, uint16_t rid, uint16_t vid, uint16_t did); void pci_add_resources(device_t bus, device_t dev, int force, From owner-p4-projects@FreeBSD.ORG Mon Mar 23 06:52:54 2015 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A55F0D78; Mon, 23 Mar 2015 06:52:54 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65A82D76 for ; Mon, 23 Mar 2015 06:52:54 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50D5981F for ; Mon, 23 Mar 2015 06:52:54 +0000 (UTC) Received: from skunkworks.freebsd.org ([127.0.1.74]) by skunkworks.freebsd.org (8.14.9/8.14.9) with ESMTP id t2N6qsgD060983 for ; Mon, 23 Mar 2015 06:52:54 GMT (envelope-from jmg@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.9/8.14.9/Submit) id t2N6qscu060980 for perforce@freebsd.org; Mon, 23 Mar 2015 06:52:54 GMT (envelope-from jmg@freebsd.org) Date: Mon, 23 Mar 2015 06:52:54 GMT Message-Id: <201503230652.t2N6qscu060980@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jmg@freebsd.org using -f From: John-Mark Gurney Subject: PERFORCE change 1207530 for review To: Perforce Change Reviews Precedence: bulk X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18-1 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 06:52:54 -0000 http://p4web.freebsd.org/@@1207530?ac=10 Change 1207530 by jmg@jmg_pciehp on 2015/03/23 06:51:53 simplify how resume is handled, ones we resume, NULL out, and then resume the rest.. this keeps the list of important ones in a single place... Sponsored by: FreeBSD Foundation Affected files ... .. //depot/projects/pciehotplug/sys/dev/pci/pci.c#8 edit Differences ... ==== //depot/projects/pciehotplug/sys/dev/pci/pci.c#8 (text+ko) ==== @@ -3829,20 +3829,14 @@ case PCIC_BRIDGE: case PCIC_BASEPERIPH: BUS_RESUME_CHILD(dev, child); + devlist[i] = NULL; break; } } for (i = 0; i < numdevs; i++) { child = devlist[i]; - switch (pci_get_class(child)) { - case PCIC_DISPLAY: - case PCIC_MEMORY: - case PCIC_BRIDGE: - case PCIC_BASEPERIPH: - break; - default: + if (child != NULL) BUS_RESUME_CHILD(dev, child); - } } free(devlist, M_TEMP); return (0);