get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 617346,
    "url": "http://patchwork.ozlabs.org/api/patches/617346/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/openwrt/patch/owrt-patch-20160502-7@vittgam.net/",
    "project": {
        "id": 45,
        "url": "http://patchwork.ozlabs.org/api/projects/45/?format=api",
        "name": "OpenWrt development",
        "link_name": "openwrt",
        "list_id": "openwrt-devel.lists.openwrt.org",
        "list_email": "openwrt-devel@lists.openwrt.org",
        "web_url": "http://openwrt.org/",
        "scm_url": "git://git.openwrt.org/openwrt.git",
        "webscm_url": "https://dev.openwrt.org/browser",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<owrt-patch-20160502-7@vittgam.net>",
    "list_archive_url": null,
    "date": "2016-05-02T03:34:53",
    "name": "[OpenWrt-Devel,4/6] ramips: Get rt3050 ethernet ports to be disabled from the device tree.",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0936038e13d124a606f4b8557dcbdf0c2c2797ad",
    "submitter": {
        "id": 65409,
        "url": "http://patchwork.ozlabs.org/api/people/65409/?format=api",
        "name": "Vittorio Gambaletta",
        "email": "openwrt@vittgam.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/openwrt/patch/owrt-patch-20160502-7@vittgam.net/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/617346/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/617346/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<openwrt-devel-bounces@lists.openwrt.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "<openwrt-devel@lists.openwrt.org>"
        ],
        "Received": [
            "from arrakis.dune.hu (caladan.dune.hu [78.24.191.180])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3qyqh92WLzz9t70\n\tfor <incoming@patchwork.ozlabs.org>;\n\tMon,  2 May 2016 13:35:37 +1000 (AEST)",
            "from arrakis.dune.hu (localhost [127.0.0.1])\n\tby arrakis.dune.hu (Postfix) with ESMTP id 39C6DB91E14;\n\tMon,  2 May 2016 05:35:01 +0200 (CEST)",
            "from arrakis.dune.hu (localhost [127.0.0.1])\n\tby arrakis.dune.hu (Postfix) with ESMTP;\n\tMon,  2 May 2016 05:35:01 +0200 (CEST)",
            "from arrakis.dune.hu (localhost [127.0.0.1])\n\tby arrakis.dune.hu (Postfix) with ESMTP id 34FF4B91DFC\n\tfor <openwrt-devel@lists.openwrt.org>;\n\tMon,  2 May 2016 05:34:54 +0200 (CEST)",
            "from mail.vittgam.net (server1.vittgam.net [213.239.197.142])\n\tby arrakis.dune.hu (Postfix) with ESMTPS\n\tfor <openwrt-devel@lists.openwrt.org>;\n\tMon,  2 May 2016 05:34:54 +0200 (CEST)",
            "from vl3 (vl3.r12.network.mietitrebbia.rocks [10.48.6.117])\n\tby mail.vittgam.net with SMTP id u423Yqoi184500\n\tfor <openwrt-devel@lists.openwrt.org>; Mon, 2 May 2016 05:34:53 +0200"
        ],
        "Authentication-Results": "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (4096-bit key;\n\tunprotected) header.d=vittgam.net header.i=@vittgam.net\n\theader.b=BmwdHzD6; dkim-atps=neutral",
        "X-Spam-Checker-Version": "SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.1",
        "X-policyd-weight": "using cached result; rate:hard: -6.1",
        "X-DKIM": "OpenDKIM Filter v2.4.2 mail.vittgam.net u423Yqoi184500",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=vittgam.net;\n\ts=20150519; t=1462160093;\n\tbh=epduE3Sw5brj+unkd7TaLkA+r0O8UicHUeHSOwE8Kmk=;\n\th=From:To:Subject:Content-Type:Message-ID:In-Reply-To:References;\n\tb=BmwdHzD6wxEjxUy/nbZmoxmV0YIfg3jdNFHKpKIG/1B35VV0hcb7Xc92PV7HbRATv\n\tJhlV43BLNzTDdgzSZgA8iCKc5HfXivLakwz7FZTIi0CIMbFfaE/wzEGL/qvBstBDA6\n\tFzKwPVdwl8YFmaLgTE71dXQXuMR60uvaSdrpmrWm+++l1KwlZB6zkjjjFMTWBIFpMY\n\t8vqP5KY+eBOYmovxmjeJO88X51BniQOWeJYQk18ub1IbJ/8r6kC+HGSTJ2yg37M3Kb\n\t0UZ1E2t+/IzHF+SeTl4YfQOTZ3/k960ItG5yskHlY1NuKH1/0F5HFCY5L7B9Uqcov2\n\tiqtqWICxIPUTqGq5OFGphlTEZGuOzwRzXuYDQvdgPKFWWKiRHhG8Hk2KVZFqsBHl4q\n\tWdxex62n3tbo9pFeqHU4ioIngkW+HK3WR7FIHw/4Fx9gt55CcHcidvIh1ODiJXoYl6\n\tT24oATqmKgut5jUEdw0cgfyvLHnIP4/KL2rsi4r5GDGKtyM2Vigjqn6GbynnU8hzuj\n\tMlE7FqIdsyumUihuGlulTydMbhSqQidvxmQfCKLFXCp5S5FYQe14rWvO7GnWWxzgFL\n\tAfcfX+VogXFooXBotENNwVXgbsEHDp/xI0O3GAfq9Gag6WsCwk6MGnA2s5+ECglwQz\n\tNV0aAMH7DCwHLkye50l8l44E=",
        "Date": "Mon, 2 May 2016 05:34:53 +0200",
        "From": "\"Vittorio Gambaletta (VittGam)\" <openwrt@vittgam.net>",
        "To": "<openwrt-devel@lists.openwrt.org>",
        "Message-ID": "<owrt-patch-20160502-7@vittgam.net>",
        "In-Reply-To": "<owrt-patch-20160502-4@vittgam.net>",
        "References": "<owrt-patch-20160502-4@vittgam.net>",
        "Subject": "[OpenWrt-Devel] [PATCH 4/6] ramips: Get rt3050 ethernet ports to be\n\tdisabled from the device tree.",
        "X-BeenThere": "openwrt-devel@lists.openwrt.org",
        "X-Mailman-Version": "2.1.20",
        "Precedence": "list",
        "List-Id": "OpenWrt Development List <openwrt-devel.lists.openwrt.org>",
        "List-Unsubscribe": "<https://lists.openwrt.org/cgi-bin/mailman/options/openwrt-devel>,\n\t<mailto:openwrt-devel-request@lists.openwrt.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.openwrt.org/pipermail/openwrt-devel/>",
        "List-Post": "<mailto:openwrt-devel@lists.openwrt.org>",
        "List-Help": "<mailto:openwrt-devel-request@lists.openwrt.org?subject=help>",
        "List-Subscribe": "<https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel>,\n\t<mailto:openwrt-devel-request@lists.openwrt.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "openwrt-devel-bounces@lists.openwrt.org",
        "Sender": "\"openwrt-devel\" <openwrt-devel-bounces@lists.openwrt.org>"
    },
    "content": "This patch allows configuring ports to be disabled in the device tree; this\nsaves power, since disabling ports here actually disables power to ethernet\nPHYs.\n\nLine 444 enables all ethernet ports, so line 487 is getting zero ports to be\ndisabled, except for port 5 in SoCs where this is not implemented as it will\nbe sticky disabled in register POC0. Because of this, the code will still read\nthe switch configuration and OR it to the device tree setting.\n\nSigned-off-by: Vittorio Gambaletta <openwrt@vittgam.net>\n---",
    "diff": "--- /dev/null\n+++ b/target/linux/ramips/patches-4.4/0518-net-mediatek-get-rt3050-ethernet-ports-to-be-disable.patch\n@@ -0,0 +1,81 @@\n+From: Vittorio Gambaletta <openwrt@vittgam.net>\n+Date: Fri, 01 Jan 2016 00:00:02 +0100\n+Subject: [PATCH 3/3] net: mediatek: Get rt3050 ethernet ports to be disabled from the device tree.\n+\n+This patch allows configuring ports to be disabled in the device tree; this\n+saves power, since disabling ports here actually disables power to ethernet\n+PHYs.\n+\n+Line 444 enables all ethernet ports, so line 487 is getting zero ports to be\n+disabled, except for port 5 in SoCs where this is not implemented as it will\n+be sticky disabled in register POC0. Because of this, the code will still read\n+the switch configuration and OR it to the device tree setting.\n+\n+Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>\n+---\n+\n+--- a/drivers/net/ethernet/mediatek/esw_rt3050.c\n++++ b/drivers/net/ethernet/mediatek/esw_rt3050.c\n+@@ -10,6 +10,7 @@\n+  *   Copyright (C) 2009-2015 John Crispin <blogic@openwrt.org>\n+  *   Copyright (C) 2009-2015 Felix Fietkau <nbd@openwrt.org>\n+  *   Copyright (C) 2013-2015 Michael Lee <igvtee@gmail.com>\n++ *   Copyright (C) 2016 Vittorio Gambaletta <openwrt@vittgam.net>\n+  */\n+ \n+ #include <linux/module.h>\n+@@ -219,6 +220,7 @@ struct rt305x_esw {\n+ \tspinlock_t\t\treg_rw_lock;\n+ \n+ \tunsigned char\t\tport_map;\n++\tunsigned char\t\tport_disable;\n+ \tunsigned int\t\treg_led_polarity;\n+ \n+ \tstruct switch_dev\tswdev;\n+@@ -483,8 +485,14 @@ static void esw_hw_init(struct rt305x_es\n+ \tesw_w32(esw, 0x00000005, RT305X_ESW_REG_P3LED);\n+ \tesw_w32(esw, 0x00000005, RT305X_ESW_REG_P4LED);\n+ \n+-\t/* Copy disabled port configuration from bootloader setup */\n+-\tport_disable = esw_get_port_disable(esw);\n++\t/* Copy disabled port configuration from device tree setup */\n++\tport_disable = esw->port_disable;\n++\n++\t/* Disable nonexistent ports by reading the switch config\n++\t * after having enabled all possible ports above\n++\t */\n++\tport_disable |= esw_get_port_disable(esw);\n++\n+ \tfor (i = 0; i < 6; i++)\n+ \t\tesw->ports[i].disable = (port_disable & (1 << i)) != 0;\n+ \n+@@ -1330,7 +1338,7 @@ static int esw_probe(struct platform_dev\n+ {\n+ \tstruct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);\n+ \tstruct device_node *np = pdev->dev.of_node;\n+-\tconst __be32 *port_map, *reg_init;\n++\tconst __be32 *port_map, *port_disable, *reg_init;\n+ \tstruct switch_dev *swdev;\n+ \tstruct rt305x_esw *esw;\n+ \tint ret;\n+@@ -1349,6 +1357,10 @@ static int esw_probe(struct platform_dev\n+ \tif (port_map)\n+ \t\tesw->port_map = be32_to_cpu(*port_map);\n+ \n++\tport_disable = of_get_property(np, \"mediatek,portdisable\", NULL);\n++\tif (port_disable)\n++\t\tesw->port_disable = be32_to_cpu(*port_disable);\n++\n+ \treg_init = of_get_property(np, \"mediatek,led_polarity\", NULL);\n+ \tif (reg_init)\n+ \t\tesw->reg_led_polarity = be32_to_cpu(*reg_init);\n+--- a/Documentation/devicetree/bindings/net/ralink,rt3050-esw.txt\n++++ b/Documentation/devicetree/bindings/net/ralink,rt3050-esw.txt\n+@@ -16,6 +16,7 @@ Required properties:\n+ Optional properties:\n+ - mediatek,portmap: can be used to choose if the default switch setup is\n+   llllw or wllll\n++- mediatek,portdisable: disable unused ethernet PHYs to save power\n+ - mediatek,led_polarity: override the active high/low settings of the leds\n+ \n+ Example:\n",
    "prefixes": [
        "OpenWrt-Devel",
        "4/6"
    ]
}