Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1173522/?format=api
{ "id": 1173522, "url": "http://patchwork.ozlabs.org/api/patches/1173522/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20191008211638.4575.93695.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": "<20191008211638.4575.93695.stgit@localhost.localdomain>", "list_archive_url": null, "date": "2019-10-08T21:16:38", "name": "[next-queue,1/2] e1000e: Use rtnl_lock to prevent race conditions between net and pci/pm", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "2034526332f10f46aa6192ab014e7c323f0f0e85", "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/20191008211638.4575.93695.stgit@localhost.localdomain/mbox/", "series": [ { "id": 134947, "url": "http://patchwork.ozlabs.org/api/series/134947/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=134947", "date": "2019-10-08T21:16:32", "name": "Address IRQ related crash seen due to io_perm_failure", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/134947/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1173522/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1173522/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.136; helo=silver.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=\"pKvwcmZ3\"; dkim-atps=neutral" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 46nqsp2hf6z9sDB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 9 Oct 2019 08:16:46 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 8DE1B228E2;\n\tTue, 8 Oct 2019 21:16:44 +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 IKRQyB9HoVxY; Tue, 8 Oct 2019 21:16:42 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id C5216228CA;\n\tTue, 8 Oct 2019 21:16:42 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id CA9341BF28E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 8 Oct 2019 21:16:41 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id C44E0864AA\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 8 Oct 2019 21:16:41 +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 F1zxGLdQ-7yX for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 8 Oct 2019 21:16:40 +0000 (UTC)", "from mail-pf1-f196.google.com (mail-pf1-f196.google.com\n\t[209.85.210.196])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id B6EE5862D4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 8 Oct 2019 21:16:40 +0000 (UTC)", "by mail-pf1-f196.google.com with SMTP id 205so143346pfw.2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 08 Oct 2019 14:16:40 -0700 (PDT)", "from localhost.localdomain ([2001:470:b:9c3:9e5c:8eff:fe4f:f2d0])\n\tby smtp.gmail.com with ESMTPSA id\n\t193sm54319pfc.59.2019.10.08.14.16.39\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 08 Oct 2019 14:16:39 -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=9BgLihdw1ZoyXxJf00Tp5DPDBIpdV66c7ObSF0tnLfs=;\n\tb=pKvwcmZ3xe0XMI3Ya/L5wFZ7MGKLCiROvKWI0Kd4vXrPCLv/DjL+FOADw7hpe1jP53\n\tQj0qlXiAilGyuwiLvj9UsqxIwcL7fsEY6b9U23v3ix+I5+td4jtaGaghqmGlUmwb6c+b\n\tCn2frpZlHhvn+X/AhqbAqQdJqyVQgo01kM042F2mhsAR6hvCG7R4rddIFKL2XhZscBZC\n\t+BWquFmjZU5iMMaTpNvZg/xcUGYTxZlwgvJb4pewCILoMRSJObIM1aGeIlECX4GgWFkV\n\tGBXrqamNhfqGnGE1PYlfGJ6e43K3rUn22/etB81boYhfYkkjVCOCIg7Xzxheaj4U3YVP\n\tXUJw==", "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=9BgLihdw1ZoyXxJf00Tp5DPDBIpdV66c7ObSF0tnLfs=;\n\tb=WV+PKBAfRcVJ0iOTMrdIslx4EdYc5AkwPpy23fXN9RaZWTNKKd2ZRCGb7C3OD2K9s4\n\t2iXKgbIF9weWoa/ZQ8rXc06k7sKlR48rz5MC3f8qfpeT5b7psCMJv78IZSqDWZZREwAw\n\tKBWfsW0stCsAPDaHoEvp3iKpzVyee9IH5zK6A8PzTItgoEwLrQaHZ0NU6mxPYrzlQsQf\n\tdhiXMbUHnUYYxMr2ZQ9Y0gw0GcWGmDN+hfmr4XGZXfYyphUavY+/TmTkFmRRMWbhkJEU\n\tGvHIBP2Ofu2JeIK8aRcBbPAmhQDZqjrToDmmH8NE5E9ix0kUcJ2sIN5MKUHpcteDwu8p\n\tIVfg==", "X-Gm-Message-State": "APjAAAXLeTe++jNl8eUUxg5ppb5Fs++snTW6hiCPYdAEEJ3famuOuQqc\n\tNajgztoENv3BaXJoCLsADpI=", "X-Google-Smtp-Source": "APXvYqzsQzfz8Sq+HWGNdatcN5154Rodhhpyu6UgfUFg8rd7NvsUxAviSh9bDWId77DslFKGRkC33Q==", "X-Received": "by 2002:a17:90a:1617:: with SMTP id\n\tn23mr8326148pja.75.1570569399944; \n\tTue, 08 Oct 2019 14:16:39 -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": "Tue, 08 Oct 2019 14:16:38 -0700", "Message-ID": "<20191008211638.4575.93695.stgit@localhost.localdomain>", "In-Reply-To": "<20191008210639.4575.44144.stgit@localhost.localdomain>", "References": "<20191008210639.4575.44144.stgit@localhost.localdomain>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [next-queue PATCH 1/2] e1000e: Use rtnl_lock to\n\tprevent 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 | 40 +++++++++++++++-------------\n 1 file changed, 21 insertions(+), 19 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex d7d56e42a6aa..8b4e589aca36 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@@ -6626,27 +6632,31 @@ static int __e1000_resume(struct pci_dev *pdev)\n \treturn 0;\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+\tint rc = 0;\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+\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 0;\n+\treturn rc;\n }\n \n+#ifdef CONFIG_PM_SLEEP\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", "1/2" ] }