Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806989/?format=api
{ "id": 806989, "url": "http://patchwork.ozlabs.org/api/patches/806989/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170829073404.8885-4-aik@ozlabs.ru/", "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": "<20170829073404.8885-4-aik@ozlabs.ru>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170829073404.8885-4-aik@ozlabs.ru/", "date": "2017-08-29T07:34:01", "name": "[kernel,v2,3/6] powerpc/eeh: Remove unnecessary pointer to phb from eeh_dev", "commit_ref": "69672bd7489f8a995e9cb89655dc1dcee555dadb", "pull_url": null, "state": "accepted", "archived": false, "hash": "a1c7e39b036b6536bfc4656af9fa9d7039a8a063", "submitter": { "id": 7621, "url": "http://patchwork.ozlabs.org/api/people/7621/?format=api", "name": "Alexey Kardashevskiy", "email": "aik@ozlabs.ru" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170829073404.8885-4-aik@ozlabs.ru/mbox/", "series": [ { "id": 322, "url": "http://patchwork.ozlabs.org/api/series/322/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=322", "date": "2017-08-29T07:34:01", "name": "powerpc/eeh: Some cleanups", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/322/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806989/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806989/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 [103.22.144.68])\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 3xhL5V2NNbz9t3B\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 17:35:26 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhL5V1HX4zDqhB\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 29 Aug 2017 17:35:26 +1000 (AEST)", "from ozlabs.ru (ozlabs.ru [107.173.13.209])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xhL461YcbzDqTt\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tTue, 29 Aug 2017 17:34:14 +1000 (AEST)", "from vpl1.ozlabs.ibm.com (localhost [IPv6:::1])\n\tby ozlabs.ru (Postfix) with ESMTP id C7D6E3A60054;\n\tTue, 29 Aug 2017 03:35:19 -0400 (EDT)" ], "From": "Alexey Kardashevskiy <aik@ozlabs.ru>", "To": "linuxppc-dev@lists.ozlabs.org", "Subject": "[PATCH kernel v2 3/6] powerpc/eeh: Remove unnecessary pointer to phb\n\tfrom eeh_dev", "Date": "Tue, 29 Aug 2017 17:34:01 +1000", "Message-Id": "<20170829073404.8885-4-aik@ozlabs.ru>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": "<20170829073404.8885-1-aik@ozlabs.ru>", "References": "<20170829073404.8885-1-aik@ozlabs.ru>", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.23", "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": "Alexey Kardashevskiy <aik@ozlabs.ru>,\n\tAndrew Donnellan <andrew.donnellan@au1.ibm.com>", "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": "The eeh_dev struct already holds a pointer to pci_dn which it does not\nexist without and pci_dn itself holds the very same pointer so just\nuse it.\n\nSigned-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>\n---\nChangelog:\nv2:\n* fixed pseries platform\n---\n arch/powerpc/include/asm/eeh.h | 1 -\n arch/powerpc/kernel/eeh.c | 7 +++----\n arch/powerpc/kernel/eeh_dev.c | 2 --\n arch/powerpc/kernel/eeh_driver.c | 2 +-\n arch/powerpc/kernel/eeh_pe.c | 24 +++++++++++++-----------\n arch/powerpc/platforms/powernv/eeh-powernv.c | 5 ++---\n arch/powerpc/platforms/pseries/eeh_pseries.c | 2 +-\n 7 files changed, 20 insertions(+), 23 deletions(-)", "diff": "diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h\nindex 26a6a43f8799..777d37aa0a7f 100644\n--- a/arch/powerpc/include/asm/eeh.h\n+++ b/arch/powerpc/include/asm/eeh.h\n@@ -141,7 +141,6 @@ struct eeh_dev {\n \tstruct eeh_pe *pe;\t\t/* Associated PE\t\t*/\n \tstruct list_head list;\t\t/* Form link list in the PE\t*/\n \tstruct list_head rmv_list;\t/* Record the removed edevs\t*/\n-\tstruct pci_controller *phb;\t/* Associated PHB\t\t*/\n \tstruct pci_dn *pdn;\t\t/* Associated PCI device node\t*/\n \tstruct pci_dev *pdev;\t\t/* Associated PCI device\t*/\n \tbool in_error;\t\t\t/* Error flag for edev\t\t*/\ndiff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c\nindex 5e6887c40528..66c98c158ee3 100644\n--- a/arch/powerpc/kernel/eeh.c\n+++ b/arch/powerpc/kernel/eeh.c\n@@ -170,10 +170,10 @@ static size_t eeh_dump_dev_log(struct eeh_dev *edev, char *buf, size_t len)\n \tchar buffer[128];\n \n \tn += scnprintf(buf+n, len-n, \"%04x:%02x:%02x.%01x\\n\",\n-\t\t edev->phb->global_number, pdn->busno,\n+\t\t pdn->phb->global_number, pdn->busno,\n \t\t PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));\n \tpr_warn(\"EEH: of node=%04x:%02x:%02x.%01x\\n\",\n-\t\tedev->phb->global_number, pdn->busno,\n+\t\tpdn->phb->global_number, pdn->busno,\n \t\tPCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));\n \n \teeh_ops->read_config(pdn, PCI_VENDOR_ID, 4, &cfg);\n@@ -1064,7 +1064,7 @@ core_initcall_sync(eeh_init);\n */\n void eeh_add_device_early(struct pci_dn *pdn)\n {\n-\tstruct pci_controller *phb;\n+\tstruct pci_controller *phb = pdn ? pdn->phb : NULL;\n \tstruct eeh_dev *edev = pdn_to_eeh_dev(pdn);\n \n \tif (!edev)\n@@ -1074,7 +1074,6 @@ void eeh_add_device_early(struct pci_dn *pdn)\n \t\treturn;\n \n \t/* USB Bus children of PCI devices will not have BUID's */\n-\tphb = edev->phb;\n \tif (NULL == phb ||\n \t (eeh_has_flag(EEH_PROBE_MODE_DEVTREE) && 0 == phb->buid))\n \t\treturn;\ndiff --git a/arch/powerpc/kernel/eeh_dev.c b/arch/powerpc/kernel/eeh_dev.c\nindex d6b2ca70d14d..bdf4a3698a35 100644\n--- a/arch/powerpc/kernel/eeh_dev.c\n+++ b/arch/powerpc/kernel/eeh_dev.c\n@@ -50,7 +50,6 @@\n */\n struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)\n {\n-\tstruct pci_controller *phb = pdn->phb;\n \tstruct eeh_dev *edev;\n \n \t/* Allocate EEH device */\n@@ -64,7 +63,6 @@ struct eeh_dev *eeh_dev_init(struct pci_dn *pdn)\n \t/* Associate EEH device with OF node */\n \tpdn->edev = edev;\n \tedev->pdn = pdn;\n-\tedev->phb = phb;\n \tINIT_LIST_HEAD(&edev->list);\n \tINIT_LIST_HEAD(&edev->rmv_list);\n \ndiff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c\nindex c405c79e50cd..8b840191df59 100644\n--- a/arch/powerpc/kernel/eeh_driver.c\n+++ b/arch/powerpc/kernel/eeh_driver.c\n@@ -428,7 +428,7 @@ static void *eeh_add_virt_device(void *data, void *userdata)\n \n \tif (!(edev->physfn)) {\n \t\tpr_warn(\"%s: EEH dev %04x:%02x:%02x.%01x not for VF\\n\",\n-\t\t\t__func__, edev->phb->global_number, pdn->busno,\n+\t\t\t__func__, pdn->phb->global_number, pdn->busno,\n \t\t\tPCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));\n \t\treturn NULL;\n \t}\ndiff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c\nindex 84d79f3da7d6..419c3f07afd5 100644\n--- a/arch/powerpc/kernel/eeh_pe.c\n+++ b/arch/powerpc/kernel/eeh_pe.c\n@@ -339,11 +339,12 @@ static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev)\n int eeh_add_to_parent_pe(struct eeh_dev *edev)\n {\n \tstruct eeh_pe *pe, *parent;\n+\tstruct pci_dn *pdn = eeh_dev_to_pdn(edev);\n \n \t/* Check if the PE number is valid */\n \tif (!eeh_has_flag(EEH_VALID_PE_ZERO) && !edev->pe_config_addr) {\n \t\tpr_err(\"%s: Invalid PE#0 for edev 0x%x on PHB#%x\\n\",\n-\t\t __func__, edev->config_addr, edev->phb->global_number);\n+\t\t __func__, edev->config_addr, pdn->phb->global_number);\n \t\treturn -EINVAL;\n \t}\n \n@@ -353,7 +354,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)\n \t * PE should be composed of PCI bus and its subordinate\n \t * components.\n \t */\n-\tpe = eeh_pe_get(edev->pdn->phb, edev->pe_config_addr,\n+\tpe = eeh_pe_get(pdn->phb, edev->pe_config_addr,\n \t\t\tedev->config_addr);\n \tif (pe && !(pe->type & EEH_PE_INVALID)) {\n \t\t/* Mark the PE as type of PCI bus */\n@@ -363,7 +364,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)\n \t\t/* Put the edev to PE */\n \t\tlist_add_tail(&edev->list, &pe->edevs);\n \t\tpr_debug(\"EEH: Add %04x:%02x:%02x.%01x to Bus PE#%x\\n\",\n-\t\t\tedev->phb->global_number,\n+\t\t\t pdn->phb->global_number,\n \t\t\tedev->config_addr >> 8,\n \t\t\tPCI_SLOT(edev->config_addr & 0xFF),\n \t\t\tPCI_FUNC(edev->config_addr & 0xFF),\n@@ -386,7 +387,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)\n \n \t\tpr_debug(\"EEH: Add %04x:%02x:%02x.%01x to Device \"\n \t\t\t \"PE#%x, Parent PE#%x\\n\",\n-\t\t\tedev->phb->global_number,\n+\t\t\t pdn->phb->global_number,\n \t\t\tedev->config_addr >> 8,\n PCI_SLOT(edev->config_addr & 0xFF),\n PCI_FUNC(edev->config_addr & 0xFF),\n@@ -396,9 +397,9 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)\n \n \t/* Create a new EEH PE */\n \tif (edev->physfn)\n-\t\tpe = eeh_pe_alloc(edev->phb, EEH_PE_VF);\n+\t\tpe = eeh_pe_alloc(pdn->phb, EEH_PE_VF);\n \telse\n-\t\tpe = eeh_pe_alloc(edev->phb, EEH_PE_DEVICE);\n+\t\tpe = eeh_pe_alloc(pdn->phb, EEH_PE_DEVICE);\n \tif (!pe) {\n \t\tpr_err(\"%s: out of memory!\\n\", __func__);\n \t\treturn -ENOMEM;\n@@ -414,10 +415,10 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)\n \t */\n \tparent = eeh_pe_get_parent(edev);\n \tif (!parent) {\n-\t\tparent = eeh_phb_pe_get(edev->phb);\n+\t\tparent = eeh_phb_pe_get(pdn->phb);\n \t\tif (!parent) {\n \t\t\tpr_err(\"%s: No PHB PE is found (PHB Domain=%d)\\n\",\n-\t\t\t\t__func__, edev->phb->global_number);\n+\t\t\t\t__func__, pdn->phb->global_number);\n \t\t\tedev->pe = NULL;\n \t\t\tkfree(pe);\n \t\t\treturn -EEXIST;\n@@ -434,7 +435,7 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)\n \tedev->pe = pe;\n \tpr_debug(\"EEH: Add %04x:%02x:%02x.%01x to \"\n \t\t \"Device PE#%x, Parent PE#%x\\n\",\n-\t\t edev->phb->global_number,\n+\t\t pdn->phb->global_number,\n \t\t edev->config_addr >> 8,\n \t\t PCI_SLOT(edev->config_addr & 0xFF),\n \t\t PCI_FUNC(edev->config_addr & 0xFF),\n@@ -456,10 +457,11 @@ int eeh_rmv_from_parent_pe(struct eeh_dev *edev)\n {\n \tstruct eeh_pe *pe, *parent, *child;\n \tint cnt;\n+\tstruct pci_dn *pdn = eeh_dev_to_pdn(edev);\n \n \tif (!edev->pe) {\n \t\tpr_debug(\"%s: No PE found for device %04x:%02x:%02x.%01x\\n\",\n-\t\t\t __func__, edev->phb->global_number,\n+\t\t\t __func__, pdn->phb->global_number,\n \t\t\t edev->config_addr >> 8,\n \t\t\t PCI_SLOT(edev->config_addr & 0xFF),\n \t\t\t PCI_FUNC(edev->config_addr & 0xFF));\n@@ -722,7 +724,7 @@ static void eeh_bridge_check_link(struct eeh_dev *edev)\n \t\treturn;\n \n \tpr_debug(\"%s: Check PCIe link for %04x:%02x:%02x.%01x ...\\n\",\n-\t\t __func__, edev->phb->global_number,\n+\t\t __func__, pdn->phb->global_number,\n \t\t edev->config_addr >> 8,\n \t\t PCI_SLOT(edev->config_addr & 0xFF),\n \t\t PCI_FUNC(edev->config_addr & 0xFF));\ndiff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c\nindex ac8c01cd251c..552b0cd4e8ba 100644\n--- a/arch/powerpc/platforms/powernv/eeh-powernv.c\n+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c\n@@ -926,7 +926,6 @@ void pnv_pci_reset_secondary_bus(struct pci_dev *dev)\n static void pnv_eeh_wait_for_pending(struct pci_dn *pdn, const char *type,\n \t\t\t\t int pos, u16 mask)\n {\n-\tstruct eeh_dev *edev = pdn_to_eeh_dev(pdn);\n \tint i, status = 0;\n \n \t/* Wait for Transaction Pending bit to be cleared */\n@@ -940,7 +939,7 @@ static void pnv_eeh_wait_for_pending(struct pci_dn *pdn, const char *type,\n \n \tpr_warn(\"%s: Pending transaction while issuing %sFLR to %04x:%02x:%02x.%01x\\n\",\n \t\t__func__, type,\n-\t\tedev->phb->global_number, pdn->busno,\n+\t\tpdn->phb->global_number, pdn->busno,\n \t\tPCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));\n }\n \n@@ -1714,7 +1713,7 @@ static int pnv_eeh_restore_config(struct pci_dn *pdn)\n \tif (edev->physfn) {\n \t\tret = pnv_eeh_restore_vf_config(pdn);\n \t} else {\n-\t\tphb = edev->phb->private_data;\n+\t\tphb = pdn->phb->private_data;\n \t\tret = opal_pci_reinit(phb->opal_id,\n \t\t\t\t OPAL_REINIT_PCI_DEV, edev->config_addr);\n \t}\ndiff --git a/arch/powerpc/platforms/pseries/eeh_pseries.c b/arch/powerpc/platforms/pseries/eeh_pseries.c\nindex 1eef46d9cf30..04c8c1827549 100644\n--- a/arch/powerpc/platforms/pseries/eeh_pseries.c\n+++ b/arch/powerpc/platforms/pseries/eeh_pseries.c\n@@ -247,7 +247,7 @@ static void *pseries_eeh_probe(struct pci_dn *pdn, void *data)\n \n \t/* Initialize the fake PE */\n \tmemset(&pe, 0, sizeof(struct eeh_pe));\n-\tpe.phb = edev->phb;\n+\tpe.phb = pdn->phb;\n \tpe.config_addr = (pdn->busno << 16) | (pdn->devfn << 8);\n \n \t/* Enable EEH on the device */\n", "prefixes": [ "kernel", "v2", "3/6" ] }