Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806441/?format=api
{ "id": 806441, "url": "http://patchwork.ozlabs.org/api/patches/806441/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/20170828084731.14773-1-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": "<20170828084731.14773-1-fbarrat@linux.vnet.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/20170828084731.14773-1-fbarrat@linux.vnet.ibm.com/", "date": "2017-08-28T08:47:30", "name": "[1/2] cxl: Fix driver use count", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "902d80c1d3eda968bb86faba4cf5af6f4431dde3", "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/20170828084731.14773-1-fbarrat@linux.vnet.ibm.com/mbox/", "series": [ { "id": 106, "url": "http://patchwork.ozlabs.org/api/series/106/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=106", "date": "2017-08-28T08:47:30", "name": "[1/2] cxl: Fix driver use count", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/106/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806441/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806441/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 3xglmy36mSz9s81\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 28 Aug 2017 18:49:06 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xglmy2HXDzDqJ8\n\tfor <patchwork-incoming@ozlabs.org>;\n\tMon, 28 Aug 2017 18:49:06 +1000 (AEST)", "from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com\n\t[148.163.158.5])\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 3xgllK3z3rzDq66\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tMon, 28 Aug 2017 18:47:41 +1000 (AEST)", "from pps.filterd (m0098420.ppops.net [127.0.0.1])\n\tby mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv7S8i7ID024738\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 28 Aug 2017 04:47:38 -0400", "from e06smtp10.uk.ibm.com (e06smtp10.uk.ibm.com [195.75.94.106])\n\tby mx0b-001b2d01.pphosted.com with ESMTP id 2cm9ubeuqx-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Mon, 28 Aug 2017 04:47:38 -0400", "from localhost\n\tby e06smtp10.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\tMon, 28 Aug 2017 09:47:37 +0100", "from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194)\n\tby e06smtp10.uk.ibm.com (192.168.101.140) with IBM ESMTP SMTP\n\tGateway: Authorized Use Only! Violators will be prosecuted; \n\tMon, 28 Aug 2017 09:47:34 +0100", "from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com\n\t[9.149.105.232])\n\tby b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v7S8lY3n23003198; Mon, 28 Aug 2017 08:47:34 GMT", "from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 21FA752045;\n\tMon, 28 Aug 2017 08:43:04 +0100 (BST)", "from localhost.localdomain (unknown [9.167.242.165])\n\tby d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 3B9C652043; \n\tMon, 28 Aug 2017 08:43:03 +0100 (BST)" ], "From": "Frederic Barrat <fbarrat@linux.vnet.ibm.com>", "To": "mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org,\n\tandrew.donnellan@au1.ibm.com, clombard@linux.vnet.ibm.com,\n\tvaibhav@linux.vnet.ibm.com", "Subject": "[PATCH 1/2] cxl: Fix driver use count", "Date": "Mon, 28 Aug 2017 10:47:30 +0200", "X-Mailer": "git-send-email 2.11.0", "X-TM-AS-GCONF": "00", "x-cbid": "17082808-0040-0000-0000-000003D3BCEF", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17082808-0041-0000-0000-000025D4200F", "Message-Id": "<20170828084731.14773-1-fbarrat@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-08-28_05:, , 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-1708280140", "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\")\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..e0dfd1eadd70 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 callacks 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..b76a491a485d 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 callacks 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": [ "1/2" ] }