get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 354077,
    "url": "http://patchwork.ozlabs.org/api/patches/354077/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/1401448834-32659-6-git-send-email-hdoyu@nvidia.com/",
    "project": {
        "id": 21,
        "url": "http://patchwork.ozlabs.org/api/projects/21/?format=api",
        "name": "Linux Tegra Development",
        "link_name": "linux-tegra",
        "list_id": "linux-tegra.vger.kernel.org",
        "list_email": "linux-tegra@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1401448834-32659-6-git-send-email-hdoyu@nvidia.com>",
    "list_archive_url": null,
    "date": "2014-05-30T11:20:18",
    "name": "[PATCHv8,05/21] iommu/core: add ops->{bound,unbind}_driver()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "2ee61cc5f0379eee94b3c18941680d840feac20d",
    "submitter": {
        "id": 10265,
        "url": "http://patchwork.ozlabs.org/api/people/10265/?format=api",
        "name": "Hiroshi Doyu",
        "email": "hdoyu@nvidia.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/1401448834-32659-6-git-send-email-hdoyu@nvidia.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/354077/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/354077/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-tegra-owner@vger.kernel.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 7EA021400D6\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 30 May 2014 21:20:47 +1000 (EST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753089AbaE3LUo (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 30 May 2014 07:20:44 -0400",
            "from hqemgate14.nvidia.com ([216.228.121.143]:12084 \"EHLO\n\thqemgate14.nvidia.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752368AbaE3LUn (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tFri, 30 May 2014 07:20:43 -0400",
            "from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by\n\thqemgate14.nvidia.com\n\tid <B5388699d0000>; Fri, 30 May 2014 04:21:01 -0700",
            "from hqemhub01.nvidia.com ([172.20.12.94])\n\tby hqnvupgp08.nvidia.com (PGP Universal service);\n\tFri, 30 May 2014 04:15:39 -0700",
            "from deemhub02.nvidia.com (10.21.69.138) by hqemhub01.nvidia.com\n\t(172.20.150.30) with Microsoft SMTP Server (TLS) id 8.3.342.0;\n\tFri, 30 May 2014 04:20:42 -0700",
            "from oreo.nvidia.com (10.21.65.27) by deemhub02.nvidia.com\n\t(10.21.69.138) with Microsoft SMTP Server (TLS) id 8.3.342.0;\n\tFri, 30 May 2014 13:20:40 +0200"
        ],
        "X-PGP-Universal": "processed;\n\tby hqnvupgp08.nvidia.com on Fri, 30 May 2014 04:15:39 -0700",
        "From": "Hiroshi Doyu <hdoyu@nvidia.com>",
        "To": "<linux-tegra@vger.kernel.org>",
        "Subject": "[PATCHv8 05/21] iommu/core: add ops->{bound,unbind}_driver()",
        "Date": "Fri, 30 May 2014 14:20:18 +0300",
        "Message-ID": "<1401448834-32659-6-git-send-email-hdoyu@nvidia.com>",
        "X-Mailer": "git-send-email 2.0.0.rc1.15.g7e76a2f",
        "In-Reply-To": "<1401448834-32659-1-git-send-email-hdoyu@nvidia.com>",
        "References": "<1401448834-32659-1-git-send-email-hdoyu@nvidia.com>",
        "X-NVConfidentiality": "public",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "Sender": "linux-tegra-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<linux-tegra.vger.kernel.org>",
        "X-Mailing-List": "linux-tegra@vger.kernel.org"
    },
    "content": "ops->{bound,unbind}_driver() functions are called at\nBUS_NOTIFY_{BOUND,UNBIND}_DRIVER respectively.\n\nThis is necessary to control the device population order. IOMMU master\ndevices depend on an IOMMU device instanciation. IOMMU master devices\ncan be registered to an IOMMU only after it's successfully\npopulated. This IOMMU registration is done via\nops->bound_driver(). Currently this population can be deferred if\ndepending IOMMU device hasn't yet been populated in driver core. This\ncannot be done via ops->add_device() since after add_device() device's\npopulation/instanciation can be still deferred via probe().\n\nSigned-off-by: Hiroshi Doyu <hdoyu@nvidia.com>\n---\n drivers/iommu/iommu.c | 13 +++++++++++--\n include/linux/iommu.h |  4 ++++\n 2 files changed, 15 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c\nindex e5555fcfe703..5469d361e7bc 100644\n--- a/drivers/iommu/iommu.c\n+++ b/drivers/iommu/iommu.c\n@@ -540,14 +540,23 @@ static int iommu_bus_notifier(struct notifier_block *nb,\n \t * ADD/DEL call into iommu driver ops if provided, which may\n \t * result in ADD/DEL notifiers to group->notifier\n \t */\n-\tif (action == BUS_NOTIFY_ADD_DEVICE) {\n+\tswitch (action) {\n+\tcase BUS_NOTIFY_ADD_DEVICE:\n \t\tif (ops->add_device)\n \t\t\treturn ops->add_device(dev);\n-\t} else if (action == BUS_NOTIFY_DEL_DEVICE) {\n+\tcase BUS_NOTIFY_DEL_DEVICE:\n \t\tif (ops->remove_device && dev->iommu_group) {\n \t\t\tops->remove_device(dev);\n \t\t\treturn 0;\n \t\t}\n+\tcase BUS_NOTIFY_BOUND_DRIVER:\n+\t\tif (ops->bound_driver)\n+\t\t\tops->bound_driver(dev);\n+\t\tbreak;\n+\tcase BUS_NOTIFY_UNBIND_DRIVER:\n+\t\tif (ops->unbind_driver)\n+\t\t\tops->unbind_driver(dev);\n+\t\tbreak;\n \t}\n \n \t/*\ndiff --git a/include/linux/iommu.h b/include/linux/iommu.h\nindex b96a5b2136e4..141eea25bdea 100644\n--- a/include/linux/iommu.h\n+++ b/include/linux/iommu.h\n@@ -97,6 +97,8 @@ enum iommu_attr {\n  * @domain_has_cap: domain capabilities query\n  * @add_device: add device to iommu grouping\n  * @remove_device: remove device from iommu grouping\n+ * @bound_driver: called at BUS_NOTIFY_BOUND_DRIVER\n+ * @unbind_driver: called at BUS_NOTIFY_UNBIND_DRIVER\n  * @domain_get_attr: Query domain attributes\n  * @domain_set_attr: Change domain attributes\n  * @pgsize_bitmap: bitmap of supported page sizes\n@@ -115,6 +117,8 @@ struct iommu_ops {\n \t\t\t      unsigned long cap);\n \tint (*add_device)(struct device *dev);\n \tvoid (*remove_device)(struct device *dev);\n+\tint (*bound_driver)(struct device *dev);\n+\tvoid (*unbind_driver)(struct device *dev);\n \tint (*device_group)(struct device *dev, unsigned int *groupid);\n \tint (*domain_get_attr)(struct iommu_domain *domain,\n \t\t\t       enum iommu_attr attr, void *data);\n",
    "prefixes": [
        "PATCHv8",
        "05/21"
    ]
}