Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/354076/?format=api
{ "id": 354076, "url": "http://patchwork.ozlabs.org/api/patches/354076/?format=api", "web_url": "http://patchwork.ozlabs.org/project/linux-tegra/patch/1401448834-32659-3-git-send-email-hdoyu@nvidia.com/", "project": { "id": 21, "url": "http://patchwork.ozlabs.org/api/projects/21/?format=api", "name": "Linux Tegra Development", "link_name": "linux-tegra", "list_id": "linux-tegra.vger.kernel.org", "list_email": "linux-tegra@vger.kernel.org", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<1401448834-32659-3-git-send-email-hdoyu@nvidia.com>", "list_archive_url": null, "date": "2014-05-30T11:20:15", "name": "[PATCHv8,02/21] iommu/of: introduce a global iommu device list", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8db590716f22db18e1e4b241ad0d10efdb6ab36e", "submitter": { "id": 10265, "url": "http://patchwork.ozlabs.org/api/people/10265/?format=api", "name": "Hiroshi Doyu", "email": "hdoyu@nvidia.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/linux-tegra/patch/1401448834-32659-3-git-send-email-hdoyu@nvidia.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/354076/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/354076/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<linux-tegra-owner@vger.kernel.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org", "Received": [ "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id F22AB1400E2\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 30 May 2014 21:20:46 +1000 (EST)", "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1752746AbaE3LUo (ORCPT <rfc822;incoming@patchwork.ozlabs.org>);\n\tFri, 30 May 2014 07:20:44 -0400", "from hqemgate15.nvidia.com ([216.228.121.64]:17133 \"EHLO\n\thqemgate15.nvidia.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1752000AbaE3LUl (ORCPT\n\t<rfc822;linux-tegra@vger.kernel.org>);\n\tFri, 30 May 2014 07:20:41 -0400", "from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by\n\thqemgate15.nvidia.com\n\tid <B5388697f0000>; Fri, 30 May 2014 04:20:31 -0700", "from hqemhub01.nvidia.com ([172.20.12.94])\n\tby hqnvupgp07.nvidia.com (PGP Universal service);\n\tFri, 30 May 2014 04:13:28 -0700", "from deemhub02.nvidia.com (10.21.69.138) by hqemhub01.nvidia.com\n\t(172.20.150.30) with Microsoft SMTP Server (TLS) id 8.3.342.0;\n\tFri, 30 May 2014 04:20:41 -0700", "from oreo.nvidia.com (10.21.65.27) by deemhub02.nvidia.com\n\t(10.21.69.138) with Microsoft SMTP Server (TLS) id 8.3.342.0;\n\tFri, 30 May 2014 13:20:39 +0200" ], "X-PGP-Universal": "processed;\n\tby hqnvupgp07.nvidia.com on Fri, 30 May 2014 04:13:28 -0700", "From": "Hiroshi Doyu <hdoyu@nvidia.com>", "To": "<linux-tegra@vger.kernel.org>", "Subject": "[PATCHv8 02/21] iommu/of: introduce a global iommu device list", "Date": "Fri, 30 May 2014 14:20:15 +0300", "Message-ID": "<1401448834-32659-3-git-send-email-hdoyu@nvidia.com>", "X-Mailer": "git-send-email 2.0.0.rc1.15.g7e76a2f", "In-Reply-To": "<1401448834-32659-1-git-send-email-hdoyu@nvidia.com>", "References": "<1401448834-32659-1-git-send-email-hdoyu@nvidia.com>", "X-NVConfidentiality": "public", "MIME-Version": "1.0", "Content-Type": "text/plain", "Sender": "linux-tegra-owner@vger.kernel.org", "Precedence": "bulk", "List-ID": "<linux-tegra.vger.kernel.org>", "X-Mailing-List": "linux-tegra@vger.kernel.org" }, "content": "This enables to find an populated IOMMU device via a device node. This\ncan be used to see if an dependee IOMMU is populated or not to keep\ncorrect device population order. Client devices need to wait an IOMMU\nto be populated.\n\nSuggested by Thierry Reding and copied his example code.\n\nSigned-off-by: Hiroshi Doyu <hdoyu@nvidia.com>\nCc: Joerg Roedel <joro@8bytes.org>\nCc: Thierry Reding <thierry.reding@gmail.com>\n---\n drivers/iommu/of_iommu.c | 36 ++++++++++++++++++++++++++++++++++++\n include/linux/of_iommu.h | 16 ++++++++++++++++\n 2 files changed, 52 insertions(+)", "diff": "diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c\nindex e550ccb7634e..5d1aeb90eae3 100644\n--- a/drivers/iommu/of_iommu.c\n+++ b/drivers/iommu/of_iommu.c\n@@ -21,6 +21,42 @@\n #include <linux/limits.h>\n #include <linux/of.h>\n #include <linux/of_iommu.h>\n+#include <linux/device.h>\n+\n+static DEFINE_MUTEX(iommus_lock);\n+static LIST_HEAD(iommus_list);\n+\n+void iommu_add(struct iommu *iommu)\n+{\n+\tINIT_LIST_HEAD(&iommu->list);\n+\tmutex_lock(&iommus_lock);\n+\tlist_add_tail(&iommu->list, &iommus_list);\n+\tmutex_unlock(&iommus_lock);\n+}\n+\n+void iommu_del(struct iommu *iommu)\n+{\n+\tINIT_LIST_HEAD(&iommu->list);\n+\tmutex_lock(&iommus_lock);\n+\tlist_del(&iommu->list);\n+\tmutex_unlock(&iommus_lock);\n+}\n+\n+static struct iommu *of_find_iommu_by_node(struct device_node *np)\n+{\n+\tstruct iommu *iommu;\n+\n+\tmutex_lock(&iommus_lock);\n+\tlist_for_each_entry(iommu, &iommus_list, list) {\n+\t\tif (iommu->dev->of_node == np) {\n+\t\t\tmutex_unlock(&iommus_lock);\n+\t\t\treturn iommu;\n+\t\t}\n+\t}\n+\tmutex_unlock(&iommus_lock);\n+\n+\treturn NULL;\n+}\n \n /**\n * of_get_dma_window - Parse *dma-window property and returns 0 if found.\ndiff --git a/include/linux/of_iommu.h b/include/linux/of_iommu.h\nindex 51a560f34bca..108306898c38 100644\n--- a/include/linux/of_iommu.h\n+++ b/include/linux/of_iommu.h\n@@ -3,10 +3,18 @@\n \n #ifdef CONFIG_OF_IOMMU\n \n+struct iommu {\n+\tstruct list_head list;\n+\tstruct device *dev;\n+};\n+\n extern int of_get_dma_window(struct device_node *dn, const char *prefix,\n \t\t\t int index, unsigned long *busno, dma_addr_t *addr,\n \t\t\t size_t *size);\n \n+void iommu_add(struct iommu *iommu);\n+void iommu_del(struct iommu *iommu);\n+\n #else\n \n static inline int of_get_dma_window(struct device_node *dn, const char *prefix,\n@@ -16,6 +24,14 @@ static inline int of_get_dma_window(struct device_node *dn, const char *prefix,\n \treturn -EINVAL;\n }\n \n+static inline void iommu_add(struct iommu *iommu)\n+{\n+}\n+\n+static inline void iommu_del(struct iommu *iommu)\n+{\n+}\n+\n #endif\t/* CONFIG_OF_IOMMU */\n \n #endif /* __OF_IOMMU_H */\n", "prefixes": [ "PATCHv8", "02/21" ] }