get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 807571,
    "url": "http://patchwork.ozlabs.org/api/patches/807571/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170830101550.16821-2-fbarrat@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": "<20170830101550.16821-2-fbarrat@linux.vnet.ibm.com>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170830101550.16821-2-fbarrat@linux.vnet.ibm.com/",
    "date": "2017-08-30T10:15:49",
    "name": "[v2,2/3] cxl: Fix driver use count",
    "commit_ref": "197267d0356004a31c4d6b6336598f5dff3301e1",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8e981908e3de1f20ac8fd9d644b25a8be6e9ffef",
    "submitter": {
        "id": 67555,
        "url": "http://patchwork.ozlabs.org/api/people/67555/?format=api",
        "name": "Frederic Barrat",
        "email": "fbarrat@linux.vnet.ibm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170830101550.16821-2-fbarrat@linux.vnet.ibm.com/mbox/",
    "series": [
        {
            "id": 576,
            "url": "http://patchwork.ozlabs.org/api/series/576/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=576",
            "date": "2017-08-30T10:15:48",
            "name": "[v2,1/3] powerpc/mm: Export flush_all_mm()",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/576/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/807571/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807571/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 3xj1hY25ZTz9t0F\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 20:19:41 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xj1hX6WT8zDqXk\n\tfor <patchwork-incoming@ozlabs.org>;\n\tWed, 30 Aug 2017 20:19:40 +1000 (AEST)",
            "from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com\n\t[148.163.156.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xj1cM2J4FzDqMc\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tWed, 30 Aug 2017 20:16:03 +1000 (AEST)",
            "from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7UAFQhJ083682\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 30 Aug 2017 06:16:01 -0400",
            "from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2cnmg7hsb7-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Wed, 30 Aug 2017 06:16:00 -0400",
            "from localhost\n\tby e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <fbarrat@linux.vnet.ibm.com>;\n\tWed, 30 Aug 2017 11:15:58 +0100",
            "from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197)\n\tby e06smtp11.uk.ibm.com (192.168.101.141) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tWed, 30 Aug 2017 11:15:56 +0100",
            "from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com\n\t[9.149.105.59])\n\tby b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7UAFt2n22610168; Wed, 30 Aug 2017 10:15:56 GMT",
            "from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 5D66AA404D;\n\tWed, 30 Aug 2017 11:12:24 +0100 (BST)",
            "from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 7B5BCA4040;\n\tWed, 30 Aug 2017 11:12:23 +0100 (BST)",
            "from localhost.localdomain (unknown [9.164.182.241])\n\tby d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP;\n\tWed, 30 Aug 2017 11:12:23 +0100 (BST)"
        ],
        "From": "Frederic Barrat <fbarrat@linux.vnet.ibm.com>",
        "To": "mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,\n\tbenh@kernel.crashing.org, andrew.donnellan@au1.ibm.com,\n\tclombard@linux.vnet.ibm.com, vaibhav@linux.vnet.ibm.com",
        "Subject": "[PATCH v2 2/3] cxl: Fix driver use count",
        "Date": "Wed, 30 Aug 2017 12:15:49 +0200",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": "<20170830101550.16821-1-fbarrat@linux.vnet.ibm.com>",
        "References": "<20170830101550.16821-1-fbarrat@linux.vnet.ibm.com>",
        "X-TM-AS-GCONF": "00",
        "x-cbid": "17083010-0040-0000-0000-000003F45249",
        "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused",
        "x-cbparentid": "17083010-0041-0000-0000-00002094B4E0",
        "Message-Id": "<20170830101550.16821-2-fbarrat@linux.vnet.ibm.com>",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-30_04:, , signatures=0",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1708300154",
        "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": "alistair@popple.id.au",
        "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": "cxl keeps a driver use count, which is used with the hash memory model\non p8 to know when to upgrade local TLBIs to global and to trigger\ncallbacks to manage the MMU for PSL8.\n\nIf a process opens a context and closes without attaching or fails the\nattachment, the driver use count is never decremented. As a\nconsequence, TLB invalidations remain global, even if there are no\nactive cxl contexts.\n\nWe should increment the driver use count when the process is attaching\nto the cxl adapter, and not on open. It's not needed before the\nadapter starts using the context and the use count is decremented on\nthe detach path, so it makes more sense.\n\nIt affects only the user api. The kernel api is already doing The\nRight Thing.\n\nSigned-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>\nCc: stable@vger.kernel.org # v4.2+\nFixes: 7bb5d91a4dda (\"cxl: Rework context lifetimes\")\nAcked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>\n---\nChangelog:\nv2: fix typo in comments (Thanks to Andrew)\n\n drivers/misc/cxl/api.c  | 4 ++++\n drivers/misc/cxl/file.c | 8 +++++++-\n 2 files changed, 11 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c\nindex 1a138c83f877..a0c44d16bf30 100644\n--- a/drivers/misc/cxl/api.c\n+++ b/drivers/misc/cxl/api.c\n@@ -336,6 +336,10 @@ int cxl_start_context(struct cxl_context *ctx, u64 wed,\n \t\t\tmmput(ctx->mm);\n \t}\n \n+\t/*\n+\t * Increment driver use count. Enables global TLBIs for hash\n+\t * and callbacks to handle the segment table\n+\t */\n \tcxl_ctx_get();\n \n \tif ((rc = cxl_ops->attach_process(ctx, kernel, wed, 0))) {\ndiff --git a/drivers/misc/cxl/file.c b/drivers/misc/cxl/file.c\nindex 0761271d68c5..4bfad9f6dc9f 100644\n--- a/drivers/misc/cxl/file.c\n+++ b/drivers/misc/cxl/file.c\n@@ -95,7 +95,6 @@ static int __afu_open(struct inode *inode, struct file *file, bool master)\n \n \tpr_devel(\"afu_open pe: %i\\n\", ctx->pe);\n \tfile->private_data = ctx;\n-\tcxl_ctx_get();\n \n \t/* indicate success */\n \trc = 0;\n@@ -225,6 +224,12 @@ static long afu_ioctl_start_work(struct cxl_context *ctx,\n \tif (ctx->mm)\n \t\tmmput(ctx->mm);\n \n+\t/*\n+\t * Increment driver use count. Enables global TLBIs for hash\n+\t * and callbacks to handle the segment table\n+\t */\n+\tcxl_ctx_get();\n+\n \ttrace_cxl_attach(ctx, work.work_element_descriptor, work.num_interrupts, amr);\n \n \tif ((rc = cxl_ops->attach_process(ctx, false, work.work_element_descriptor,\n@@ -233,6 +238,7 @@ static long afu_ioctl_start_work(struct cxl_context *ctx,\n \t\tcxl_adapter_context_put(ctx->afu->adapter);\n \t\tput_pid(ctx->pid);\n \t\tctx->pid = NULL;\n+\t\tcxl_ctx_put();\n \t\tcxl_context_mm_count_put(ctx);\n \t\tgoto out;\n \t}\n",
    "prefixes": [
        "v2",
        "2/3"
    ]
}