get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 844937,
    "url": "http://patchwork.ozlabs.org/api/patches/844937/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1512507389-6226-1-git-send-email-tushar.n.dave@oracle.com/",
    "project": {
        "id": 46,
        "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api",
        "name": "Intel Wired Ethernet development",
        "link_name": "intel-wired-lan",
        "list_id": "intel-wired-lan.osuosl.org",
        "list_email": "intel-wired-lan@osuosl.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1512507389-6226-1-git-send-email-tushar.n.dave@oracle.com>",
    "list_archive_url": null,
    "date": "2017-12-05T20:56:29",
    "name": "[next-queue] e1000: fix disabling already-disabled warning",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1efe60ba4aa5adf38cde6730550d5dc4989ca907",
    "submitter": {
        "id": 68023,
        "url": "http://patchwork.ozlabs.org/api/people/68023/?format=api",
        "name": "Tushar Dave",
        "email": "tushar.n.dave@oracle.com"
    },
    "delegate": {
        "id": 68,
        "url": "http://patchwork.ozlabs.org/api/users/68/?format=api",
        "username": "jtkirshe",
        "first_name": "Jeff",
        "last_name": "Kirsher",
        "email": "jeffrey.t.kirsher@intel.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1512507389-6226-1-git-send-email-tushar.n.dave@oracle.com/mbox/",
    "series": [
        {
            "id": 16891,
            "url": "http://patchwork.ozlabs.org/api/series/16891/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=16891",
            "date": "2017-12-05T20:56:29",
            "name": "[next-queue] e1000: fix disabling already-disabled warning",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/16891/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/844937/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/844937/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<intel-wired-lan-bounces@osuosl.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "intel-wired-lan@lists.osuosl.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=oracle.com header.i=@oracle.com\n\theader.b=\"ORMFtKhx\"; dkim-atps=neutral"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 3yrvF50jQPz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed,  6 Dec 2017 07:56:55 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 570F688AD2;\n\tTue,  5 Dec 2017 20:56:53 +0000 (UTC)",
            "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id OQ2HQhcOmAFn; Tue,  5 Dec 2017 20:56:50 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id DA10E88A96;\n\tTue,  5 Dec 2017 20:56:50 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id BB1D01C01DA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  5 Dec 2017 20:56:49 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id B3CE525D6D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  5 Dec 2017 20:56:49 +0000 (UTC)",
            "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id EtflUGBJcRJj for <intel-wired-lan@lists.osuosl.org>;\n\tTue,  5 Dec 2017 20:56:48 +0000 (UTC)",
            "from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86])\n\tby silver.osuosl.org (Postfix) with ESMTPS id BB27A25C1B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue,  5 Dec 2017 20:56:48 +0000 (UTC)",
            "from pps.filterd (userp2130.oracle.com [127.0.0.1])\n\tby userp2130.oracle.com (8.16.0.21/8.16.0.21) with SMTP id\n\tvB5KtWwG057874; Tue, 5 Dec 2017 20:56:47 GMT",
            "from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233])\n\tby userp2130.oracle.com with ESMTP id 2ekpeyrj71-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=NOT); Tue, 05 Dec 2017 20:56:46 +0000",
            "from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75])\n\tby aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vB5KujRH019400\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256\n\tverify=OK); Tue, 5 Dec 2017 20:56:45 GMT",
            "from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11])\n\tby userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id\n\tvB5KuiG3005706; Tue, 5 Dec 2017 20:56:44 GMT",
            "from tndave-linux.in.oracle.com (/10.191.206.168)\n\tby default (Oracle Beehive Gateway v4.0)\n\twith ESMTP ; Tue, 05 Dec 2017 12:56:43 -0800"
        ],
        "X-Virus-Scanned": [
            "amavisd-new at osuosl.org",
            "amavisd-new at osuosl.org"
        ],
        "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com;\n\th=from : to : subject : date : message-id; s=corp-2017-10-26;\n\tbh=1aU6AodQ8VuiET/uAMVF0xwfYtRrzV2pE/Xd19Ewcbs=;\n\tb=ORMFtKhxKFM84Oy1E6VAl5IimSS8s8tZi6/oFJ+76JAMmkK2NtRBejxishaoBXVWjgva\n\twJ/pbNv6Mb4uCkAGGzS9xTk/dvaoV9pBvfssGUK2O6zfm2bth6P1VC5oiAzkvX9WkWw9\n\tf07HIiohQONgZ+kn/rNzqlyPUYZCx0mLAGCMRMog8pWJjHYxsNhC/rcMi97dc/NR4Wsx\n\t+vQapXN5T5VrGpoLxEX4qAqaSST68WtyVLrtZrHZVudg8QUhWwN9VMREseNhBMSa29q0\n\tY5F5geC9bH69SRurF4WngY9tiYaw7v/3ek34W3jyb/o+HtvzvwFThgtxebybg8fPTKa0\n\t/A== ",
        "From": "Tushar Dave <tushar.n.dave@oracle.com>",
        "To": "jeffrey.t.kirsher@intel.com, intel-wired-lan@lists.osuosl.org,\n\tfengguang.wu@intel.com, netdev@vger.kernel.org",
        "Date": "Wed,  6 Dec 2017 02:26:29 +0530",
        "Message-Id": "<1512507389-6226-1-git-send-email-tushar.n.dave@oracle.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "X-Proofpoint-Virus-Version": "vendor=nai engine=5900 definitions=8736\n\tsignatures=668641",
        "X-Proofpoint-Spam-Details": "rule=notspam policy=default score=0 spamscore=0\n\tsuspectscore=2\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000\n\tdefinitions=main-1712050298",
        "Subject": "[Intel-wired-lan] [next-queue PATCH] e1000: fix disabling\n\talready-disabled warning",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.osuosl.org>",
        "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>",
        "List-Post": "<mailto:intel-wired-lan@osuosl.org>",
        "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>",
        "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "intel-wired-lan-bounces@osuosl.org",
        "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"
    },
    "content": "This patch adds check so that driver does not disable already\ndisabled device.\n\n[   44.637743] advantechwdt: Unexpected close, not stopping watchdog!\n[   44.997548] input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input6\n[   45.013419] e1000 0000:00:03.0: disabling already-disabled device\n[   45.013447] ------------[ cut here ]------------\n[   45.014868] WARNING: CPU: 1 PID: 71 at drivers/pci/pci.c:1641 pci_disable_device+0xa1/0x105:\n\t\t\t\t\t\tpci_disable_device at drivers/pci/pci.c:1640\n[   45.016171] CPU: 1 PID: 71 Comm: rcu_perf_shutdo Not tainted 4.14.0-01330-g3c07399 #1\n[   45.017197] task: ffff88011bee9e40 task.stack: ffffc90000860000\n[   45.017987] RIP: 0010:pci_disable_device+0xa1/0x105:\n\t\t\t\t\t\tpci_disable_device at drivers/pci/pci.c:1640\n[   45.018603] RSP: 0000:ffffc90000863e30 EFLAGS: 00010286\n[   45.019282] RAX: 0000000000000035 RBX: ffff88013a230008 RCX: 0000000000000000\n[   45.020182] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000203\n[   45.021084] RBP: ffff88013a3f31e8 R08: 0000000000000001 R09: 0000000000000000\n[   45.021986] R10: ffffffff827ec29c R11: 0000000000000002 R12: 0000000000000001\n[   45.022946] R13: ffff88013a230008 R14: ffff880117802b20 R15: ffffc90000863e8f\n[   45.023842] FS:  0000000000000000(0000) GS:ffff88013fd00000(0000) knlGS:0000000000000000\n[   45.024863] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\n[   45.025583] CR2: ffffc900006d4000 CR3: 000000000220f000 CR4: 00000000000006a0\n[   45.026478] Call Trace:\n[   45.026811]  __e1000_shutdown+0x1d4/0x1e2:\n\t\t\t\t\t\t__e1000_shutdown at drivers/net/ethernet/intel/e1000/e1000_main.c:5162\n[   45.027344]  ? rcu_perf_cleanup+0x2a1/0x2a1:\n\t\t\t\t\t\trcu_perf_shutdown at kernel/rcu/rcuperf.c:627\n[   45.027883]  e1000_shutdown+0x14/0x3a:\n\t\t\t\t\t\te1000_shutdown at drivers/net/ethernet/intel/e1000/e1000_main.c:5235\n[   45.028351]  device_shutdown+0x110/0x1aa:\n\t\t\t\t\t\tdevice_shutdown at drivers/base/core.c:2807\n[   45.028858]  kernel_power_off+0x31/0x64:\n\t\t\t\t\t\tkernel_power_off at kernel/reboot.c:260\n[   45.029343]  rcu_perf_shutdown+0x9b/0xa7:\n\t\t\t\t\t\trcu_perf_shutdown at kernel/rcu/rcuperf.c:637\n[   45.029852]  ? __wake_up_common_lock+0xa2/0xa2:\n\t\t\t\t\t\tautoremove_wake_function at kernel/sched/wait.c:376\n[   45.030414]  kthread+0x126/0x12e:\n\t\t\t\t\t\tkthread at kernel/kthread.c:233\n[   45.030834]  ? __kthread_bind_mask+0x8e/0x8e:\n\t\t\t\t\t\tkthread at kernel/kthread.c:190\n[   45.031399]  ? ret_from_fork+0x1f/0x30:\n\t\t\t\t\t\tret_from_fork at arch/x86/entry/entry_64.S:443\n[   45.031883]  ? kernel_init+0xa/0xf5:\n\t\t\t\t\t\tkernel_init at init/main.c:997\n[   45.032325]  ret_from_fork+0x1f/0x30:\n\t\t\t\t\t\tret_from_fork at arch/x86/entry/entry_64.S:443\n[   45.032777] Code: 00 48 85 ed 75 07 48 8b ab a8 00 00 00 48 8d bb 98 00 00 00 e8 aa d1 11 00 48 89 ea 48 89 c6 48 c7 c7 d8 e4 0b 82 e8 55 7d da ff <0f> ff b9 01 00 00 00 31 d2 be 01 00 00 00 48 c7 c7 f0 b1 61 82\n[   45.035222] ---[ end trace c257137b1b1976ef ]---\n[   45.037838] ACPI: Preparing to enter system sleep state S5\n\nTested-by: Fengguang Wu <fengguang.wu@intel.com>\nSigned-off-by: Tushar Dave <tushar.n.dave@oracle.com>\n---\n drivers/net/ethernet/intel/e1000/e1000.h      |  3 ++-\n drivers/net/ethernet/intel/e1000/e1000_main.c | 27 ++++++++++++++++++++++-----\n 2 files changed, 24 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/e1000/e1000.h b/drivers/net/ethernet/intel/e1000/e1000.h\nindex d7bdea7..8fd2458 100644\n--- a/drivers/net/ethernet/intel/e1000/e1000.h\n+++ b/drivers/net/ethernet/intel/e1000/e1000.h\n@@ -331,7 +331,8 @@ struct e1000_adapter {\n enum e1000_state_t {\n \t__E1000_TESTING,\n \t__E1000_RESETTING,\n-\t__E1000_DOWN\n+\t__E1000_DOWN,\n+\t__E1000_DISABLED\n };\n \n #undef pr_fmt\ndiff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c\nindex 1982f79..3dd4aeb 100644\n--- a/drivers/net/ethernet/intel/e1000/e1000_main.c\n+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c\n@@ -945,7 +945,7 @@ static int e1000_init_hw_struct(struct e1000_adapter *adapter,\n static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n {\n \tstruct net_device *netdev;\n-\tstruct e1000_adapter *adapter;\n+\tstruct e1000_adapter *adapter = NULL;\n \tstruct e1000_hw *hw;\n \n \tstatic int cards_found;\n@@ -955,6 +955,7 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tu16 tmp = 0;\n \tu16 eeprom_apme_mask = E1000_EEPROM_APME;\n \tint bars, need_ioport;\n+\tbool disable_dev = false;\n \n \t/* do not allocate ioport bars when not needed */\n \tneed_ioport = e1000_is_need_ioport(pdev);\n@@ -1259,11 +1260,13 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n \tiounmap(hw->ce4100_gbe_mdio_base_virt);\n \tiounmap(hw->hw_addr);\n err_ioremap:\n+\tdisable_dev = !test_and_set_bit(__E1000_DISABLED, &adapter->flags);\n \tfree_netdev(netdev);\n err_alloc_etherdev:\n \tpci_release_selected_regions(pdev, bars);\n err_pci_reg:\n-\tpci_disable_device(pdev);\n+\tif (!adapter || disable_dev)\n+\t\tpci_disable_device(pdev);\n \treturn err;\n }\n \n@@ -1281,6 +1284,7 @@ static void e1000_remove(struct pci_dev *pdev)\n \tstruct net_device *netdev = pci_get_drvdata(pdev);\n \tstruct e1000_adapter *adapter = netdev_priv(netdev);\n \tstruct e1000_hw *hw = &adapter->hw;\n+\tbool disable_dev;\n \n \te1000_down_and_stop(adapter);\n \te1000_release_manageability(adapter);\n@@ -1299,9 +1303,11 @@ static void e1000_remove(struct pci_dev *pdev)\n \t\tiounmap(hw->flash_address);\n \tpci_release_selected_regions(pdev, adapter->bars);\n \n+\tdisable_dev = !test_and_set_bit(__E1000_DISABLED, &adapter->flags);\n \tfree_netdev(netdev);\n \n-\tpci_disable_device(pdev);\n+\tif (disable_dev)\n+\t\tpci_disable_device(pdev);\n }\n \n /**\n@@ -5156,7 +5162,8 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)\n \tif (netif_running(netdev))\n \t\te1000_free_irq(adapter);\n \n-\tpci_disable_device(pdev);\n+\tif (!test_and_set_bit(__E1000_DISABLED, &adapter->flags))\n+\t\tpci_disable_device(pdev);\n \n \treturn 0;\n }\n@@ -5200,6 +5207,10 @@ static int e1000_resume(struct pci_dev *pdev)\n \t\tpr_err(\"Cannot enable PCI device from suspend\\n\");\n \t\treturn err;\n \t}\n+\n+\t/* flush memory to make sure state is correct */\n+\tsmp_mb__before_atomic();\n+\tclear_bit(__E1000_DISABLED, &adapter->flags);\n \tpci_set_master(pdev);\n \n \tpci_enable_wake(pdev, PCI_D3hot, 0);\n@@ -5274,7 +5285,9 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,\n \n \tif (netif_running(netdev))\n \t\te1000_down(adapter);\n-\tpci_disable_device(pdev);\n+\n+\tif (!test_and_set_bit(__E1000_DISABLED, &adapter->flags))\n+\t\tpci_disable_device(pdev);\n \n \t/* Request a slot slot reset. */\n \treturn PCI_ERS_RESULT_NEED_RESET;\n@@ -5302,6 +5315,10 @@ static pci_ers_result_t e1000_io_slot_reset(struct pci_dev *pdev)\n \t\tpr_err(\"Cannot re-enable PCI device after reset.\\n\");\n \t\treturn PCI_ERS_RESULT_DISCONNECT;\n \t}\n+\n+\t/* flush memory to make sure state is correct */\n+\tsmp_mb__before_atomic();\n+\tclear_bit(__E1000_DISABLED, &adapter->flags);\n \tpci_set_master(pdev);\n \n \tpci_enable_wake(pdev, PCI_D3hot, 0);\n",
    "prefixes": [
        "next-queue"
    ]
}