Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/958765/?format=api
{ "id": 958765, "url": "http://patchwork.ozlabs.org/api/patches/958765/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20180817102645.3839621-7-arnd@arndb.de/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api", "name": "Linux PPC development", "link_name": "linuxppc-dev", "list_id": "linuxppc-dev.lists.ozlabs.org", "list_email": "linuxppc-dev@lists.ozlabs.org", "web_url": "https://github.com/linuxppc/wiki/wiki", "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git", "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/", "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/", "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}" }, "msgid": "<20180817102645.3839621-7-arnd@arndb.de>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20180817102645.3839621-7-arnd@arndb.de/", "date": "2018-08-17T10:26:36", "name": "[RFC,06/15] powerpc/pci: fold pci_create_root_bus into pcibios_scan_phb", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "f951ba2450f5ba0858a4c171c7d58b522c8f6798", "submitter": { "id": 30, "url": "http://patchwork.ozlabs.org/api/people/30/?format=api", "name": "Arnd Bergmann", "email": "arnd@arndb.de" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20180817102645.3839621-7-arnd@arndb.de/mbox/", "series": [ { "id": 61229, "url": "http://patchwork.ozlabs.org/api/series/61229/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=61229", "date": "2018-08-17T10:26:32", "name": "PCI: turn some __weak functions into callbacks", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/61229/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/958765/comments/", "check": "warning", "checks": "http://patchwork.ozlabs.org/api/patches/958765/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>", "X-Original-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Delivered-To": [ "patchwork-incoming@ozlabs.org", "linuxppc-dev@lists.ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 41sKwP5FpKz9s4Z\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 17 Aug 2018 20:59:49 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 41sKwP42tTzF1fG\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 17 Aug 2018 20:59:49 +1000 (AEST)", "from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 41sKNw33gNzDrHP\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 17 Aug 2018 20:36:00 +1000 (AEST)", "from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de\n\t(mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id\n\t0LvSJX-1fz1xG2f1H-010giE; Fri, 17 Aug 2018 12:27:17 +0200" ], "Authentication-Results": [ "ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=arndb.de", "lists.ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=arndb.de", "lists.ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=arndb.de\n\t(client-ip=212.227.17.10; helo=mout.kundenserver.de;\n\tenvelope-from=arnd@arndb.de; receiver=<UNKNOWN>)", "lists.ozlabs.org;\n\tdmarc=none (p=none dis=none) header.from=arndb.de" ], "From": "Arnd Bergmann <arnd@arndb.de>", "To": "linux-pci@vger.kernel.org,\n\tBjorn Helgaas <bhelgaas@google.com>", "Subject": "[RFC 06/15] powerpc/pci: fold pci_create_root_bus into\n\tpcibios_scan_phb", "Date": "Fri, 17 Aug 2018 12:26:36 +0200", "Message-Id": "<20180817102645.3839621-7-arnd@arndb.de>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20180817102645.3839621-1-arnd@arndb.de>", "References": "<20180817102645.3839621-1-arnd@arndb.de>", "X-Provags-ID": "V03:K1:GixNoySXnYxESLRg71MMIUbdbc//wFh3XcXU1/rjlBZzggqeBtp\n\tKPW4mj1HSwQZQBdmqQg5+/P2JSkT5CbRoRegXb4oiClTKfDQh+QKkW5IWPmMGJO014pWS9j\n\trUlg1LOuTJCptgf5uWmttL2Kdz0uSl83sfIu0nv6TbSYcbgDSSGxso8c+NkJc0Hlzvd+op6\n\tI+pz8368UQ08r7uDZiDbw==", "X-UI-Out-Filterresults": "notjunk:1; V01:K0:qvgOFMZ0I7A=:Gx0aW1QYwSmyFRDDO1zijf\n\tNctExfKrHqHaFwHYiKMrwgplqXZJhv786mqls0MMaloSXPr/w49UVp7tJ8M9S1ltt7BqG1O3G\n\tFQlGtszMTxeFd2z8kSeY5L2KP/sVQXPzbRH0jQ+oiyTpvWCAWVxKg3JS48xTNRatlUUEqlLcl\n\t+DuD+/Qptf7Kckj7LgUzpB/zqzv4C8navDWm2SAYUO5LV2zw8CO9NKDa5qGuN2bdlmGabH3b6\n\t/0iLKHYz2rP6armKkRp9ZJkdRgqq4ZxCjTz6dlfC6BMf0i+xd5LCG4rpch0Ub7KI9jzQC/LzC\n\t/LsWrtXWarm+5NbLf7xlo1ekc2uz+Obp5jJLuSQkLAs1dTl2WtcPpx2cyXYghVzEGKOLO9Xhb\n\tsT4E4LfFWY74ojFbkuv/8oo2GAsO3v9dPUlUUJmJBMjZ/P4ao8HyglOJ8RojuT5TZFlBIf5jd\n\t5ZiG/eViOUKhh74YrR0WU4yDBOTskMw5dNI4yjTFR5EnPBJaFwGiFc6oxz3wGvBLkaA5sf35z\n\tONRrc0Hccy8jXMPhgNXpGedrWSSO2nlNtSl5eu6FiSRM3Pea70h692f+++1VFOGCLJD4y3ZxS\n\tVuND2psbeV1wMGHYL1/AMGjISCdPzE/Gr/rL7BuArXiy6EMF/Jkh0sSvEmMqzhWRhiGrpSYj7\n\tGvjRvceQC3wf7DhEIDYtPJx/bIdzA7IATXd7Ei7i63uDNxagE27QJuSaFZv0TtpewAF8=", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.27", "Precedence": "list", "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>", "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>", "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>", "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>", "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>", "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>", "Cc": "Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,\n\tArnd Bergmann <arnd@arndb.de>, linux-kernel@vger.kernel.org,\n\tChristoph Hellwig <hch@infradead.org>, linux-acpi@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org", "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org", "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>" }, "content": "This slightly simplifies the pcibios_scan_phb() implementation, and\ngives us an easier point to add further fields in the pci_host_bridge\nstructure.\n\nI tried removing fields that are duplicated between pci_host_bridge\nand pci_controller (which really serve the same purpose), but\nran into the problem that we can't call pci_alloc_host_bridge()\nas early as pcibios_alloc_controller(). Some more refactoring\nis needed for that, but it could noticably clean the powerpc code\nup more.\n\nSigned-off-by: Arnd Bergmann <arnd@arndb.de>\n---\n arch/powerpc/include/asm/pci-bridge.h | 3 ++\n arch/powerpc/kernel/pci-common.c | 72 ++++++++++-----------------\n 2 files changed, 30 insertions(+), 45 deletions(-)", "diff": "diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h\nindex 94d449031b18..42ae567084d9 100644\n--- a/arch/powerpc/include/asm/pci-bridge.h\n+++ b/arch/powerpc/include/asm/pci-bridge.h\n@@ -51,8 +51,11 @@ struct pci_controller_ops {\n \n /*\n * Structure of a PCI controller (host bridge)\n+ * Some members here are duplicated in struct pci_host_bridge\n+ * and should be moved there.\n */\n struct pci_controller {\n+\tstruct pci_host_bridge *bridge;\n \tstruct pci_bus *bus;\n \tchar is_dynamic;\n #ifdef CONFIG_PPC64\ndiff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c\nindex 57ca621a32f4..096011ec8670 100644\n--- a/arch/powerpc/kernel/pci-common.c\n+++ b/arch/powerpc/kernel/pci-common.c\n@@ -1587,81 +1587,63 @@ struct device_node *pcibios_get_phb_of_node(struct pci_bus *bus)\n \treturn of_node_get(hose->dn);\n }\n \n-static struct pci_bus *pci_create_root_bus(struct device *parent, int bus,\n-\t\tstruct pci_ops *ops, void *sysdata, struct list_head *resources)\n-{\n-\tint error;\n-\tstruct pci_host_bridge *bridge;\n-\n-\tbridge = pci_alloc_host_bridge(0);\n-\tif (!bridge)\n-\t\treturn NULL;\n-\n-\tbridge->dev.parent = parent;\n-\n-\tlist_splice_init(resources, &bridge->windows);\n-\tbridge->sysdata = sysdata;\n-\tbridge->busnr = bus;\n-\tbridge->ops = ops;\n-\n-\terror = pci_register_host_bridge(bridge);\n-\tif (error < 0)\n-\t\tgoto err_out;\n-\n-\treturn bridge->bus;\n-\n-err_out:\n-\tkfree(bridge);\n-\treturn NULL;\n-}\n-\n /**\n * pci_scan_phb - Given a pci_controller, setup and scan the PCI bus\n * @hose: Pointer to the PCI host controller instance structure\n */\n void pcibios_scan_phb(struct pci_controller *hose)\n {\n-\tLIST_HEAD(resources);\n-\tstruct pci_bus *bus;\n \tstruct device_node *node = hose->dn;\n \tint mode;\n+\tstruct pci_host_bridge *bridge;\n+\tint error;\n \n \tpr_debug(\"PCI: Scanning PHB %pOF\\n\", node);\n \n+\t/* The allocation should ideally be done in pcibios_alloc_controller(),\n+\t * but pci_alloc_host_bridge() requires slab to work first */\n+\tbridge = pci_alloc_host_bridge(0);\n+\tif (!bridge)\n+\t\treturn;\n+\n \t/* Get some IO space for the new PHB */\n \tpcibios_setup_phb_io_space(hose);\n \n \t/* Wire up PHB bus resources */\n-\tpcibios_setup_phb_resources(hose, &resources);\n+\tpcibios_setup_phb_resources(hose, &bridge->windows);\n \n \those->busn.start = hose->first_busno;\n \those->busn.end\t = hose->last_busno;\n \those->busn.flags = IORESOURCE_BUS;\n-\tpci_add_resource(&resources, &hose->busn);\n+\tpci_add_resource(&bridge->windows, &hose->busn);\n+\n+\tbridge->dev.parent = hose->parent;\n+\tbridge->sysdata = hose;\n+\tbridge->busnr = hose->first_busno;\n+\tbridge->ops = hose->ops;\n \n-\t/* Create an empty bus for the toplevel */\n-\tbus = pci_create_root_bus(hose->parent, hose->first_busno,\n-\t\t\t\t hose->ops, hose, &resources);\n-\tif (bus == NULL) {\n+\terror = pci_register_host_bridge(bridge);\n+\tif (error < 0) {\n \t\tpr_err(\"Failed to create bus for PCI domain %04x\\n\",\n \t\t\those->global_number);\n-\t\tpci_free_resource_list(&resources);\n+\t\tpci_free_host_bridge(bridge);\n \t\treturn;\n \t}\n-\those->bus = bus;\n+\those->bridge = bridge;\n+\those->bus = bridge->bus;\n \n \t/* Get probe mode and perform scan */\n \tmode = PCI_PROBE_NORMAL;\n \tif (node && hose->controller_ops.probe_mode)\n-\t\tmode = hose->controller_ops.probe_mode(bus);\n+\t\tmode = hose->controller_ops.probe_mode(bridge->bus);\n \tpr_debug(\" probe mode: %d\\n\", mode);\n \tif (mode == PCI_PROBE_DEVTREE)\n-\t\tof_scan_bus(node, bus);\n+\t\tof_scan_bus(node, bridge->bus);\n \n \tif (mode == PCI_PROBE_NORMAL) {\n-\t\tpci_bus_update_busn_res_end(bus, 255);\n-\t\those->last_busno = pci_scan_child_bus(bus);\n-\t\tpci_bus_update_busn_res_end(bus, hose->last_busno);\n+\t\tpci_bus_update_busn_res_end(bridge->bus, 255);\n+\t\those->last_busno = pci_scan_child_bus(bridge->bus);\n+\t\tpci_bus_update_busn_res_end(bridge->bus, hose->last_busno);\n \t}\n \n \t/* Platform gets a chance to do some global fixups before\n@@ -1671,9 +1653,9 @@ void pcibios_scan_phb(struct pci_controller *hose)\n \t\tppc_md.pcibios_fixup_phb(hose);\n \n \t/* Configure PCI Express settings */\n-\tif (bus && !pci_has_flag(PCI_PROBE_ONLY)) {\n+\tif (bridge->bus && !pci_has_flag(PCI_PROBE_ONLY)) {\n \t\tstruct pci_bus *child;\n-\t\tlist_for_each_entry(child, &bus->children, node)\n+\t\tlist_for_each_entry(child, &bridge->bus->children, node)\n \t\t\tpcie_bus_configure_settings(child);\n \t}\n }\n", "prefixes": [ "RFC", "06/15" ] }