Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1143336/?format=api
{ "id": 1143336, "url": "http://patchwork.ozlabs.org/api/patches/1143336/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190807073611.21733-1-vitaly.lifshits@intel.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": "<20190807073611.21733-1-vitaly.lifshits@intel.com>", "list_archive_url": null, "date": "2019-08-07T07:36:11", "name": "[v5] e1000e: PCIm function state support", "commit_ref": null, "pull_url": null, "state": "not-applicable", "archived": false, "hash": "86845070fe1c0ca81461da11fda316825ba5eec0", "submitter": { "id": 76816, "url": "http://patchwork.ozlabs.org/api/people/76816/?format=api", "name": "Lifshits, Vitaly", "email": "vitaly.lifshits@intel.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/20190807073611.21733-1-vitaly.lifshits@intel.com/mbox/", "series": [ { "id": 123723, "url": "http://patchwork.ozlabs.org/api/series/123723/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=123723", "date": "2019-08-07T07:36:11", "name": "[v5] e1000e: PCIm function state support", "version": 5, "mbox": "http://patchwork.ozlabs.org/series/123723/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/1143336/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1143336/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=intel.com" ], "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 463Nbn5J7sz9s7T\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 7 Aug 2019 17:36:21 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3F68E20463;\n\tWed, 7 Aug 2019 07:36:20 +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 n+GfkU0k0FJG; Wed, 7 Aug 2019 07:36:18 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id 1D101221B1;\n\tWed, 7 Aug 2019 07:36:18 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 810DC1BF568\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Aug 2019 07:36:16 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 7D3BD86472\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Aug 2019 07:36:16 +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 HIwjyYV6B2cX for <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Aug 2019 07:36:15 +0000 (UTC)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id B729B86469\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tWed, 7 Aug 2019 07:36:15 +0000 (UTC)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Aug 2019 00:36:14 -0700", "from ccdlinuxdev08.iil.intel.com ([143.185.161.150])\n\tby fmsmga001.fm.intel.com with ESMTP; 07 Aug 2019 00:36:13 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.64,356,1559545200\"; d=\"scan'208\";a=\"192847716\"", "From": "Vitaly Lifshits <vitaly.lifshits@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Wed, 7 Aug 2019 10:36:11 +0300", "Message-Id": "<20190807073611.21733-1-vitaly.lifshits@intel.com>", "X-Mailer": "git-send-email 2.11.0", "Subject": "[Intel-wired-lan] [PATCH v5] e1000e: PCIm function state support", "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>", "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": "Due to commit: 5d8682588605 (\"[misc] mei: me: allow runtime pm for\nplatform with D0i3\"), when the cable is disconnect and reconnected,\nthe NIC can enter a DMoff state. The DMoff state will cause incorrect\nlink indication and duplex setting mismatch.\n\nTo resolve this, we need to check the PCIm function state and perform\na PHY reset after exiting the DMoff state in our watchdog service task.\n\nFixes: 5d8682588605 (\"[misc] mei: me: allow runtime pm for platform with D0i3\")\nLink: https://bugzilla.redhat.com/show_bug.cgi?id=1689436\nSigned-off-by: Vitaly Lifshits <vitaly.lifshits@intel.com>\n---\n\nV2: Fix typos in commit message\nV3: Fix minor typo\nV4: Address community comments\nV5: Address community comments \n---\n drivers/net/ethernet/intel/e1000e/defines.h | 4 ++++\n drivers/net/ethernet/intel/e1000e/netdev.c | 20 +++++++++++++++++++-\n 2 files changed, 23 insertions(+), 1 deletion(-)", "diff": "diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h\nindex fd550dee4982..11452eaac233 100644\n--- a/drivers/net/ethernet/intel/e1000e/defines.h\n+++ b/drivers/net/ethernet/intel/e1000e/defines.h\n@@ -222,6 +222,10 @@\n #define E1000_STATUS_PHYRA 0x00000400 /* PHY Reset Asserted */\n #define E1000_STATUS_GIO_MASTER_ENABLE\t0x00080000\t/* Master Req status */\n \n+/* PCIm function state */\n+#define E1000_STATUS_PCIM_STATE\t0x40000000\n+#define PCIM_DMOFF_EXIT_TIMEOUT\t100\n+\n #define HALF_DUPLEX 1\n #define FULL_DUPLEX 2\n \ndiff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c\nindex b5fed6177ad6..639266485c15 100644\n--- a/drivers/net/ethernet/intel/e1000e/netdev.c\n+++ b/drivers/net/ethernet/intel/e1000e/netdev.c\n@@ -5162,7 +5162,7 @@ static void e1000_watchdog_task(struct work_struct *work)\n \tstruct e1000_phy_info *phy = &adapter->hw.phy;\n \tstruct e1000_ring *tx_ring = adapter->tx_ring;\n \tstruct e1000_hw *hw = &adapter->hw;\n-\tu32 link, tctl;\n+\tu32 link, tctl, pcim_state, tries = 0;\n \n \tif (test_bit(__E1000_DOWN, &adapter->state))\n \t\treturn;\n@@ -5187,6 +5187,24 @@ static void e1000_watchdog_task(struct work_struct *work)\n \t\t\t/* Cancel scheduled suspend requests. */\n \t\t\tpm_runtime_resume(netdev->dev.parent);\n \n+\t\t\t/* Check if MAC is in DMoff state */\n+\t\t\tpcim_state = er32(STATUS);\n+\t\t\twhile (pcim_state & E1000_STATUS_PCIM_STATE) {\n+\t\t\t\tif (tries++ == PCIM_DMOFF_EXIT_TIMEOUT) {\n+\t\t\t\t\te_dbg(\"Error in exiting dmoff\\n\");\n+\t\t\t\t\te_err(\"PCIm DMoff timeout expired\\n\");\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\t\t\t\tusleep_range(10000, 20000);\n+\t\t\t\tpcim_state = er32(STATUS);\n+\n+\t\t\t\t/* If MAC entered DMoff state, PHY reset is\n+\t\t\t\t * needed after exiting it\n+\t\t\t\t */\n+\t\t\t\tif (!(pcim_state & E1000_STATUS_PCIM_STATE))\n+\t\t\t\t\te1000_phy_hw_reset(&adapter->hw);\n+\t\t\t}\n+\n \t\t\t/* update snapshot of PHY registers on LSC */\n \t\t\te1000_phy_read_status(adapter);\n \t\t\tmac->ops.get_link_up_info(&adapter->hw,\n", "prefixes": [ "v5" ] }