get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 807993,
    "url": "http://patchwork.ozlabs.org/api/patches/807993/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/1504140569-2063-1-git-send-email-f.fainelli@gmail.com/",
    "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": "<1504140569-2063-1-git-send-email-f.fainelli@gmail.com>",
    "list_archive_url": null,
    "date": "2017-08-31T00:49:29",
    "name": "[net] Revert \"net: phy: Correctly process PHY_HALTED in phy_stop_machine()\"",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ed251dbfadfb364eceeeb50bceb2fabb42d1fafd",
    "submitter": {
        "id": 2800,
        "url": "http://patchwork.ozlabs.org/api/people/2800/?format=api",
        "name": "Florian Fainelli",
        "email": "f.fainelli@gmail.com"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/1504140569-2063-1-git-send-email-f.fainelli@gmail.com/mbox/",
    "series": [
        {
            "id": 729,
            "url": "http://patchwork.ozlabs.org/api/series/729/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=729",
            "date": "2017-08-31T00:49:29",
            "name": "[net] Revert \"net: phy: Correctly process PHY_HALTED in phy_stop_machine()\"",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/729/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/807993/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/807993/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"WR2qxNYh\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjP7N4NZBz9s83\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 31 Aug 2017 10:55:44 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751242AbdHaAzk (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tWed, 30 Aug 2017 20:55:40 -0400",
            "from mail-wm0-f66.google.com ([74.125.82.66]:37408 \"EHLO\n\tmail-wm0-f66.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751086AbdHaAzj (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Wed, 30 Aug 2017 20:55:39 -0400",
            "by mail-wm0-f66.google.com with SMTP id x189so3384514wmg.4\n\tfor <netdev@vger.kernel.org>; Wed, 30 Aug 2017 17:55:38 -0700 (PDT)",
            "from stb-bld-04.irv.broadcom.com ([192.19.255.250])\n\tby smtp.gmail.com with ESMTPSA id\n\t7sm4549847wrn.87.2017.08.30.17.55.34\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 30 Aug 2017 17:55:36 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id;\n\tbh=15aCI61oz+Kp3Ek8xPpKG8T3XHNrrrZNlB3L+Ex6PPA=;\n\tb=WR2qxNYhI8VHIIrN/Kj6HTuFH4XGULRs+MdO47X5FCwye/u82eylKvLaSfxfGXqUP+\n\tiUrb+ubrdhpvLyAScIk4SsDxrjdCuJQUJyv3NbnpsXGU/TGyl7lHUElzPAQ19dXx0B1g\n\tfh7Gcln6x8GBzPmfX825C7ZtVLlV0cwS2GEYcru+gaKs3RQ2W7duqZGgPWChfUpY1VLc\n\t+TV/TgnK9AZECJWo1+TT3KQYeVAxe/j34irC+gr8NJvW1R+K7rXzl6OOvoN2C5GimrZz\n\twqj3ayJpEIH9D4CpoKqf3PBDVx1GPJuB7mI2pa+ZNsBLdD1iFv8eCeVYz0Tmb6/AY6cq\n\t4X6g==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id;\n\tbh=15aCI61oz+Kp3Ek8xPpKG8T3XHNrrrZNlB3L+Ex6PPA=;\n\tb=b1O8s/XtjMcqHhFX7sgXeNygXnTO/wXImHuLWsSOP7ndI7cn9q8bEDbBtTPUSatlVO\n\tnIVXu+MKPStlJOc+BBGJb1LeuBdl1K6Wj8ssacZZQqErjVUTg6CVFG6PUkTAbToppwHU\n\tYqbzGHWgS2Uz3JlRY105GTSX6ldj6M1Ihi0WbhHqQEYR6+KHm0owhjgVHZPyiHrKh1TQ\n\t2tjvY2TL/CWCeTaj7xixjHOxyLiiIhMcwlMNkIDlYQkKLgp/+TwfHF2WnXVD/L2piCDv\n\tcGcjqC7zrgWijjOgD7CBB2/LadrRu9VX9MKSEarlfXVIACONTGvvXi0rgilH6tAq3wcQ\n\twxXA==",
        "X-Gm-Message-State": "AHYfb5gEOdMyhs6ZUs7rA5IM9KG94Lj4qq2MJunbBNMlHzlxqTd2LiCy\n\t4fchyI6ii8QuHReG5Og=",
        "X-Received": "by 10.28.45.20 with SMTP id t20mr2709730wmt.5.1504140937510;\n\tWed, 30 Aug 2017 17:55:37 -0700 (PDT)",
        "From": "Florian Fainelli <f.fainelli@gmail.com>",
        "To": "netdev@vger.kernel.org",
        "Cc": "Geert Uytterhoeven <geert+renesas@glider.be>,\n\tDavid Daney <ddaney.cavm@gmail.com>, slash.tmp@free.fr,\n\tmarc_gonzales@sigmadesigns.com, davem@davemloft.net,\n\tandrew@lunn.ch, Florian Fainelli <f.fainelli@gmail.com>",
        "Subject": "[PATCH net] Revert \"net: phy: Correctly process PHY_HALTED in\n\tphy_stop_machine()\"",
        "Date": "Wed, 30 Aug 2017 17:49:29 -0700",
        "Message-Id": "<1504140569-2063-1-git-send-email-f.fainelli@gmail.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "This reverts commit 7ad813f208533cebfcc32d3d7474dc1677d1b09a (\"net: phy:\nCorrectly process PHY_HALTED in phy_stop_machine()\") because it is\ncreating the possibility for a NULL pointer dereference.\n\nDavid Daney provide the following call trace and diagram of events:\n\nWhen ndo_stop() is called we call:\n\n phy_disconnect()\n    +---> phy_stop_interrupts() implies: phydev->irq = PHY_POLL;\n    +---> phy_stop_machine()\n    |      +---> phy_state_machine()\n    |              +----> queue_delayed_work(): Work queued.\n    +--->phy_detach() implies: phydev->attached_dev = NULL;\n\nNow at a later time the queued work does:\n\n phy_state_machine()\n    +---->netif_carrier_off(phydev->attached_dev): Oh no! It is NULL:\n\n CPU 12 Unable to handle kernel paging request at virtual address\n0000000000000048, epc == ffffffff80de37ec, ra == ffffffff80c7c\nOops[#1]:\nCPU: 12 PID: 1502 Comm: kworker/12:1 Not tainted 4.9.43-Cavium-Octeon+ #1\nWorkqueue: events_power_efficient phy_state_machine\ntask: 80000004021ed100 task.stack: 8000000409d70000\n$ 0   : 0000000000000000 ffffffff84720060 0000000000000048 0000000000000004\n$ 4   : 0000000000000000 0000000000000001 0000000000000004 0000000000000000\n$ 8   : 0000000000000000 0000000000000000 00000000ffff98f3 0000000000000000\n$12   : 8000000409d73fe0 0000000000009c00 ffffffff846547c8 000000000000af3b\n$16   : 80000004096bab68 80000004096babd0 0000000000000000 80000004096ba800\n$20   : 0000000000000000 0000000000000000 ffffffff81090000 0000000000000008\n$24   : 0000000000000061 ffffffff808637b0\n$28   : 8000000409d70000 8000000409d73cf0 80000000271bd300 ffffffff80c7804c\nHi    : 000000000000002a\nLo    : 000000000000003f\nepc   : ffffffff80de37ec netif_carrier_off+0xc/0x58\nra    : ffffffff80c7804c phy_state_machine+0x48c/0x4f8\nStatus: 14009ce3        KX SX UX KERNEL EXL IE\nCause : 00800008 (ExcCode 02)\nBadVA : 0000000000000048\nPrId  : 000d9501 (Cavium Octeon III)\nModules linked in:\nProcess kworker/12:1 (pid: 1502, threadinfo=8000000409d70000,\ntask=80000004021ed100, tls=0000000000000000)\nStack : 8000000409a54000 80000004096bab68 80000000271bd300 80000000271c1e00\n        0000000000000000 ffffffff808a1708 8000000409a54000 80000000271bd300\n        80000000271bd320 8000000409a54030 ffffffff80ff0f00 0000000000000001\n        ffffffff81090000 ffffffff808a1ac0 8000000402182080 ffffffff84650000\n        8000000402182080 ffffffff84650000 ffffffff80ff0000 8000000409a54000\n        ffffffff808a1970 0000000000000000 80000004099e8000 8000000402099240\n        0000000000000000 ffffffff808a8598 0000000000000000 8000000408eeeb00\n        8000000409a54000 00000000810a1d00 0000000000000000 8000000409d73de8\n        8000000409d73de8 0000000000000088 000000000c009c00 8000000409d73e08\n        8000000409d73e08 8000000402182080 ffffffff808a84d0 8000000402182080\n        ...\nCall Trace:\n[<ffffffff80de37ec>] netif_carrier_off+0xc/0x58\n[<ffffffff80c7804c>] phy_state_machine+0x48c/0x4f8\n[<ffffffff808a1708>] process_one_work+0x158/0x368\n[<ffffffff808a1ac0>] worker_thread+0x150/0x4c0\n[<ffffffff808a8598>] kthread+0xc8/0xe0\n[<ffffffff808617f0>] ret_from_kernel_thread+0x14/0x1c\n\nThe original motivation for this change originated from Marc Gonzales\nindicating that his network driver did not have its adjust_link callback\nexecuting with phydev->link = 0 while he was expecting it.\n\nPHYLIB has never made any such guarantees ever because phy_stop() merely just\ntells the workqueue to move into PHY_HALTED state which will happen\nasynchronously.\n\nReported-by: Geert Uytterhoeven <geert+renesas@glider.be>\nReported-by: David Daney <ddaney.cavm@gmail.com>\nFixes: 7ad813f20853 (\"net: phy: Correctly process PHY_HALTED in phy_stop_machine()\")\nSigned-off-by: Florian Fainelli <f.fainelli@gmail.com>\n---\n drivers/net/phy/phy.c | 3 ---\n 1 file changed, 3 deletions(-)",
    "diff": "diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c\nindex 5068c582d502..d0626bf5c540 100644\n--- a/drivers/net/phy/phy.c\n+++ b/drivers/net/phy/phy.c\n@@ -749,9 +749,6 @@ void phy_stop_machine(struct phy_device *phydev)\n \tif (phydev->state > PHY_UP && phydev->state != PHY_HALTED)\n \t\tphydev->state = PHY_UP;\n \tmutex_unlock(&phydev->lock);\n-\n-\t/* Now we can run the state machine synchronously */\n-\tphy_state_machine(&phydev->state_queue.work);\n }\n \n /**\n",
    "prefixes": [
        "net"
    ]
}