get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1175300,
    "url": "http://patchwork.ozlabs.org/api/patches/1175300/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191011153452.22313.70522.stgit@localhost.localdomain/",
    "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": "<20191011153452.22313.70522.stgit@localhost.localdomain>",
    "list_archive_url": null,
    "date": "2019-10-11T15:34:52",
    "name": "[next-queue,v2,1/2] e1000e: Use rtnl_lock to prevent race conditions between net and pci/pm",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "357069c6c4589c1e6ec197e163103604a843a083",
    "submitter": {
        "id": 252,
        "url": "http://patchwork.ozlabs.org/api/people/252/?format=api",
        "name": "Alexander Duyck",
        "email": "alexander.duyck@gmail.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/20191011153452.22313.70522.stgit@localhost.localdomain/mbox/",
    "series": [
        {
            "id": 135628,
            "url": "http://patchwork.ozlabs.org/api/series/135628/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=135628",
            "date": "2019-10-11T15:34:44",
            "name": "Address IRQ related crash seen due to io_perm_failure",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/135628/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1175300/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1175300/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.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=gmail.com",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"hvgkB9NS\"; dkim-atps=neutral"
        ],
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 46qX8474zXz9sNx\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 12 Oct 2019 02:35:00 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id E795186C8E;\n\tFri, 11 Oct 2019 15:34:58 +0000 (UTC)",
            "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id P359JLDBHOBr; Fri, 11 Oct 2019 15:34:58 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 1D7E1861C9;\n\tFri, 11 Oct 2019 15:34:58 +0000 (UTC)",
            "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 710001BF2AB\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Oct 2019 15:34:56 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 6D1BA2033E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Oct 2019 15:34:56 +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 eCB8c-9JX1p0 for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Oct 2019 15:34:55 +0000 (UTC)",
            "from mail-qt1-f196.google.com (mail-qt1-f196.google.com\n\t[209.85.160.196])\n\tby silver.osuosl.org (Postfix) with ESMTPS id 5254420358\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Oct 2019 15:34:55 +0000 (UTC)",
            "by mail-qt1-f196.google.com with SMTP id l49so472191qtc.4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Oct 2019 08:34:55 -0700 (PDT)",
            "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\t63sm4345649qkh.82.2019.10.11.08.34.53\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tFri, 11 Oct 2019 08:34:53 -0700 (PDT)"
        ],
        "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=gmail.com; s=20161025;\n\th=subject:from:to:cc:date:message-id:in-reply-to:references\n\t:user-agent:mime-version:content-transfer-encoding;\n\tbh=2TneVaqkEeq7iRsx8qpUF3PWYTP/k7iRKEvf+OH4SAM=;\n\tb=hvgkB9NSY9OOOARCqHzjvawgDiVddbwdhx2EG1OuiCP48FoQLPnOa326Vc93eys/HQ\n\t7EDSX1VDepP6ekoR+uaacLRAVgTx//XgcaBU4/LdB/jaq3hbjs2tlvvNgyNlU7EwPYxN\n\t1KbxAPuznBJQYgSjPl4i7ORR9ijB80EG3SELMDE6HhyZPbDdicR6COroWcyh6pxxlG5v\n\t91018w7D7y3/jnwUhgMZYMk35ISopyB9uHKJyqgPzJJ77P6Z4l5ezFzPFbHxKjVprAtS\n\tTr2SWpexie93ePcAmnoHP4Kmi9u4JEfecfUVQ1jxdep0903Q6Z4eXA3AFtWxIH931E9l\n\tec0g==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:from:to:cc:date:message-id:in-reply-to\n\t:references:user-agent:mime-version:content-transfer-encoding;\n\tbh=2TneVaqkEeq7iRsx8qpUF3PWYTP/k7iRKEvf+OH4SAM=;\n\tb=ZMcDhR9z6qUfVDfgeU5kh+tgymmyqz/iKvNqYeWxAx9+kHO7ZNHROQs7YvKYa0f/Mi\n\t3Vjy9b36SUkDnV+KodD49qL/26CDi4KfwqKWMO6eQUmUlW8e+bHHJwAtHNsbFIM1VsLY\n\tV9jyI0qJ1chhEBsQSPZQX/mz1NtwtLYZQl7zXEFOczxTzsLnDVTam6YBb1pDXEAtvwrm\n\tNO+7Cdaxyg6BDVTZfq3lxKI8/j/+MHO7MReYz4rgtPctjON9OBYBocYxkYe6KewGzSR9\n\t7z2zsWfccaHJ2wTEA0G/ZElGjAzwHYGsIdSOOI5kZYse8SUVJUqWRDkr3HOY+yTabz9y\n\tUZ/Q==",
        "X-Gm-Message-State": "APjAAAXY9J3pwnbkJL91A9irzHo9E8qRkfOVTqCoaWwItWEWY7qll5Jc\n\tFsIo0XYX7r6QmnHyjBzK8wo=",
        "X-Google-Smtp-Source": "APXvYqx5GuDSEFLUieBCplZoo7+ZF+DCt+DvOTvBNBAQa2iTVa0mNRjgSfSL9deseyETIedwJLL0oQ==",
        "X-Received": "by 2002:ac8:108e:: with SMTP id\n\ta14mr17902032qtj.225.1570808094266; \n\tFri, 11 Oct 2019 08:34:54 -0700 (PDT)",
        "From": "Alexander Duyck <alexander.duyck@gmail.com>",
        "To": "alexander.h.duyck@linux.intel.com, intel-wired-lan@lists.osuosl.org,\n\tjeffrey.t.kirsher@intel.com",
        "Date": "Fri, 11 Oct 2019 08:34:52 -0700",
        "Message-ID": "<20191011153452.22313.70522.stgit@localhost.localdomain>",
        "In-Reply-To": "<20191011153219.22313.60179.stgit@localhost.localdomain>",
        "References": "<20191011153219.22313.60179.stgit@localhost.localdomain>",
        "User-Agent": "StGit/0.17.1-dirty",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [next-queue PATCH v2 1/2] e1000e: Use rtnl_lock\n\tto prevent race conditions between net and pci/pm",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "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>",
        "Cc": "netdev@vger.kernel.org, zdai@us.ibm.com, zdai@linux.vnet.ibm.com",
        "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": "From: Alexander Duyck <alexander.h.duyck@linux.intel.com>\n\nThis patch is meant to address possible race conditions that can exist\nbetween network configuration and power management. A similar issue was\nfixed for igb in commit 9474933caf21 (\"igb: close/suspend race in\nnetif_device_detach\").\n\nIn addition it consolidates the code so that the PCI error handling code\nwill essentially perform the power management freeze on the device prior to\nattempting a reset, and will thaw the device afterwards if that is what it\nis planning to do. Otherwise when we call close on the interface it should\nsee it is detached and not attempt to call the logic to down the interface\nand free the IRQs again.\n\n>From what I can tell the check that was adding the check for __E1000_DOWN\nin e1000e_close was added when runtime power management was added. However\nit should not be relevant for us as we perform a call to\npm_runtime_get_sync before we call e1000_down/free_irq so it should always\nbe back up before we call into this anyway.\n\nReported-by: Morumuri Srivalli <smorumu1@in.ibm.com>\nTested-by: David Dai <zdai@linux.vnet.ibm.com>\nSigned-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>\n---\n drivers/net/ethernet/intel/e1000e/netdev.c |   68 ++++++++++++++--------------\n 1 file changed, 35 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex d7d56e42a6aa..db1591eef28e 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -4715,12 +4715,12 @@ int e1000e_close(struct net_device *netdev)\n \n \tpm_runtime_get_sync(&pdev->dev);\n \n-\tif (!test_bit(__E1000_DOWN, &adapter->state)) {\n+\tif (netif_device_present(netdev)) {\n \t\te1000e_down(adapter, true);\n \t\te1000_free_irq(adapter);\n \n \t\t/* Link status message must follow this format */\n-\t\tpr_info(\"%s NIC Link is Down\\n\", adapter->netdev->name);\n+\t\tpr_info(\"%s NIC Link is Down\\n\", netdev->name);\n \t}\n \n \tnapi_disable(&adapter->napi);\n@@ -6298,10 +6298,14 @@ static int e1000e_pm_freeze(struct device *dev)\n {\n \tstruct net_device *netdev = dev_get_drvdata(dev);\n \tstruct e1000_adapter *adapter = netdev_priv(netdev);\n+\tbool present;\n \n+\trtnl_lock();\n+\n+\tpresent = netif_device_present(netdev);\n \tnetif_device_detach(netdev);\n \n-\tif (netif_running(netdev)) {\n+\tif (present && netif_running(netdev)) {\n \t\tint count = E1000_CHECK_RESET_COUNT;\n \n \t\twhile (test_bit(__E1000_RESETTING, &adapter->state) && count--)\n@@ -6313,6 +6317,8 @@ static int e1000e_pm_freeze(struct device *dev)\n \t\te1000e_down(adapter, false);\n \t\te1000_free_irq(adapter);\n \t}\n+\trtnl_unlock();\n+\n \te1000e_reset_interrupt_capability(adapter);\n \n \t/* Allow time for pending master requests to run */\n@@ -6560,6 +6566,30 @@ static void e1000e_disable_aspm_locked(struct pci_dev *pdev, u16 state)\n \t__e1000e_disable_aspm(pdev, state, 1);\n }\n \n+static int e1000e_pm_thaw(struct device *dev)\n+{\n+\tstruct net_device *netdev = dev_get_drvdata(dev);\n+\tstruct e1000_adapter *adapter = netdev_priv(netdev);\n+\tint rc = 0;\n+\n+\te1000e_set_interrupt_capability(adapter);\n+\n+\trtnl_lock();\n+\tif (netif_running(netdev)) {\n+\t\trc = e1000_request_irq(adapter);\n+\t\tif (rc)\n+\t\t\tgoto err_irq;\n+\n+\t\te1000e_up(adapter);\n+\t}\n+\n+\tnetif_device_attach(netdev);\n+err_irq:\n+\trtnl_unlock();\n+\n+\treturn rc;\n+}\n+\n #ifdef CONFIG_PM\n static int __e1000_resume(struct pci_dev *pdev)\n {\n@@ -6627,26 +6657,6 @@ static int __e1000_resume(struct pci_dev *pdev)\n }\n \n #ifdef CONFIG_PM_SLEEP\n-static int e1000e_pm_thaw(struct device *dev)\n-{\n-\tstruct net_device *netdev = dev_get_drvdata(dev);\n-\tstruct e1000_adapter *adapter = netdev_priv(netdev);\n-\n-\te1000e_set_interrupt_capability(adapter);\n-\tif (netif_running(netdev)) {\n-\t\tu32 err = e1000_request_irq(adapter);\n-\n-\t\tif (err)\n-\t\t\treturn err;\n-\n-\t\te1000e_up(adapter);\n-\t}\n-\n-\tnetif_device_attach(netdev);\n-\n-\treturn 0;\n-}\n-\n static int e1000e_pm_suspend(struct device *dev)\n {\n \tstruct pci_dev *pdev = to_pci_dev(dev);\n@@ -6818,16 +6828,11 @@ static void e1000_netpoll(struct net_device *netdev)\n static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev,\n \t\t\t\t\t\tpci_channel_state_t state)\n {\n-\tstruct net_device *netdev = pci_get_drvdata(pdev);\n-\tstruct e1000_adapter *adapter = netdev_priv(netdev);\n-\n-\tnetif_device_detach(netdev);\n+\te1000e_pm_freeze(&pdev->dev);\n \n \tif (state == pci_channel_io_perm_failure)\n \t\treturn PCI_ERS_RESULT_DISCONNECT;\n \n-\tif (netif_running(netdev))\n-\t\te1000e_down(adapter, true);\n \tpci_disable_device(pdev);\n \n \t/* Request a slot slot reset. */\n@@ -6893,10 +6898,7 @@ static void e1000_io_resume(struct pci_dev *pdev)\n \n \te1000_init_manageability_pt(adapter);\n \n-\tif (netif_running(netdev))\n-\t\te1000e_up(adapter);\n-\n-\tnetif_device_attach(netdev);\n+\te1000e_pm_thaw(&pdev->dev);\n \n \t/* If the controller has AMT, do not set DRV_LOAD until the interface\n \t * is up.  For all other cases, let the f/w know that the h/w is now\n",
    "prefixes": [
        "next-queue",
        "v2",
        "1/2"
    ]
}