Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/794515/?format=api
{ "id": 794515, "url": "http://patchwork.ozlabs.org/api/1.2/patches/794515/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/a3ba92fc-d73b-0435-3132-e9f23970d868@linux.vnet.ibm.com/", "project": { "id": 2, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<a3ba92fc-d73b-0435-3132-e9f23970d868@linux.vnet.ibm.com>", "list_archive_url": "https://lore.kernel.org/linuxppc-dev/a3ba92fc-d73b-0435-3132-e9f23970d868@linux.vnet.ibm.com/", "date": "2017-07-27T16:10:31", "name": "[V2,3/4] hotplug/drc-info: Add code to search ibm,drc-info property", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "e42f1eab9dd6d8176e5be091e2b923e92f8446ee", "submitter": { "id": 65104, "url": "http://patchwork.ozlabs.org/api/1.2/people/65104/?format=api", "name": "Michael Bringmann", "email": "mwb@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/a3ba92fc-d73b-0435-3132-e9f23970d868@linux.vnet.ibm.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/794515/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/794515/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 3xJHHC25lDz9s0Z\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 28 Jul 2017 02:19:19 +1000 (AEST)", "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xJHHB65RYzDrL8\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 28 Jul 2017 02:19:18 +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 3xJH5H3YvnzDrKt\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 28 Jul 2017 02:10:43 +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\tv6RGAfoW029652\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 27 Jul 2017 12:10:42 -0400", "from e37.co.us.ibm.com (e37.co.us.ibm.com [32.97.110.158])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2byk5cgxv7-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <linuxppc-dev@lists.ozlabs.org>; Thu, 27 Jul 2017 12:10:41 -0400", "from localhost\n\tby e37.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <linuxppc-dev@lists.ozlabs.org> from <mwb@linux.vnet.ibm.com>;\n\tThu, 27 Jul 2017 10:10:34 -0600", "from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19)\n\tby e37.co.us.ibm.com (192.168.1.137) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tThu, 27 Jul 2017 10:10:32 -0600", "from b03ledav002.gho.boulder.ibm.com\n\t(b03ledav002.gho.boulder.ibm.com [9.17.130.233])\n\tby b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with\n\tESMTP id v6RGAWFL62783642; Thu, 27 Jul 2017 09:10:32 -0700", "from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 1260A136048;\n\tThu, 27 Jul 2017 10:10:32 -0600 (MDT)", "from oc1554177480.ibm.com (unknown [9.53.92.155])\n\tby b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id\n\tBCA4A13603A; Thu, 27 Jul 2017 10:10:31 -0600 (MDT)" ], "To": "linuxppc-dev@lists.ozlabs.org", "From": "Michael Bringmann <mwb@linux.vnet.ibm.com>", "Subject": "[PATCH V2 3/4] hotplug/drc-info: Add code to search ibm,drc-info\n\tproperty", "Organization": "IBM Linux Technology Center", "In-Reply-To": "<e884f428-c76d-112a-aa2f-f57a94de55fb@linux.vnet.ibm.com>", "Date": "Thu, 27 Jul 2017 11:10:31 -0500", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.0", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=utf-8", "Content-Language": "en-US", "Content-Transfer-Encoding": "8bit", "X-TM-AS-GCONF": "00", "x-cbid": "17072716-0024-0000-0000-000016EF998C", "X-IBM-SpamModules-Scores": "", "X-IBM-SpamModules-Versions": "BY=3.00007435; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000214; SDB=6.00893701; UDB=6.00446819;\n\tIPR=6.00673861; \n\tBA=6.00005495; 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.00016409;\n\tXFM=3.00000015; UTC=2017-07-27 16:10:33", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17072716-0025-0000-0000-00004C08D43A", "Message-Id": "<a3ba92fc-d73b-0435-3132-e9f23970d868@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-07-27_08:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000\n\tdefinitions=main-1707270254", "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": "nfont@linux.vnet.ibm.com, Michael Bringmann <mwb@linux.vnet.ibm.com>", "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": "rpadlpar_core.c: Provide parallel routines to search the older device-\ntree properties (\"ibm,drc-indexes\", \"ibm,drc-names\", \"ibm,drc-types\"\nand \"ibm,drc-power-domains\"), or the new property \"ibm,drc-info\".\n\nThe interface to examine the DRC information is changed from a \"get\"\nfunction that returns values for local verification elsewhere, to a\n\"check\" function that validates the 'name' and/or 'type' of a device\nnode. This update hides the format of the underlying device-tree\nproperties, and concentrates the value checks into a single function\nwithout requiring the user to verify whether a search was successful.\n\nSigned-off-by: Michael Bringmann <mwb@linux.vnet.ibm.com>\n---\n drivers/pci/hotplug/rpadlpar_core.c | 13 ++--\n drivers/pci/hotplug/rpaphp.h | 4 +\n drivers/pci/hotplug/rpaphp_core.c | 109 +++++++++++++++++++++++++++--------\n 3 files changed, 91 insertions(+), 35 deletions(-)", "diff": "diff --git a/drivers/pci/hotplug/rpadlpar_core.c b/drivers/pci/hotplug/rpadlpar_core.c\nindex 3f93a4e..e6924de 100644\n--- a/drivers/pci/hotplug/rpadlpar_core.c\n+++ b/drivers/pci/hotplug/rpadlpar_core.c\n@@ -27,6 +27,7 @@\n #include <linux/mutex.h>\n #include <asm/rtas.h>\n #include <asm/vio.h>\n+#include <linux/firmware.h>\n \n #include \"../pci.h\"\n #include \"rpaphp.h\"\n@@ -44,15 +45,14 @@ static struct device_node *find_vio_slot_node(char *drc_name)\n {\n \tstruct device_node *parent = of_find_node_by_name(NULL, \"vdevice\");\n \tstruct device_node *dn = NULL;\n-\tchar *name;\n \tint rc;\n \n \tif (!parent)\n \t\treturn NULL;\n \n \twhile ((dn = of_get_next_child(parent, dn))) {\n-\t\trc = rpaphp_get_drc_props(dn, NULL, &name, NULL, NULL);\n-\t\tif ((rc == 0) && (!strcmp(drc_name, name)))\n+\t\trc = rpaphp_check_drc_props(dn, drc_name, NULL);\n+\t\tif (rc == 0)\n \t\t\tbreak;\n \t}\n \n@@ -64,15 +64,12 @@ static struct device_node *find_php_slot_pci_node(char *drc_name,\n \t\t\t\t\t\t char *drc_type)\n {\n \tstruct device_node *np = NULL;\n-\tchar *name;\n-\tchar *type;\n \tint rc;\n \n \twhile ((np = of_find_node_by_name(np, \"pci\"))) {\n-\t\trc = rpaphp_get_drc_props(np, NULL, &name, &type, NULL);\n+\t\trc = rpaphp_check_drc_props(np, drc_name, drc_type);\n \t\tif (rc == 0)\n-\t\t\tif (!strcmp(drc_name, name) && !strcmp(drc_type, type))\n-\t\t\t\tbreak;\n+\t\t\tbreak;\n \t}\n \n \treturn np;\ndiff --git a/drivers/pci/hotplug/rpaphp.h b/drivers/pci/hotplug/rpaphp.h\nindex 7db024e..8db5f2e 100644\n--- a/drivers/pci/hotplug/rpaphp.h\n+++ b/drivers/pci/hotplug/rpaphp.h\n@@ -91,8 +91,8 @@ struct slot {\n \n /* rpaphp_core.c */\n int rpaphp_add_slot(struct device_node *dn);\n-int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,\n-\t\tchar **drc_name, char **drc_type, int *drc_power_domain);\n+int rpaphp_check_drc_props(struct device_node *dn, char *drc_name,\n+\t\tchar *drc_type);\n \n /* rpaphp_slot.c */\n void dealloc_slot_struct(struct slot *slot);\ndiff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c\nindex 8d13202..a3c8a1c 100644\n--- a/drivers/pci/hotplug/rpaphp_core.c\n+++ b/drivers/pci/hotplug/rpaphp_core.c\n@@ -30,6 +30,7 @@\n #include <linux/smp.h>\n #include <linux/init.h>\n #include <linux/vmalloc.h>\n+#include <asm/firmware.h>\n #include <asm/eeh.h> /* for eeh_add_device() */\n #include <asm/rtas.h>\t\t/* rtas_call */\n #include <asm/pci-bridge.h>\t/* for pci_controller */\n@@ -196,25 +197,21 @@ static int get_children_props(struct device_node *dn, const int **drc_indexes,\n \treturn 0;\n }\n \n-/* To get the DRC props describing the current node, first obtain it's\n- * my-drc-index property. Next obtain the DRC list from it's parent. Use\n- * the my-drc-index for correlation, and obtain the requested properties.\n+\n+/* Verify the existence of 'drc_name' and/or 'drc_type' within the\n+ * current node. First obtain it's my-drc-index property. Next,\n+ * obtain the DRC info from it's parent. Use the my-drc-index for\n+ * correlation, and obtain/validate the requested properties.\n */\n-int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,\n-\t\tchar **drc_name, char **drc_type, int *drc_power_domain)\n+\n+static int rpaphp_check_drc_props_v1(struct device_node *dn, char *drc_name,\n+\t\t\t\tchar *drc_type, unsigned int my_index)\n {\n+\tchar *name_tmp, *type_tmp;\n \tconst int *indexes, *names;\n \tconst int *types, *domains;\n-\tconst unsigned int *my_index;\n-\tchar *name_tmp, *type_tmp;\n \tint i, rc;\n \n-\tmy_index = of_get_property(dn, \"ibm,my-drc-index\", NULL);\n-\tif (!my_index) {\n-\t\t/* Node isn't DLPAR/hotplug capable */\n-\t\treturn -EINVAL;\n-\t}\n-\n \trc = get_children_props(dn->parent, &indexes, &names, &types, &domains);\n \tif (rc < 0) {\n \t\treturn -EINVAL;\n@@ -225,24 +222,86 @@ int rpaphp_get_drc_props(struct device_node *dn, int *drc_index,\n \n \t/* Iterate through parent properties, looking for my-drc-index */\n \tfor (i = 0; i < be32_to_cpu(indexes[0]); i++) {\n-\t\tif ((unsigned int) indexes[i + 1] == *my_index) {\n-\t\t\tif (drc_name)\n-\t\t\t\t*drc_name = name_tmp;\n-\t\t\tif (drc_type)\n-\t\t\t\t*drc_type = type_tmp;\n-\t\t\tif (drc_index)\n-\t\t\t\t*drc_index = be32_to_cpu(*my_index);\n-\t\t\tif (drc_power_domain)\n-\t\t\t\t*drc_power_domain = be32_to_cpu(domains[i+1]);\n-\t\t\treturn 0;\n-\t\t}\n+\t\tif ((unsigned int) indexes[i + 1] == my_index)\n+\t\t\tbreak;\n+\n \t\tname_tmp += (strlen(name_tmp) + 1);\n \t\ttype_tmp += (strlen(type_tmp) + 1);\n \t}\n \n+\tif (((drc_name == NULL) || (drc_name && !strcmp(drc_name, name_tmp))) &&\n+\t ((drc_type == NULL) || (drc_type && !strcmp(drc_type, type_tmp))))\n+\t\treturn 0;\n+\n \treturn -EINVAL;\n }\n-EXPORT_SYMBOL_GPL(rpaphp_get_drc_props);\n+\n+static int rpaphp_check_drc_props_v2(struct device_node *dn, char *drc_name,\n+\t\t\t\tchar *drc_type, unsigned int my_index)\n+{\n+\tstruct property *info;\n+\tunsigned int entries;\n+\tu32 drc_index_start = 0, last_drc_index = 0;\n+\tu32 num_sequential_elems = 0, sequential_inc = 0;\n+\tchar *name_tmp, *type_tmp;\n+\tvoid *value;\n+\tint j;\n+\n+\tinfo = of_find_property(dn->parent, \"ibm,drc-info\", NULL);\n+\tif (info == NULL)\n+\t\treturn -EINVAL;\n+\n+\tvalue = info->value;\n+\tvalue = (void *)of_prop_next_u32(info, value, &entries);\n+\tif (!value)\n+\t\treturn -EINVAL;\n+\n+\tfor (j = 0; j < entries; j++) {\n+\t\tof_one_drc_info(&info, &value, &type_tmp, &name_tmp,\n+\t\t\t\t&drc_index_start, &num_sequential_elems,\n+\t\t\t\t&sequential_inc, &last_drc_index);\n+\n+\t\t/* Should now know end of current entry */\n+\n+\t\tWARN_ON((my_index < drc_index_start) ||\n+\t\t\t(((my_index-drc_index_start)%sequential_inc) != 0));\n+\n+\t\tif (my_index > last_drc_index)\n+\t\t\tcontinue;\n+\n+\t\tbreak;\n+\t}\n+\t/* Found it */\n+\n+\tif (((drc_name == NULL) ||\n+\t (drc_name && !strcmp(drc_name, name_tmp))) &&\n+\t ((drc_type == NULL) ||\n+\t (drc_type && !strcmp(drc_type, type_tmp))))\n+\t\treturn 0;\n+\n+\treturn -EINVAL;\n+}\n+\n+int rpaphp_check_drc_props(struct device_node *dn, char *drc_name,\n+\t\t\tchar *drc_type)\n+{\n+\tconst unsigned int *my_index;\n+\n+\tmy_index = of_get_property(dn, \"ibm,my-drc-index\", NULL);\n+\tif (!my_index) {\n+\t\t/* Node isn't DLPAR/hotplug capable */\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (firmware_has_feature(FW_FEATURE_DRC_INFO))\n+\t\treturn rpaphp_check_drc_props_v2(dn, drc_name, drc_type,\n+\t\t\t\t\t\t*my_index);\n+\telse\n+\t\treturn rpaphp_check_drc_props_v1(dn, drc_name, drc_type,\n+\t\t\t\t\t\t*my_index);\n+}\n+EXPORT_SYMBOL_GPL(rpaphp_check_drc_props);\n+\n \n static int is_php_type(char *drc_type)\n {\n", "prefixes": [ "V2", "3/4" ] }