get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/591652/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 591652,
    "url": "http://patchwork.ozlabs.org/api/patches/591652/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1457049194-9281-7-git-send-email-gwshan@linux.vnet.ibm.com/",
    "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": "<1457049194-9281-7-git-send-email-gwshan@linux.vnet.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1457049194-9281-7-git-send-email-gwshan@linux.vnet.ibm.com/",
    "date": "2016-03-03T23:53:08",
    "name": "[v15,06/12] powerpc/eeh: Create PE for VFs",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cb30ebe115f83e9d4ef320f42083a668d678eca8",
    "submitter": {
        "id": 63923,
        "url": "http://patchwork.ozlabs.org/api/people/63923/?format=api",
        "name": "Gavin Shan",
        "email": "gwshan@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1457049194-9281-7-git-send-email-gwshan@linux.vnet.ibm.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/591652/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/591652/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 AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 9FC9C1401AD\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  4 Mar 2016 11:02:09 +1100 (AEDT)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 841821A1159\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri,  4 Mar 2016 11:02:09 +1100 (AEDT)",
            "from e23smtp08.au.ibm.com (e23smtp08.au.ibm.com [202.81.31.141])\n\t(using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 770E01A0B97\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  4 Mar 2016 10:54:40 +1100 (AEDT)",
            "from localhost\n\tby e23smtp08.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <gwshan@linux.vnet.ibm.com>; \n\tFri, 4 Mar 2016 09:54:39 +1000",
            "from d23dlp01.au.ibm.com (202.81.31.203)\n\tby e23smtp08.au.ibm.com (202.81.31.205) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tFri, 4 Mar 2016 09:54:37 +1000",
            "from d23relay09.au.ibm.com (d23relay09.au.ibm.com [9.185.63.181])\n\tby d23dlp01.au.ibm.com (Postfix) with ESMTP id D03002CE805A\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri,  4 Mar 2016 10:54:36 +1100 (EST)",
            "from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139])\n\tby d23relay09.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n\tu23NsSQl4522366\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 4 Mar 2016 10:54:36 +1100",
            "from d23av04.au.ibm.com (localhost [127.0.0.1])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id\n\tu23Ns4IZ012199\n\tfor <linuxppc-dev@lists.ozlabs.org>; Fri, 4 Mar 2016 10:54:04 +1100",
            "from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14])\n\tby d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id\n\tu23Ns4wo011843; Fri, 4 Mar 2016 10:54:04 +1100",
            "from bran.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114])\n\tby ozlabs.au.ibm.com (Postfix) with ESMTP id 46752A0275;\n\tFri,  4 Mar 2016 10:53:17 +1100 (AEDT)",
            "from gwshan (shangw.ozlabs.ibm.com [10.61.2.199])\n\tby bran.ozlabs.ibm.com (Postfix) with ESMTP id 407E3E39EB;\n\tFri,  4 Mar 2016 10:53:17 +1100 (AEDT)",
            "by gwshan (Postfix, from userid 1000)\n\tid 2E12A9424AF; Fri,  4 Mar 2016 10:53:17 +1100 (AEDT)"
        ],
        "X-IBM-Helo": "d23dlp01.au.ibm.com",
        "X-IBM-MailFrom": "gwshan@linux.vnet.ibm.com",
        "X-IBM-RcptTo": "linuxppc-dev@lists.ozlabs.org",
        "From": "Gavin Shan <gwshan@linux.vnet.ibm.com>",
        "To": "linuxppc-dev@lists.ozlabs.org",
        "Subject": "[PATCH v15 06/12] powerpc/eeh: Create PE for VFs",
        "Date": "Fri,  4 Mar 2016 10:53:08 +1100",
        "Message-Id": "<1457049194-9281-7-git-send-email-gwshan@linux.vnet.ibm.com>",
        "X-Mailer": "git-send-email 2.1.0",
        "In-Reply-To": "<1457049194-9281-1-git-send-email-gwshan@linux.vnet.ibm.com>",
        "References": "<1457049194-9281-1-git-send-email-gwshan@linux.vnet.ibm.com>",
        "X-TM-AS-MML": "disable",
        "X-Content-Scanned": "Fidelis XPS MAILER",
        "x-cbid": "16030323-0029-0000-0000-00004428AE83",
        "X-BeenThere": "linuxppc-dev@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.20",
        "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": "Wei Yang <weiyang@linux.vnet.ibm.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "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": "From: Wei Yang <weiyang@linux.vnet.ibm.com>\n\nThis creates PEs for VFs in the weak function pcibios_bus_add_device().\nThose PEs for VFs are identified with newly introduced flag EEH_PE_VF\nso that we treat them differently during EEH recovery.\n\nSigned-off-by: Wei Yang <weiyang@linux.vnet.ibm.com>\nAcked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>\n---\n arch/powerpc/include/asm/eeh.h               |  1 +\n arch/powerpc/kernel/eeh_pe.c                 | 10 ++++++++--\n arch/powerpc/platforms/powernv/eeh-powernv.c | 16 ++++++++++++++++\n 3 files changed, 25 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h\nindex 574ed49a..0c551a2 100644\n--- a/arch/powerpc/include/asm/eeh.h\n+++ b/arch/powerpc/include/asm/eeh.h\n@@ -72,6 +72,7 @@ struct pci_dn;\n #define EEH_PE_PHB\t(1 << 1)\t/* PHB PE    */\n #define EEH_PE_DEVICE \t(1 << 2)\t/* Device PE */\n #define EEH_PE_BUS\t(1 << 3)\t/* Bus PE    */\n+#define EEH_PE_VF\t(1 << 4)\t/* VF PE     */\n \n #define EEH_PE_ISOLATED\t\t(1 << 0)\t/* Isolated PE\t\t*/\n #define EEH_PE_RECOVERING\t(1 << 1)\t/* Recovering PE\t*/\ndiff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c\nindex 98f8180..edd2e04 100644\n--- a/arch/powerpc/kernel/eeh_pe.c\n+++ b/arch/powerpc/kernel/eeh_pe.c\n@@ -299,7 +299,10 @@ static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev)\n \t * EEH device already having associated PE, but\n \t * the direct parent EEH device doesn't have yet.\n \t */\n-\tpdn = pdn ? pdn->parent : NULL;\n+\tif (edev->physfn)\n+\t\tpdn = pci_get_pdn(edev->physfn);\n+\telse\n+\t\tpdn = pdn ? pdn->parent : NULL;\n \twhile (pdn) {\n \t\t/* We're poking out of PCI territory */\n \t\tparent = pdn_to_eeh_dev(pdn);\n@@ -382,7 +385,10 @@ int eeh_add_to_parent_pe(struct eeh_dev *edev)\n \t}\n \n \t/* Create a new EEH PE */\n-\tpe = eeh_pe_alloc(edev->phb, EEH_PE_DEVICE);\n+\tif (edev->physfn)\n+\t\tpe = eeh_pe_alloc(edev->phb, EEH_PE_VF);\n+\telse\n+\t\tpe = eeh_pe_alloc(edev->phb, EEH_PE_DEVICE);\n \tif (!pe) {\n \t\tpr_err(\"%s: out of memory!\\n\", __func__);\n \t\treturn -ENOMEM;\ndiff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c\nindex 8119172..830526e 100644\n--- a/arch/powerpc/platforms/powernv/eeh-powernv.c\n+++ b/arch/powerpc/platforms/powernv/eeh-powernv.c\n@@ -1503,6 +1503,22 @@ static struct eeh_ops pnv_eeh_ops = {\n \t.restore_config\t\t= pnv_eeh_restore_config\n };\n \n+void pcibios_bus_add_device(struct pci_dev *pdev)\n+{\n+\tstruct pci_dn *pdn = pci_get_pdn(pdev);\n+\n+\tif (!pdev->is_virtfn)\n+\t\treturn;\n+\n+\t/*\n+\t * The following operations will fail if VF's sysfs files\n+\t * aren't created or its resources aren't finalized.\n+\t */\n+\teeh_add_device_early(pdn);\n+\teeh_add_device_late(pdev);\n+\teeh_sysfs_add_device(pdev);\n+}\n+\n /**\n  * eeh_powernv_init - Register platform dependent EEH operations\n  *\n",
    "prefixes": [
        "v15",
        "06/12"
    ]
}