Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/814593/?format=api
{ "id": 814593, "url": "http://patchwork.ozlabs.org/api/patches/814593/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1505621128-23877-11-git-send-email-sukadev@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": "<1505621128-23877-11-git-send-email-sukadev@linux.vnet.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/1505621128-23877-11-git-send-email-sukadev@linux.vnet.ibm.com/", "date": "2017-09-17T04:05:28", "name": "[10/10] powerpc/vas, nx-842: Define and use chip_to_vas_id()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9e0f3dcfb129d2065ed00b1afa3905e95653ad4a", "submitter": { "id": 984, "url": "http://patchwork.ozlabs.org/api/people/984/?format=api", "name": "Sukadev Bhattiprolu", "email": "sukadev@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/1505621128-23877-11-git-send-email-sukadev@linux.vnet.ibm.com/mbox/", "series": [ { "id": 3482, "url": "http://patchwork.ozlabs.org/api/series/3482/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=3482", "date": "2017-09-17T04:05:19", "name": "powerpc/vas: cleanup and optimizations", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/3482/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/814593/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/814593/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", "linuxppc-dev@ozlabs.org" ], "Received": [ "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\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 3xvwsv3Lfvz9s7m\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 17 Sep 2017 14:20:35 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xvwsv214wzDsVc\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSun, 17 Sep 2017 14:20:35 +1000 (AEST)", "from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xvwY22WZVzDrnt\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSun, 17 Sep 2017 14:05:58 +1000 (AEST)", "from ozlabs.org (bilbo.ozlabs.org [103.22.144.67])\n\tby bilbo.ozlabs.org (Postfix) with ESMTP id 3xvwY161Qnz8vnV\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSun, 17 Sep 2017 14:05:57 +1000 (AEST)", "by ozlabs.org (Postfix)\n\tid 3xvwY13CXVz9t2S; Sun, 17 Sep 2017 14:05:57 +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 ozlabs.org (Postfix) with ESMTPS id 3xvwY06NJTz9t4k\n\tfor <linuxppc-dev@ozlabs.org>; Sun, 17 Sep 2017 14:05:56 +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\tv8H44Ttu101921\n\tfor <linuxppc-dev@ozlabs.org>; Sun, 17 Sep 2017 00:05:53 -0400", "from e32.co.us.ibm.com (e32.co.us.ibm.com [32.97.110.150])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2d101w1k3e-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@ozlabs.org>; Sun, 17 Sep 2017 00:05:53 -0400", "from localhost\n\tby e32.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@ozlabs.org> from <sukadev@linux.vnet.ibm.com>;\n\tSat, 16 Sep 2017 22:05:52 -0600", "from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18)\n\tby e32.co.us.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tSat, 16 Sep 2017 22:05:50 -0600", "from b03ledav005.gho.boulder.ibm.com\n\t(b03ledav005.gho.boulder.ibm.com [9.17.130.236])\n\tby b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v8H45nxm65929254; Sat, 16 Sep 2017 21:05:49 -0700", "from b03ledav005.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 843BCBE03A;\n\tSat, 16 Sep 2017 22:05:49 -0600 (MDT)", "from suka-w540.usor.ibm.com (unknown [9.70.94.25])\n\tby b03ledav005.gho.boulder.ibm.com (Postfix) with ESMTP id 2033BBE039;\n\tSat, 16 Sep 2017 22:05:49 -0600 (MDT)" ], "Authentication-Results": "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com\n\t(client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com;\n\tenvelope-from=sukadev@linux.vnet.ibm.com; receiver=<UNKNOWN>)", "From": "Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>", "To": "Michael Ellerman <mpe@ellerman.id.au>", "Subject": "[PATCH 10/10] powerpc/vas, nx-842: Define and use chip_to_vas_id()", "Date": "Sat, 16 Sep 2017 21:05:28 -0700", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1505621128-23877-1-git-send-email-sukadev@linux.vnet.ibm.com>", "References": "<1505621128-23877-1-git-send-email-sukadev@linux.vnet.ibm.com>", "X-TM-AS-GCONF": "00", "x-cbid": "17091704-0004-0000-0000-000012EF0526", "X-IBM-SpamModules-Scores": "", "X-IBM-SpamModules-Versions": "BY=3.00007754; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000229; SDB=6.00918138; UDB=6.00461174;\n\tIPR=6.00698363; \n\tBA=6.00005592; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017185;\n\tXFM=3.00000015; UTC=2017-09-17 04:05:51", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17091704-0005-0000-0000-0000841EBCC9", "Message-Id": "<1505621128-23877-11-git-send-email-sukadev@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-17_03:, , 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-1709170058", "X-BeenThere": "linuxppc-dev@lists.ozlabs.org", "X-Mailman-Version": "2.1.24", "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": "linuxppc-dev@ozlabs.org, mikey@neuling.org, linux-kernel@vger.kernel.org", "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": "Define a helper, chip_to_vas_id() to map a given chip id to corresponding\nvas id.\n\nNormally, callers of vas_rx_win_open() and vas_tx_win_open() would need\nthe VAS window to be on the same chip where the calling thread is executing.\nThese callers can pass in -1 for the VAS id.\n\nThis interface will be useful if a thread running on one chip wants to open\na window on another chip (like the NX-842 driver does during start up).\n\nSigned-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>\n---\n arch/powerpc/include/asm/vas.h | 9 +++++++++\n arch/powerpc/platforms/powernv/vas.c | 11 +++++++++++\n drivers/crypto/nx/nx-842-powernv.c | 18 +++---------------\n 3 files changed, 23 insertions(+), 15 deletions(-)", "diff": "diff --git a/arch/powerpc/include/asm/vas.h b/arch/powerpc/include/asm/vas.h\nindex fd5963a..044748f 100644\n--- a/arch/powerpc/include/asm/vas.h\n+++ b/arch/powerpc/include/asm/vas.h\n@@ -104,6 +104,15 @@ struct vas_tx_win_attr {\n };\n \n /*\n+ * Helper to map a chip id to VAS id.\n+ * For POWER9, this is a 1:1 mapping. In the future this maybe a 1:N\n+ * mapping in which case, we will need to update this helper.\n+ *\n+ * Return the VAS id or -1 if no matching vasid is found.\n+ */\n+int chip_to_vas_id(int chipid);\n+\n+/*\n * Helper to initialize receive window attributes to defaults for an\n * NX window.\n */\ndiff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c\nindex abb7090..cd9a733 100644\n--- a/arch/powerpc/platforms/powernv/vas.c\n+++ b/arch/powerpc/platforms/powernv/vas.c\n@@ -123,6 +123,17 @@ struct vas_instance *find_vas_instance(int vasid)\n \treturn NULL;\n }\n \n+int chip_to_vas_id(int chipid)\n+{\n+\tint cpu;\n+\n+\tfor_each_possible_cpu(cpu) {\n+\t\tif (cpu_to_chip_id(cpu) == chipid)\n+\t\t\treturn per_cpu(cpu_vas_id, cpu);\n+\t}\n+\treturn -1;\n+}\n+\n static int vas_probe(struct platform_device *pdev)\n {\n \treturn init_vas_instance(pdev);\ndiff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c\nindex 874ddf5..eb221ed 100644\n--- a/drivers/crypto/nx/nx-842-powernv.c\n+++ b/drivers/crypto/nx/nx-842-powernv.c\n@@ -847,24 +847,12 @@ static int __init nx842_powernv_probe_vas(struct device_node *pn)\n \t\treturn -EINVAL;\n \t}\n \n-\tfor_each_compatible_node(dn, NULL, \"ibm,power9-vas-x\") {\n-\t\tif (of_get_ibm_chip_id(dn) == chip_id)\n-\t\t\tbreak;\n-\t}\n-\n-\tif (!dn) {\n-\t\tpr_err(\"Missing VAS device node\\n\");\n+\tvasid = chip_to_vas_id(chip_id);\n+\tif (vasid < 0) {\n+\t\tpr_err(\"Unable to map chip_id %d to vasid\\n\", chip_id);\n \t\treturn -EINVAL;\n \t}\n \n-\tif (of_property_read_u32(dn, \"ibm,vas-id\", &vasid)) {\n-\t\tpr_err(\"Missing ibm,vas-id device property\\n\");\n-\t\tof_node_put(dn);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tof_node_put(dn);\n-\n \tfor_each_child_of_node(pn, dn) {\n \t\tif (of_device_is_compatible(dn, \"ibm,p9-nx-842\")) {\n \t\t\tret = vas_cfg_coproc_info(dn, chip_id, vasid);\n", "prefixes": [ "10/10" ] }