Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1050639/?format=api
{ "id": 1050639, "url": "http://patchwork.ozlabs.org/api/patches/1050639/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190302160115.GA6172@rani.riverdale.lan/", "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": "<20190302160115.GA6172@rani.riverdale.lan>", "list_archive_url": null, "date": "2019-03-02T16:01:17", "name": "igb: Fix WARN_ONCE on runtime suspend", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "00b6c1c78a5362a606a3105c1987030a0a278d28", "submitter": { "id": 76087, "url": "http://patchwork.ozlabs.org/api/people/76087/?format=api", "name": "Arvind Sankar", "email": "niveditas98@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/20190302160115.GA6172@rani.riverdale.lan/mbox/", "series": [ { "id": 95112, "url": "http://patchwork.ozlabs.org/api/series/95112/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=95112", "date": "2019-03-02T16:01:17", "name": "igb: Fix WARN_ONCE on runtime suspend", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/95112/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1050639/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1050639/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\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=\"crFdc8HA\"; dkim-atps=neutral" ], "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 44BWHY2yfhz9sN1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 3 Mar 2019 03:01:26 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 26747819A8;\n\tSat, 2 Mar 2019 16:01:24 +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 FmVSvXsH8EkA; Sat, 2 Mar 2019 16:01:23 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 2D6C481419;\n\tSat, 2 Mar 2019 16:01:23 +0000 (UTC)", "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id C19B31BF32A\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 2 Mar 2019 16:01:21 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id BB74A87E9B\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 2 Mar 2019 16:01:21 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id mZwpdvh8iihW for <intel-wired-lan@lists.osuosl.org>;\n\tSat, 2 Mar 2019 16:01:21 +0000 (UTC)", "from mail-qt1-f193.google.com (mail-qt1-f193.google.com\n\t[209.85.160.193])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 2A73C8226F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 2 Mar 2019 16:01:21 +0000 (UTC)", "by mail-qt1-f193.google.com with SMTP id o6so812242qtk.6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tSat, 02 Mar 2019 08:01:21 -0800 (PST)", "from rani.riverdale.lan ([2001:470:1f07:5f3::b55f])\n\tby smtp.gmail.com with ESMTPSA id\n\t24sm688768qtu.17.2019.03.02.08.01.19\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tSat, 02 Mar 2019 08:01:19 -0800 (PST)" ], "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=date:from:to:cc:subject:message-id:mime-version:content-disposition\n\t:user-agent; bh=55C4QIVJooPy+3I5yed2TidsOYGoYF86opLnJiFVQi4=;\n\tb=crFdc8HAgo6KcgV2Bu0qDnpOFvTKBCxzjHN24K4YrPT580qNY853/lGILV3bXSPjIU\n\tDXhBSjpBQn4DDE+2lqDjAyM4SeANaRnRedo/hlrD05AzZwOAdTX3qp06/KfIxAZ0ggVa\n\tedS3OAlLCB8103RcEf3Nbo09t0nQTAJaxn0Mm6UOH/AQzaPsZ8HhV3jNKX3oFVXlDWFq\n\trq69M0wSH6kipXFsRuP2pGuTfPWhtW+ERh1dCbf9jU8HwjQmXji7IlA73ttzzqPFWAxO\n\tCVCIOG9JhI/YMw205O8fooYSN7o9cUMenavClqqnIkGWFeVSNaAaSecUoz8+NjlwCsRC\n\tLe+Q==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version\n\t:content-disposition:user-agent;\n\tbh=55C4QIVJooPy+3I5yed2TidsOYGoYF86opLnJiFVQi4=;\n\tb=ipGWJcMCIXHxlsnpQXehPdODYTe0BxypIZbHiInrAoErWdebMoeTwliwkhwtYDBJBf\n\tyYfr63ZJnqu32OOwj/TjOdkOdtQYe2PVgx0aze478XXPFJzGsVl9rpdSM+csmEuZEeQv\n\tQxE3WkXK443SlO0H4HOGiHMxZEi1fPnAYJ5Q5C9iNR6bCGohKAgYLJHdtuY4/JXgfV/N\n\tpkHWxZsWuxruKG0P8o4Sdfp9OPfZ7c7wpQgKVVfq2OYs73wanqDDbJ2XjWZXopYUtAdI\n\tf+lFV5PngfoadBSNINxzWOZReSB0akq2Zacqy7QqCUI3Y/j1w3OEXNBTOYGef4MW+Yks\n\tTbFA==", "X-Gm-Message-State": "APjAAAUJMCw1bP+zxo6v5koezK4v3feNjMQm9mb+pZ7n7vOhNYquwAOf\n\tv8ObqKDHZNXAR+RGlLZwEgFIZiCUb9/+Bg==", "X-Google-Smtp-Source": "APXvYqyw+Q4TamC6AbJor7nYKgovUpX7+KbigcyVEntE0sTwM7x1rRkUpAzRUCfg3M8NyQjrRMsDkw==", "X-Received": "by 2002:a0c:bd97:: with SMTP id n23mr8340121qvg.58.1551542479570;\n\tSat, 02 Mar 2019 08:01:19 -0800 (PST)", "Date": "Sat, 2 Mar 2019 11:01:17 -0500", "From": "Arvind Sankar <niveditas98@gmail.com>", "To": "intel-wired-lan@lists.osuosl.org", "Message-ID": "<20190302160115.GA6172@rani.riverdale.lan>", "MIME-Version": "1.0", "Content-Disposition": "inline", "User-Agent": "Mutt/1.10.1 (2018-07-13)", "Subject": "[Intel-wired-lan] [PATCH] igb: Fix WARN_ONCE on runtime suspend", "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": "Kai-Heng Feng <kai.heng.feng@canonical.com>,\n\tlinux-kernel <linux-kernel@vger.kernel.org>, linux-pm@vger.kernel.org", "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": "The runtime_suspend device callbacks are not supposed to save\nconfiguration state or change the power state. Commit fb29f76cc566\n(\"igb: Fix an issue that PME is not enabled during runtime suspend\")\nchanged the driver to not save configuration state during runtime\nsuspend, however the driver callback still put the device into a\nlow-power state. This causes a warning in the pci pm core and results in\npci_pm_runtime_suspend not calling pci_save_state or pci_finish_runtime_suspend.\n\nFix this by not changing the power state either, leaving that to pci pm\ncore, and make the same change for suspend callback as well.\n\nAlso move a couple of defines into the appropriate header file instead\nof inline in the .c file.\n\nFixes: fb29f76cc566 (\"igb: Fix an issue that PME is not enabled during runtime suspend\")\nSigned-off-by: Arvind Sankar <niveditas98@gmail.com>\n---\n .../net/ethernet/intel/igb/e1000_defines.h | 2 +\n drivers/net/ethernet/intel/igb/igb_main.c | 57 +++----------------\n 2 files changed, 10 insertions(+), 49 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/igb/e1000_defines.h b/drivers/net/ethernet/intel/igb/e1000_defines.h\nindex 8a28f3388f69..dca671591ef6 100644\n--- a/drivers/net/ethernet/intel/igb/e1000_defines.h\n+++ b/drivers/net/ethernet/intel/igb/e1000_defines.h\n@@ -194,6 +194,8 @@\n /* enable link status from external LINK_0 and LINK_1 pins */\n #define E1000_CTRL_SWDPIN0 0x00040000 /* SWDPIN 0 value */\n #define E1000_CTRL_SWDPIN1 0x00080000 /* SWDPIN 1 value */\n+#define E1000_CTRL_ADVD3WUC 0x00100000 /* D3 WUC */\n+#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000 /* PHY PM enable */\n #define E1000_CTRL_SDP0_DIR 0x00400000 /* SDP0 Data direction */\n #define E1000_CTRL_SDP1_DIR 0x00800000 /* SDP1 Data direction */\n #define E1000_CTRL_RST 0x04000000 /* Global reset */\ndiff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c\nindex 93f150784cfc..c2b3a2ff1471 100644\n--- a/drivers/net/ethernet/intel/igb/igb_main.c\n+++ b/drivers/net/ethernet/intel/igb/igb_main.c\n@@ -8754,9 +8754,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,\n \tstruct e1000_hw *hw = &adapter->hw;\n \tu32 ctrl, rctl, status;\n \tu32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;\n-#ifdef CONFIG_PM\n-\tint retval = 0;\n-#endif\n+\tbool wake;\n \n \trtnl_lock();\n \tnetif_device_detach(netdev);\n@@ -8769,14 +8767,6 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,\n \tigb_clear_interrupt_scheme(adapter);\n \trtnl_unlock();\n \n-#ifdef CONFIG_PM\n-\tif (!runtime) {\n-\t\tretval = pci_save_state(pdev);\n-\t\tif (retval)\n-\t\t\treturn retval;\n-\t}\n-#endif\n-\n \tstatus = rd32(E1000_STATUS);\n \tif (status & E1000_STATUS_LU)\n \t\twufc &= ~E1000_WUFC_LNKC;\n@@ -8793,10 +8783,6 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,\n \t\t}\n \n \t\tctrl = rd32(E1000_CTRL);\n-\t\t/* advertise wake from D3Cold */\n-\t\t#define E1000_CTRL_ADVD3WUC 0x00100000\n-\t\t/* phy power management enable */\n-\t\t#define E1000_CTRL_EN_PHY_PWR_MGMT 0x00200000\n \t\tctrl |= E1000_CTRL_ADVD3WUC;\n \t\twr32(E1000_CTRL, ctrl);\n \n@@ -8810,12 +8796,15 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,\n \t\twr32(E1000_WUFC, 0);\n \t}\n \n-\t*enable_wake = wufc || adapter->en_mng_pt;\n-\tif (!*enable_wake)\n+\twake = wufc || adapter->en_mng_pt;\n+\tif (!wake)\n \t\tigb_power_down_link(adapter);\n \telse\n \t\tigb_power_up_link(adapter);\n \n+\tif (enable_wake)\n+\t\t*enable_wake = wake;\n+\n \t/* Release control of h/w to f/w. If f/w is AMT enabled, this\n \t * would have already happened in close and is redundant.\n \t */\n@@ -8858,22 +8847,7 @@ static void igb_deliver_wake_packet(struct net_device *netdev)\n \n static int __maybe_unused igb_suspend(struct device *dev)\n {\n-\tint retval;\n-\tbool wake;\n-\tstruct pci_dev *pdev = to_pci_dev(dev);\n-\n-\tretval = __igb_shutdown(pdev, &wake, 0);\n-\tif (retval)\n-\t\treturn retval;\n-\n-\tif (wake) {\n-\t\tpci_prepare_to_sleep(pdev);\n-\t} else {\n-\t\tpci_wake_from_d3(pdev, false);\n-\t\tpci_set_power_state(pdev, PCI_D3hot);\n-\t}\n-\n-\treturn 0;\n+\treturn __igb_shutdown(to_pci_dev(dev), NULL, 0);\n }\n \n static int __maybe_unused igb_resume(struct device *dev)\n@@ -8944,22 +8918,7 @@ static int __maybe_unused igb_runtime_idle(struct device *dev)\n \n static int __maybe_unused igb_runtime_suspend(struct device *dev)\n {\n-\tstruct pci_dev *pdev = to_pci_dev(dev);\n-\tint retval;\n-\tbool wake;\n-\n-\tretval = __igb_shutdown(pdev, &wake, 1);\n-\tif (retval)\n-\t\treturn retval;\n-\n-\tif (wake) {\n-\t\tpci_prepare_to_sleep(pdev);\n-\t} else {\n-\t\tpci_wake_from_d3(pdev, false);\n-\t\tpci_set_power_state(pdev, PCI_D3hot);\n-\t}\n-\n-\treturn 0;\n+\treturn __igb_shutdown(to_pci_dev(dev), NULL, 1);\n }\n \n static int __maybe_unused igb_runtime_resume(struct device *dev)\n", "prefixes": [] }