get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1032817,
    "url": "http://patchwork.ozlabs.org/api/patches/1032817/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20190129150143.12681-23-mika.westerberg@linux.intel.com/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20190129150143.12681-23-mika.westerberg@linux.intel.com>",
    "list_archive_url": null,
    "date": "2019-01-29T15:01:37",
    "name": "[22/28] thunderbolt: Run tb_xdp_handle_request() in system workqueue",
    "commit_ref": null,
    "pull_url": null,
    "state": "not-applicable",
    "archived": false,
    "hash": "5931c9266600115c91259537be8f914c0e52b391",
    "submitter": {
        "id": 14534,
        "url": "http://patchwork.ozlabs.org/api/people/14534/?format=api",
        "name": "Mika Westerberg",
        "email": "mika.westerberg@linux.intel.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20190129150143.12681-23-mika.westerberg@linux.intel.com/mbox/",
    "series": [
        {
            "id": 88859,
            "url": "http://patchwork.ozlabs.org/api/series/88859/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=88859",
            "date": "2019-01-29T15:01:18",
            "name": "thunderbolt: Software connection manager improvements",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/88859/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1032817/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1032817/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming-netdev@ozlabs.org",
        "Delivered-To": "patchwork-incoming-netdev@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dmarc=none (p=none dis=none)\n\theader.from=linux.intel.com"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 43pqV86hFgz9sDP\n\tfor <patchwork-incoming-netdev@ozlabs.org>;\n\tWed, 30 Jan 2019 02:02:24 +1100 (AEDT)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1728740AbfA2PCR (ORCPT\n\t<rfc822;patchwork-incoming-netdev@ozlabs.org>);\n\tTue, 29 Jan 2019 10:02:17 -0500",
            "from mga17.intel.com ([192.55.52.151]:45434 \"EHLO mga17.intel.com\"\n\trhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP\n\tid S1728550AbfA2PB4 (ORCPT <rfc822;netdev@vger.kernel.org>);\n\tTue, 29 Jan 2019 10:01:56 -0500",
            "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Jan 2019 07:01:55 -0800",
            "from black.fi.intel.com ([10.237.72.28])\n\tby orsmga008.jf.intel.com with ESMTP; 29 Jan 2019 07:01:52 -0800",
            "by black.fi.intel.com (Postfix, from userid 1001)\n\tid 4127AB6D; Tue, 29 Jan 2019 17:01:45 +0200 (EET)"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,537,1539673200\"; d=\"scan'208\";a=\"113610583\"",
        "From": "Mika Westerberg <mika.westerberg@linux.intel.com>",
        "To": "linux-kernel@vger.kernel.org",
        "Cc": "Michael Jamet <michael.jamet@intel.com>,\n\tYehezkel Bernat <YehezkelShB@gmail.com>,\n\tAndreas Noever <andreas.noever@gmail.com>,\n\tLukas Wunner <lukas@wunner.de>, \"David S . Miller\" <davem@davemloft.net>,\n\tMika Westerberg <mika.westerberg@linux.intel.com>,\n\tAndy Shevchenko <andriy.shevchenko@linux.intel.com>,\n\tnetdev@vger.kernel.org",
        "Subject": "[PATCH 22/28] thunderbolt: Run tb_xdp_handle_request() in system\n\tworkqueue",
        "Date": "Tue, 29 Jan 2019 18:01:37 +0300",
        "Message-Id": "<20190129150143.12681-23-mika.westerberg@linux.intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190129150143.12681-1-mika.westerberg@linux.intel.com>",
        "References": "<20190129150143.12681-1-mika.westerberg@linux.intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "We run all XDomain requests during discovery in tb->wq and since it only\nruns one work at the time it means that sending back reply to the other\ndomain may be delayed too much depending whether there is an active\nXDomain discovery request running.\n\nTo make sure we can send reply to the other domain as soon as possible\nrun tb_xdp_handle_request() in system workqueue instead. Since the\ndevice can be hot-removed in the middle we need to make sure the domain\nstructure is still around when the function is run so increase reference\ncount before we schedule the reply work.\n\nSigned-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>\n---\n drivers/thunderbolt/tb.h      | 7 +++++++\n drivers/thunderbolt/xdomain.c | 6 ++++--\n 2 files changed, 11 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/thunderbolt/tb.h b/drivers/thunderbolt/tb.h\nindex 7b6d1428bfad..a85b92a6936b 100644\n--- a/drivers/thunderbolt/tb.h\n+++ b/drivers/thunderbolt/tb.h\n@@ -411,6 +411,13 @@ int tb_domain_approve_xdomain_paths(struct tb *tb, struct tb_xdomain *xd);\n int tb_domain_disconnect_xdomain_paths(struct tb *tb, struct tb_xdomain *xd);\n int tb_domain_disconnect_all_paths(struct tb *tb);\n \n+static inline struct tb *tb_domain_get(struct tb *tb)\n+{\n+\tif (tb)\n+\t\tget_device(&tb->dev);\n+\treturn tb;\n+}\n+\n static inline void tb_domain_put(struct tb *tb)\n {\n \tput_device(&tb->dev);\ndiff --git a/drivers/thunderbolt/xdomain.c b/drivers/thunderbolt/xdomain.c\nindex e27dd8beb94b..59789bdd93ac 100644\n--- a/drivers/thunderbolt/xdomain.c\n+++ b/drivers/thunderbolt/xdomain.c\n@@ -524,6 +524,8 @@ static void tb_xdp_handle_request(struct work_struct *work)\n out:\n \tkfree(xw->pkg);\n \tkfree(xw);\n+\n+\ttb_domain_put(tb);\n }\n \n static void\n@@ -538,9 +540,9 @@ tb_xdp_schedule_request(struct tb *tb, const struct tb_xdp_header *hdr,\n \n \tINIT_WORK(&xw->work, tb_xdp_handle_request);\n \txw->pkg = kmemdup(hdr, size, GFP_KERNEL);\n-\txw->tb = tb;\n+\txw->tb = tb_domain_get(tb);\n \n-\tqueue_work(tb->wq, &xw->work);\n+\tschedule_work(&xw->work);\n }\n \n /**\n",
    "prefixes": [
        "22/28"
    ]
}