get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 816576,
    "url": "http://patchwork.ozlabs.org/api/patches/816576/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-imx/patch/20170920224621.16236-6-tony@atomide.com/",
    "project": {
        "id": 19,
        "url": "http://patchwork.ozlabs.org/api/projects/19/?format=api",
        "name": "Linux IMX development",
        "link_name": "linux-imx",
        "list_id": "linux-imx-kernel.lists.patchwork.ozlabs.org",
        "list_email": "linux-imx-kernel@lists.patchwork.ozlabs.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170920224621.16236-6-tony@atomide.com>",
    "list_archive_url": null,
    "date": "2017-09-20T22:46:16",
    "name": "[05/10] ARM: OMAP2+: Parse module IO range from dts for legacy \"ti, hwmods\" support",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "de2442d0642ae63b425070de0fcc2daeaff5c9dd",
    "submitter": {
        "id": 365,
        "url": "http://patchwork.ozlabs.org/api/people/365/?format=api",
        "name": "Tony Lindgren",
        "email": "tony@atomide.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-imx/patch/20170920224621.16236-6-tony@atomide.com/mbox/",
    "series": [
        {
            "id": 4251,
            "url": "http://patchwork.ozlabs.org/api/series/4251/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-imx/list/?series=4251",
            "date": "2017-09-20T22:46:12",
            "name": "Fix remaining issues to drop more omap platform data",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4251/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/816576/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/816576/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org>",
        "X-Original-To": "incoming-imx@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming-imx@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.infradead.org\n\t(client-ip=65.50.211.133; helo=bombadil.infradead.org;\n\tenvelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=lists.infradead.org\n\theader.i=@lists.infradead.org\n\theader.b=\"UmnXCRaK\"; dkim-atps=neutral"
        ],
        "Received": [
            "from bombadil.infradead.org (bombadil.infradead.org\n\t[65.50.211.133])\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 3xyFP50LKDz9sBZ\n\tfor <incoming-imx@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 08:52:09 +1000 (AEST)",
            "from localhost ([127.0.0.1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dunqc-0001Gh-IT; Wed, 20 Sep 2017 22:52:02 +0000",
            "from muru.com ([72.249.23.125])\n\tby bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux))\n\tid 1dunm2-0004xb-7J for linux-arm-kernel@lists.infradead.org;\n\tWed, 20 Sep 2017 22:47:32 +0000",
            "from sampyla.muru.com (localhost [127.0.0.1])\n\tby muru.com (Postfix) with ESMTP id 7B52E8563;\n\tWed, 20 Sep 2017 22:47:45 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20170209; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:\n\tMessage-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=2XM8GNt4vE7NRqRzjIlFVsK1D9XvPrzDaS5kYLNlFro=;\n\tb=UmnXCRaKFeHtEV\n\tT6Olgw5LtpV1q6/bGHucTOYBcTX31X8pCdjm+Bv+1jHFIY+FfhaJca+0q3bAG9WoC+qqSntYF46ZG\n\tcpMnH8wX4xZK0Pg9jsW4Onbjto+EYIQiBjrt06nONXsXkgzF++aao3bsBk9RIGjnw6X4XlW2OExwG\n\t/hY3EDQwL63+fORg7KISqgM+hxIjDGTaXI9tAlri5wlvOq6rExC7KRZClmWcme2uFgjUY8CquSnXQ\n\t6g9wPJHB/ZUz1+fiB9BwLWSZDmkQ3qS+K2wQbRtmx7JCRHRS9zc1WwM9zPWGD3KX9opezgVhcQPg6\n\tVI3wLikD/qUY9Gsv6KRw==;",
        "From": "Tony Lindgren <tony@atomide.com>",
        "To": "linux-omap@vger.kernel.org",
        "Subject": "[PATCH 05/10] ARM: OMAP2+: Parse module IO range from dts for legacy\n\t\"ti, hwmods\" support",
        "Date": "Wed, 20 Sep 2017 15:46:16 -0700",
        "Message-Id": "<20170920224621.16236-6-tony@atomide.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170920224621.16236-1-tony@atomide.com>",
        "References": "<20170920224621.16236-1-tony@atomide.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20170920_154718_531446_3CF065A3 ",
        "X-CRM114-Status": "GOOD (  17.78  )",
        "X-Spam-Score": "-1.9 (-)",
        "X-Spam-Report": "SpamAssassin version 3.4.1 on bombadil.infradead.org summary:\n\tContent analysis details:   (-1.9 points)\n\tpts rule name              description\n\t---- ----------------------\n\t--------------------------------------------------\n\t-1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n\t[score: 0.0000]",
        "X-BeenThere": "linux-arm-kernel@lists.infradead.org",
        "X-Mailman-Version": "2.1.21",
        "Precedence": "list",
        "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.infradead.org/pipermail/linux-arm-kernel/>",
        "List-Post": "<mailto:linux-arm-kernel@lists.infradead.org>",
        "List-Help": "<mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>",
        "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,\n\t<mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>",
        "Cc": "devicetree@vger.kernel.org, Paul Walmsley <paul@pwsan.com>, Lokesh Vutla\n\t<lokeshvutla@ti.com>, Tero Kristo <t-kristo@ti.com>, =?utf-8?q?Beno?=\n\t=?utf-8?q?=C3=AEt_Cousson?= <bcousson@baylibre.com>,\n\tlinux-arm-kernel@lists.infradead.org",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Sender": "\"linux-arm-kernel\" <linux-arm-kernel-bounces@lists.infradead.org>",
        "Errors-To": "linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org",
        "List-Id": "linux-imx-kernel.lists.patchwork.ozlabs.org"
    },
    "content": "When removing legacy platform data for IO ranges for the hwmod\ninterconnect code, we still need to support the \"ti,hwmods\"\nproperty.\n\nAnd as we're going to use a generic sysc device driver to handle the\ninterconnect target instances, we can parse the information needed\nfor legacy \"ti,hwmods\" IO range from the dts. It's always the first\nrange the interconnect target module provides.\n\nNote that we want to parse the range instead of the first child\ndevice IO regs as the child device may not always be defined.\n\nThe child IP device node may not exist in cases where there is no\ndriver binding for the device, or when the child IP block may not\neven be functional for some SoC revisions. But the IO range of the\ninterconnect target module is always known.\n\nCc: \"Benoît Cousson\" <bcousson@baylibre.com>\nCc: Lokesh Vutla <lokeshvutla@ti.com>\nCc: Paul Walmsley <paul@pwsan.com>\nCc: Tero Kristo <t-kristo@ti.com>\nSigned-off-by: Tony Lindgren <tony@atomide.com>\n---\n arch/arm/mach-omap2/omap_hwmod.c | 80 +++++++++++++++++++++++++++++++++++++++-\n arch/arm/mach-omap2/omap_hwmod.h |  5 +++\n 2 files changed, 84 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c\n--- a/arch/arm/mach-omap2/omap_hwmod.c\n+++ b/arch/arm/mach-omap2/omap_hwmod.c\n@@ -2395,6 +2395,75 @@ static int of_dev_hwmod_lookup(struct device_node *np,\n \treturn -ENODEV;\n }\n \n+/**\n+ * omap_hwmod_parse_module_range - map module IO range from device tree\n+ * @oh: struct omap_hwmod *\n+ * @np: struct device_node *\n+ *\n+ * Parse the device tree range an interconnect target module provides\n+ * for it's child device IP blocks. This way we can support the old\n+ * \"ti,hwmods\" property with just dts data without a need for platform\n+ * data for IO resources. And we don't need all the child IP device\n+ * nodes available in the dts.\n+ */\n+int omap_hwmod_parse_module_range(struct omap_hwmod *oh,\n+\t\t\t\t  struct device_node *np,\n+\t\t\t\t  struct resource *res)\n+{\n+\tstruct property *prop;\n+\tconst __be32 *ranges;\n+\tconst char *name;\n+\tu32 nr_addr, nr_size;\n+\tu64 base, size;\n+\tint len, error;\n+\n+\tif (!res)\n+\t\treturn -EINVAL;\n+\n+\tranges = of_get_property(np, \"ranges\", &len);\n+\tif (!ranges)\n+\t\treturn -ENOENT;\n+\n+\tlen /= sizeof(*ranges);\n+\n+\tif (len < 3)\n+\t\treturn -EINVAL;\n+\n+\tof_property_for_each_string(np, \"compatible\", prop, name)\n+\t\tif (!strncmp(\"ti,sysc-\", name, 8))\n+\t\t\tbreak;\n+\n+\tif (!name)\n+\t\treturn -ENOENT;\n+\n+\terror = of_property_read_u32(np, \"#address-cells\", &nr_addr);\n+\tif (error)\n+\t\treturn -ENOENT;\n+\n+\terror = of_property_read_u32(np, \"#size-cells\", &nr_size);\n+\tif (error)\n+\t\treturn -ENOENT;\n+\n+\tif (nr_addr != 1 || nr_size != 1) {\n+\t\tpr_err(\"%s: invalid range for %s->%s\\n\", __func__,\n+\t\t       oh->name, np->name);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tranges++;\n+\tbase = of_translate_address(np, ranges++);\n+\tsize = be32_to_cpup(ranges);\n+\n+\tpr_debug(\"omap_hwmod: %s %s at 0x%llx size 0x%llx\\n\",\n+\t\t oh->name, np->name, base, size);\n+\n+\tres->start = base;\n+\tres->end = base + size - 1;\n+\tres->flags = IORESOURCE_MEM;\n+\n+\treturn 0;\n+}\n+\n /**\n  * _init_mpu_rt_base - populate the virtual address for a hwmod\n  * @oh: struct omap_hwmod * to locate the virtual address\n@@ -2417,6 +2486,8 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,\n {\n \tstruct omap_hwmod_addr_space *mem;\n \tvoid __iomem *va_start = NULL;\n+\tstruct resource res;\n+\tint error;\n \n \tif (!oh)\n \t\treturn -EINVAL;\n@@ -2442,7 +2513,14 @@ static int __init _init_mpu_rt_base(struct omap_hwmod *oh, void *data,\n \t\t\treturn -ENXIO;\n \t\t}\n \n-\t\tva_start = of_iomap(np, index + oh->mpu_rt_idx);\n+\t\t/* Do we have a dts range for the interconnect target module? */\n+\t\terror = omap_hwmod_parse_module_range(oh, np, &res);\n+\t\tif (!error)\n+\t\t\tva_start = ioremap(res.start, resource_size(&res));\n+\n+\t\t/* No ranges, rely on device reg entry */\n+\t\tif (!va_start)\n+\t\t\tva_start = of_iomap(np, index + oh->mpu_rt_idx);\n \t} else {\n \t\tva_start = ioremap(mem->pa_start, mem->pa_end - mem->pa_start);\n \t}\ndiff --git a/arch/arm/mach-omap2/omap_hwmod.h b/arch/arm/mach-omap2/omap_hwmod.h\n--- a/arch/arm/mach-omap2/omap_hwmod.h\n+++ b/arch/arm/mach-omap2/omap_hwmod.h\n@@ -690,11 +690,16 @@ struct omap_hwmod {\n \tstruct omap_hwmod\t\t*parent_hwmod;\n };\n \n+struct device_node;\n+\n struct omap_hwmod *omap_hwmod_lookup(const char *name);\n int omap_hwmod_for_each(int (*fn)(struct omap_hwmod *oh, void *data),\n \t\t\tvoid *data);\n \n int __init omap_hwmod_setup_one(const char *name);\n+int omap_hwmod_parse_module_range(struct omap_hwmod *oh,\n+\t\t\t\t  struct device_node *np,\n+\t\t\t\t  struct resource *res);\n \n int omap_hwmod_enable(struct omap_hwmod *oh);\n int omap_hwmod_idle(struct omap_hwmod *oh);\n",
    "prefixes": [
        "05/10"
    ]
}