get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 958,
    "url": "http://patchwork.ozlabs.org/api/patches/958/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/200809222152.m8MLq7rr031935@imap1.linux-foundation.org/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<200809222152.m8MLq7rr031935@imap1.linux-foundation.org>",
    "list_archive_url": null,
    "date": "2008-09-22T21:52:07",
    "name": "[01/21] forcedeth: power down phy when interface is down",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "2c004208da23b47f87de461ccedb26a4b7be5ce9",
    "submitter": {
        "id": 107,
        "url": "http://patchwork.ozlabs.org/api/people/107/?format=api",
        "name": "Andrew Morton",
        "email": "akpm@linux-foundation.org"
    },
    "delegate": {
        "id": 36,
        "url": "http://patchwork.ozlabs.org/api/users/36/?format=api",
        "username": "jgarzik",
        "first_name": "Jeff",
        "last_name": "Garzik",
        "email": "jgarzik@pobox.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/200809222152.m8MLq7rr031935@imap1.linux-foundation.org/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/958/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/958/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id A0934DDECA\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 07:53:19 +1000 (EST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753429AbYIVVxP (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 22 Sep 2008 17:53:15 -0400",
            "(majordomo@vger.kernel.org) by vger.kernel.org id S1753315AbYIVVxP\n\t(ORCPT <rfc822; netdev-outgoing>); Mon, 22 Sep 2008 17:53:15 -0400",
            "from smtp1.linux-foundation.org ([140.211.169.13]:54514 \"EHLO\n\tsmtp1.linux-foundation.org\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1753421AbYIVVxO (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 22 Sep 2008 17:53:14 -0400",
            "from imap1.linux-foundation.org (imap1.linux-foundation.org\n\t[140.211.169.55])\n\tby smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with\n\tESMTP id m8MLq8eu018326\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);\n\tMon, 22 Sep 2008 14:52:09 -0700",
            "from localhost.localdomain (localhost [127.0.0.1])\n\tby imap1.linux-foundation.org\n\t(8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id\n\tm8MLq7rr031935; Mon, 22 Sep 2008 14:52:07 -0700"
        ],
        "Message-Id": "<200809222152.m8MLq7rr031935@imap1.linux-foundation.org>",
        "Subject": "[patch 01/21] forcedeth: power down phy when interface is down",
        "To": "jeff@garzik.org",
        "Cc": "netdev@vger.kernel.org, akpm@linux-foundation.org,\n\teswierk@arastra.com, aabdulla@nvidia.com, ajones@riverbed.com",
        "From": "akpm@linux-foundation.org",
        "Date": "Mon, 22 Sep 2008 14:52:07 -0700",
        "X-Spam-Status": "No, hits=-3.359 required=5 tests=AWL, BAYES_00,\n\tOSDL_HEADER_SUBJECT_BRACKETED",
        "X-Spam-Checker-Version": "SpamAssassin 3.2.4-osdl_revision__1.47__",
        "X-MIMEDefang-Filter": "lf$Revision: 1.188 $",
        "X-Scanned-By": "MIMEDefang 2.63 on 140.211.169.13",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: \"Ed Swierk\" <eswierk@arastra.com>\n\nBring the physical link down when the interface is down by placing the PHY\nin power-down state, unless WOL is enabled.  This mirrors the behavior of\nother drivers including e1000 and tg3.\n\nWithout the patch, ifconfig down leaves the physical link up, which confuses\ndatacenter users who expect the link lights both on the NIC and the switch to\ngo out when they bring an interface down.\n\nFurthermore, even though the phy is powered on, autonegotiation stops working,\nso a normally gigabit link might suddenly become 100 Mbit half-duplex when the\ninterface goes down, and become gigabit when it comes up again.\n\nAyaz said:\n\n  I would not include this patch until further testing is performed.  NVIDIA\n  MCP chips use 3rd party PHY vendors.  By powering down the phy, it could\n  have adverse affects on certain phys.\n\nArthur Jones said:\n\n  I just ran across this patch.  Tested on a Marvell 88E1121R (GigE PHY)\n  and works great.  This is a very important feature for me.\n\nSigned-off-by: Ed Swierk <eswierk@arastra.com>\nCc: Jeff Garzik <jeff@garzik.org>\nCc: Ayaz Abdulla <aabdulla@nvidia.com>\nTested-by: Arthur Jones <ajones@riverbed.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\n---\n\n drivers/net/forcedeth.c |   12 ++++++++++--\n 1 file changed, 10 insertions(+), 2 deletions(-)",
    "diff": "diff -puN drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down drivers/net/forcedeth.c\n--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down\n+++ a/drivers/net/forcedeth.c\n@@ -1446,9 +1446,9 @@ static int phy_init(struct net_device *d\n \t/* some phys clear out pause advertisment on reset, set it back */\n \tmii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);\n \n-\t/* restart auto negotiation */\n+\t/* restart auto negotiation, power down phy */\n \tmii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);\n-\tmii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);\n+\tmii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);\n \tif (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {\n \t\treturn PHY_ERROR;\n \t}\n@@ -5210,6 +5210,10 @@ static int nv_open(struct net_device *de\n \n \tdprintk(KERN_DEBUG \"nv_open: begin\\n\");\n \n+\t/* power up phy */\n+\tmii_rw(dev, np->phyaddr, MII_BMCR,\n+\t       mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);\n+\n \t/* erase previous misconfiguration */\n \tif (np->driver_data & DEV_HAS_POWER_CNTRL)\n \t\tnv_mac_reset(dev);\n@@ -5403,6 +5407,10 @@ static int nv_close(struct net_device *d\n \tif (np->wolenabled) {\n \t\twritel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + NvRegPacketFilterFlags);\n \t\tnv_start_rx(dev);\n+\t} else {\n+\t\t/* power down phy */\n+\t\tmii_rw(dev, np->phyaddr, MII_BMCR,\n+\t\t       mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);\n \t}\n \n \t/* FIXME: power down nic */\n",
    "prefixes": [
        "01/21"
    ]
}