[{"id":1759076,"web_url":"http://patchwork.ozlabs.org/comment/1759076/","msgid":"<a2ff6002-3d8f-1094-c05e-696b1cd07256@intel.com>","list_archive_url":null,"date":"2017-08-29T07:19:09","subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","submitter":{"id":69860,"url":"http://patchwork.ozlabs.org/api/people/69860/","name":"Sasha Neftin","email":"sasha.neftin@intel.com"},"content":"On 8/23/2017 18:59, Matthew Tan wrote:\n>      Calls to udelay are not preemtable by userspace so userspace\n>      applications experience a large (~200us) latency when running on core\n>      0. Instead usleep_range can be used to be more friendly to userspace\n>      since it is preemtable. This is due to udelay using busy-wait loops\n>      while usleep_rang uses hrtimers instead. It is recommended to use\n>      udelay when the delay is <10us since at that precision overhead of\n>      usleep_range hrtimer setup causes issues. However, the replaced calls\n>      are for 50us and 100us so this should not be not an issue.\n>\n> Signed-off-by: Matthew Tan <matthew.tan_1@nxp.com>\n> ---\n>   drivers/net/ethernet/intel/e1000e/phy.c | 8 ++++----\n>   1 file changed, 4 insertions(+), 4 deletions(-)\n>\n> diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c\n> index de13aea..e318fdc 100644\n> --- a/drivers/net/ethernet/intel/e1000e/phy.c\n> +++ b/drivers/net/ethernet/intel/e1000e/phy.c\n> @@ -158,7 +158,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)\n>   \t * the lower time out\n>   \t */\n>   \tfor (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {\n> -\t\tudelay(50);\n> +\t\tusleep_range(40, 60);\n>   \t\tmdic = er32(MDIC);\n>   \t\tif (mdic & E1000_MDIC_READY)\n>   \t\t\tbreak;\n> @@ -183,7 +183,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)\n>   \t * reading duplicate data in the next MDIC transaction.\n>   \t */\n>   \tif (hw->mac.type == e1000_pch2lan)\n> -\t\tudelay(100);\n> +\t\tusleep_range(90, 100);\n>   \n>   \treturn 0;\n>   }\n> @@ -222,7 +222,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)\n>   \t * the lower time out\n>   \t */\n>   \tfor (i = 0; i < (E1000_GEN_POLL_TIMEOUT * 3); i++) {\n> -\t\tudelay(50);\n> +\t\tusleep_range(40, 60);\n>   \t\tmdic = er32(MDIC);\n>   \t\tif (mdic & E1000_MDIC_READY)\n>   \t\t\tbreak;\n> @@ -246,7 +246,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)\n>   \t * reading duplicate data in the next MDIC transaction.\n>   \t */\n>   \tif (hw->mac.type == e1000_pch2lan)\n> -\t\tudelay(100);\n> +\t\tusleep_range(90, 110);\n>   \n>   \treturn 0;\n>   }\n\nReasonable. Do you have any open bug or other reference describe this \nproblem?","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>)","Received":["from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3xhKks6RMnz9t38\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 17:19:17 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 420EC86C7C;\n\tTue, 29 Aug 2017 07:19: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 0d_GC34WdJ4n; Tue, 29 Aug 2017 07:19:15 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id A814D86CE4;\n\tTue, 29 Aug 2017 07:19:15 +0000 (UTC)","from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 534611C006F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Aug 2017 07:19:14 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 4577486CE4\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Aug 2017 07:19:14 +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 F1s27F-HuODH for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Aug 2017 07:19:13 +0000 (UTC)","from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 6D53B86C7C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 29 Aug 2017 07:19:13 +0000 (UTC)","from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t29 Aug 2017 00:19:12 -0700","from unknown (HELO [10.185.202.16]) ([10.185.202.16])\n\tby fmsmga001.fm.intel.com with ESMTP; 29 Aug 2017 00:19:10 -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-ExtLoop1":"1","X-IronPort-AV":"E=Sophos; i=\"5.41,444,1498546800\"; d=\"scan'208\";\n\ta=\"1189236387\"","To":"Matthew Tan <matthew.tan_1@nxp.com>, jeffrey.t.kirsher@intel.com","References":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>","From":"\"Neftin, Sasha\" <sasha.neftin@intel.com>","Message-ID":"<a2ff6002-3d8f-1094-c05e-696b1cd07256@intel.com>","Date":"Tue, 29 Aug 2017 10:19:09 +0300","User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101\n\tThunderbird/45.6.0","MIME-Version":"1.0","In-Reply-To":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>","Cc":"michael.kardonik@nxp.com, netdev@vger.kernel.org,\n\tmitch.a.williams@intel.com, linux-kernel@vger.kernel.org,\n\tjohn.ronciak@intel.com, intel-wired-lan@lists.osuosl.org","Subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","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>","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}},{"id":1762761,"web_url":"http://patchwork.ozlabs.org/comment/1762761/","msgid":"<20170904162555.GB21849@amd>","list_archive_url":null,"date":"2017-09-04T16:25:55","subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","submitter":{"id":2109,"url":"http://patchwork.ozlabs.org/api/people/2109/","name":"Pavel Machek","email":"pavel@ucw.cz"},"content":"Hi!\n\n> @@ -183,7 +183,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)\n>  \t * reading duplicate data in the next MDIC transaction.\n>  \t */\n>  \tif (hw->mac.type == e1000_pch2lan)\n> -\t\tudelay(100);\n> +\t\tusleep_range(90, 100);\n>  \n>  \treturn 0;\n>  }\n\nCan you explain why shortening the delay is acceptable here?\n\t\t\t\t\t\t\t\t\t\t\n> @@ -246,7 +246,7 @@ s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)\n>  \t * reading duplicate data in the next MDIC transaction.\n>  \t */\n>  \tif (hw->mac.type == e1000_pch2lan)\n> -\t\tudelay(100);\n> +\t\tusleep_range(90, 110);\n>  \n>  \treturn 0;\n>  }\n\nAnd here?\n\t\t\t\t\t\t\t\t\t\tPavel","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>)","Received":["from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3xmFb32Q6yz9t39\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 02:26:06 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id E325D86159;\n\tMon,  4 Sep 2017 16:26:04 +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 ifbeidXtRDGU; Mon,  4 Sep 2017 16:26:02 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id DB2A085813;\n\tMon,  4 Sep 2017 16:26:02 +0000 (UTC)","from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 3A4A51BFCA2\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:26:01 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 3255E25715\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:26:01 +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 A4EdxE8B69uu for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:26:00 +0000 (UTC)","from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz\n\t[195.113.26.193])\n\tby silver.osuosl.org (Postfix) with ESMTPS id D3BF022FC6\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:25:59 +0000 (UTC)","by atrey.karlin.mff.cuni.cz (Postfix, from userid 512)\n\tid 21CC6824A0; Mon,  4 Sep 2017 18:25:56 +0200 (CEST)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"from auto-whitelisted by SQLgrey-1.7.6","Date":"Mon, 4 Sep 2017 18:25:55 +0200","From":"Pavel Machek <pavel@ucw.cz>","To":"Matthew Tan <matthew.tan_1@nxp.com>","Message-ID":"<20170904162555.GB21849@amd>","References":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>","MIME-Version":"1.0","In-Reply-To":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>","User-Agent":"Mutt/1.5.23 (2014-03-12)","Cc":"michael.kardonik@nxp.com, mitch.a.williams@intel.com,\n\tlinux-kernel@vger.kernel.org, john.ronciak@intel.com,\n\tintel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org","Subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","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>","Content-Type":"multipart/mixed;\n\tboundary=\"===============7167530275945950907==\"","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}},{"id":1762779,"web_url":"http://patchwork.ozlabs.org/comment/1762779/","msgid":"<fd5c453e-bd2e-3dc7-5f93-5af0ca216fd8@molgen.mpg.de>","list_archive_url":null,"date":"2017-09-04T16:36:02","subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","submitter":{"id":70275,"url":"http://patchwork.ozlabs.org/api/people/70275/","name":"Paul Menzel","email":"pmenzel@molgen.mpg.de"},"content":"Dear Matthew,\n\n\nOn 08/23/17 17:59, Matthew Tan wrote:\n>      Calls to udelay are not preemtable by userspace so userspace\n>      applications experience a large (~200us) latency when running on core\n>      0. Instead usleep_range can be used to be more friendly to userspace\n>      since it is preemtable. This is due to udelay using busy-wait loops\n>      while usleep_rang uses hrtimers instead. It is recommended to use\n>      udelay when the delay is <10us since at that precision overhead of\n>      usleep_range hrtimer setup causes issues. However, the replaced calls\n>      are for 50us and 100us so this should not be not an issue.\n\nIs there a reason for indenting the paragraph. (I guess, you did `git \nshow` or `git log -p` and copied the message?) Anyway, please remove \nwhitespace in the front, if there is no reason.\n\nAlso, it looks like you ran benchmarks, so what is the delay for \nuserspace applications with your changes?\n\n> Signed-off-by: Matthew Tan <matthew.tan_1@nxp.com>\n> ---\n>   drivers/net/ethernet/intel/e1000e/phy.c | 8 ++++----\n>   1 file changed, 4 insertions(+), 4 deletions(-)\n\n[…]\n\n\nKind regards,\n\nPaul","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.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)","Received":["from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3xmG1k3RMLz9t2W\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 02:45:46 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id BE3BB86847;\n\tMon,  4 Sep 2017 16:45:44 +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 DMTKqIb3o0Ah; Mon,  4 Sep 2017 16:45:42 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5424B867AA;\n\tMon,  4 Sep 2017 16:45:42 +0000 (UTC)","from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id CFDDC1C0129\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:45:41 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id C665625715\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:45:41 +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 lEfA07B7Uyxq for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:45:40 +0000 (UTC)","from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11])\n\tby silver.osuosl.org (Postfix) with ESMTPS id E1650239B5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  4 Sep 2017 16:45:39 +0000 (UTC)","from keineahnung.molgen.mpg.de (keineahnung.molgen.mpg.de\n\t[141.14.17.193])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: pmenzel)\n\tby mx.molgen.mpg.de (Postfix) with ESMTPSA id A0E1C201352252;\n\tMon,  4 Sep 2017 18:36:02 +0200 (CEST)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"delayed 00:09:34 by SQLgrey-1.7.6","To":"Matthew Tan <matthew.tan_1@nxp.com>","References":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>","From":"Paul Menzel <pmenzel@molgen.mpg.de>","Message-ID":"<fd5c453e-bd2e-3dc7-5f93-5af0ca216fd8@molgen.mpg.de>","Date":"Mon, 4 Sep 2017 18:36:02 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>","Content-Language":"en-US","Cc":"michael.kardonik@nxp.com, netdev@vger.kernel.org,\n\tmitch.a.williams@intel.com, linux-kernel@vger.kernel.org,\n\tjohn.ronciak@intel.com, intel-wired-lan@lists.osuosl.org","Subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","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>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}},{"id":1764979,"web_url":"http://patchwork.ozlabs.org/comment/1764979/","msgid":"<309B89C4C689E141A5FF6A0C5FB2118B8C69E5E5@ORSMSX101.amr.corp.intel.com>","list_archive_url":null,"date":"2017-09-07T22:19:47","subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","submitter":{"id":37025,"url":"http://patchwork.ozlabs.org/api/people/37025/","name":"Brown, Aaron F","email":"aaron.f.brown@intel.com"},"content":"> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On\n> Behalf Of Pavel Machek\n> Sent: Monday, September 4, 2017 9:26 AM\n> To: Matthew Tan <matthew.tan_1@nxp.com>\n> Cc: michael.kardonik@nxp.com; Williams, Mitch A\n> <mitch.a.williams@intel.com>; linux-kernel@vger.kernel.org;\n> john.ronciak@intel.com; intel-wired-lan@lists.osuosl.org;\n> netdev@vger.kernel.org\n> Subject: Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n> of udelay to usleep_range\n> \n> Hi!\n> \n> > @@ -183,7 +183,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw\n> *hw, u32 offset, u16 *data)\n> >  \t * reading duplicate data in the next MDIC transaction.\n> >  \t */\n> >  \tif (hw->mac.type == e1000_pch2lan)\n> > -\t\tudelay(100);\n> > +\t\tusleep_range(90, 100);\n> >\n> >  \treturn 0;\n> >  }\n> \n> Can you explain why shortening the delay is acceptable here?\n\nMaybe it's not.\n\nThis patch is causing speed / duplex tests to fail on several of my test systems.  Specifically a Lenova laptop with an 82577 and a NUC with an i218 (though that does not mean it is limited to those or that it's not related to the individual link partner.)\n\nIn both cases they \"blow up\" when attempting to link at 10 Mb with a Call Trace on the console / log and a watchdog: BUG: soft lockup - CPU#X stuck appearing in the current login session.  The simplest way to produce the crash is simply load the interface and attempt to bring it up with the link partner configured to 10 Mb half (force or autoneg) or forced to 10 Mb full (autoneg to 10 Mb full did not blow up.)  The problem is also appearing at some, but not all 100 Mb speeds and duplexes.  100 Mb also crashes, apparently with the same pattern.  With the link partner set to 100 Mb half Autoneg on, 100 Mb half forced and 100 Mb full forced the system crashes, 100 Full autoneg seems to work fine.\n\nThe call trace repeats every 30 seconds, is captured in the log and looks a lot like this:\n----------------------------------------\nSep  7 14:17:10 u1459 kernel: watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [kworker/2:0:23]\nSep  7 14:17:10 u1459 kernel: Modules linked in: e1000e ptp pps_core ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack libcrc32c ipt_REJECT nf_reject_ipv4 xt_CHECKSUM iptable_mangle iptable_filter ip_tables bridge stp llc nfsd lockd grace nfs_acl auth_rpcgss sunrpc autofs4 ipv6 crc_ccitt dm_mirror dm_region_hash dm_log vhost_net vhost tap tun kvm_intel kvm irqbypass uinput joydev ax88179_178a usbnet mii iTCO_wdt iTCO_vendor_support sg i2c_i801 lpc_ich mfd_core xhci_pci snd_hda_codec_realtek xhci_hcd snd_hda_codec_hdmi snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore dm_mod(E) dax(E) ext4(E) jbd2(E) mbcache(E) sd_mod(E) ahci(E) libahci(E) i915(E) drm_kms_helper(E) drm(E) fb_sys_fops(E)\nSep  7 14:17:10 u1459 kernel: sysimgblt(E) sysfillrect(E) syscopyarea(E) i2c_algo_bit(E) i2c_core(E) iosf_mbi(E) video(E)\nSep  7 14:17:10 u1459 kernel: CPU: 2 PID: 23 Comm: kworker/2:0 Tainted: G            EL  4.13.0-rc6_next-queue_dev-queue_regress #38\nSep  7 14:17:10 u1459 kernel: Hardware name:                  /NUC5i5MYBE, BIOS MYBDWi5v.86A.0030.2016.0527.1657 05/27/2016\nSep  7 14:17:10 u1459 kernel: Workqueue: events linkwatch_event\nSep  7 14:17:10 u1459 kernel: task: ffff88024cf84680 task.stack: ffffc90000d44000\nSep  7 14:17:10 u1459 kernel: RIP: 0010:queued_spin_lock_slowpath+0x56/0x1d0\nSep  7 14:17:10 u1459 kernel: RSP: 0018:ffffc90000d478c8 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff10\nSep  7 14:17:10 u1459 kernel: RAX: 0000000000000101 RBX: ffff880239fe8000 RCX: 0000000000000101\nSep  7 14:17:10 u1459 kernel: RDX: ffffc90000d47948 RSI: 0000000000000001 RDI: ffff880239feb1a0\nSep  7 14:17:10 u1459 kernel: RBP: ffffc90000d47968 R08: 0000000000000001 R09: ffff88024ce181a4\nSep  7 14:17:10 u1459 kernel: R10: 0000000000000000 R11: 0000000000000000 R12: ffff880239fe8840\nSep  7 14:17:10 u1459 kernel: R13: ffff88024ce180e4 R14: ffff88024ce180e4 R15: ffffc90000d47a48\nSep  7 14:17:10 u1459 kernel: FS:  0000000000000000(0000) GS:ffff880255d00000(0000) knlGS:0000000000000000\nSep  7 14:17:10 u1459 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\nSep  7 14:17:10 u1459 kernel: CR2: 00007ffd4c3579b8 CR3: 0000000001c09000 CR4: 00000000003406e0\nSep  7 14:17:10 u1459 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000\nSep  7 14:17:10 u1459 kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400\nSep  7 14:17:10 u1459 kernel: Call Trace:\nSep  7 14:17:10 u1459 kernel: ? netlink_broadcast_filtered+0x15f/0x1a0\nSep  7 14:17:10 u1459 kernel: _raw_spin_lock+0x21/0x30\nSep  7 14:17:10 u1459 kernel: e1000e_get_stats64+0x2b/0x140 [e1000e]\nSep  7 14:17:10 u1459 kernel: dev_get_stats+0x3d/0xc0\nSep  7 14:17:10 u1459 kernel: ? __nla_reserve+0x53/0x70\nSep  7 14:17:10 u1459 kernel: rtnl_fill_stats+0x6b/0x150\nSep  7 14:17:10 u1459 kernel: rtnl_fill_ifinfo+0x542/0x920\nSep  7 14:17:10 u1459 kernel: ? if_nlmsg_size+0xae/0x180\nSep  7 14:17:10 u1459 kernel: rtmsg_ifinfo_build_skb+0x90/0xe0\nSep  7 14:17:10 u1459 kernel: rtmsg_ifinfo_event+0x35/0x60\nSep  7 14:17:10 u1459 kernel: rtmsg_ifinfo+0x13/0x20\nSep  7 14:17:10 u1459 kernel: netdev_state_change+0x46/0x50\nSep  7 14:17:10 u1459 kernel: linkwatch_do_dev+0x3c/0x60\nSep  7 14:17:10 u1459 kernel: __linkwatch_run_queue+0x13a/0x210\nSep  7 14:17:10 u1459 kernel: ? set_task_cpu+0xbb/0x1a0\nSep  7 14:17:10 u1459 kernel: ? lock_timer_base+0x8a/0xb0\nSep  7 14:17:10 u1459 kernel: linkwatch_event+0x25/0x30\nSep  7 14:17:10 u1459 kernel: process_one_work+0x193/0x410\nSep  7 14:17:10 u1459 kernel: ? try_to_del_timer_sync+0x53/0x70\nSep  7 14:17:10 u1459 kernel: ? del_timer_sync+0x3d/0x50\nSep  7 14:17:10 u1459 kernel: ? maybe_create_worker+0x8b/0x110\nSep  7 14:17:10 u1459 kernel: ? schedule+0x3a/0xa0\nSep  7 14:17:10 u1459 kernel: worker_thread+0x7c/0x420\nSep  7 14:17:10 u1459 kernel: ? default_wake_function+0x12/0x20\nSep  7 14:17:10 u1459 kernel: ? maybe_create_worker+0x110/0x110\nSep  7 14:17:10 u1459 kernel: ? schedule+0x3a/0xa0\nSep  7 14:17:10 u1459 kernel: ? maybe_create_worker+0x110/0x110\nSep  7 14:17:10 u1459 kernel: kthread+0x111/0x150\nSep  7 14:17:10 u1459 kernel: ? __kthread_init_worker+0x40/0x40\nSep  7 14:17:10 u1459 kernel: ret_from_fork+0x22/0x30\nSep  7 14:17:10 u1459 kernel: Code: ff ff 75 57 83 fe 01 89 ca 89 f0 41 0f 45 d0 f0 0f b1 17 39 f0 75 e3 83 fa 01 74 1c 8b 07 48 8d 55 e0 84 c0 89 45 e0 74 0a f3 90 <8b> 07 84 c0 89 02 75 f6 66 c7 07 01 00 c9 c3 8b 37 48 8d 45 a0\nSep  7 14:17:38 u1459 kernel: watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [kworker/2:0:23]\nSep  7 14:17:38 u1459 kernel: Modules linked in: e1000e ptp pps_core ip6table_filter ip6_tables ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state nf_conntrack libcrc32c ipt_REJECT nf_reject_ipv4 xt_CHECKSUM iptable_mangle iptable_filter ip_tables bridge stp llc nfsd lockd grace nfs_acl auth_rpcgss sunrpc autofs4 ipv6 crc_ccitt dm_mirror dm_region_hash dm_log vhost_net vhost tap tun kvm_intel kvm irqbypass uinput joydev ax88179_178a usbnet mii iTCO_wdt iTCO_vendor_support sg i2c_i801 lpc_ich mfd_core xhci_pci snd_hda_codec_realtek xhci_hcd snd_hda_codec_hdmi snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore dm_mod(E) dax(E) ext4(E) jbd2(E) mbcache(E) sd_mod(E) ahci(E) libahci(E) i915(E) drm_kms_helper(E) drm(E) fb_sys_fops(E)\nSep  7 14:17:38 u1459 kernel: sysimgblt(E) sysfillrect(E) syscopyarea(E) i2c_algo_bit(E) i2c_core(E) iosf_mbi(E) video(E)\nSep  7 14:17:38 u1459 kernel: CPU: 2 PID: 23 Comm: kworker/2:0 Tainted: G            EL  4.13.0-rc6_next-queue_dev-queue_regress #38\nSep  7 14:17:38 u1459 kernel: Hardware name:                  /NUC5i5MYBE, BIOS MYBDWi5v.86A.0030.2016.0527.1657 05/27/2016\nSep  7 14:17:38 u1459 kernel: Workqueue: events linkwatch_event\nSep  7 14:17:38 u1459 kernel: task: ffff88024cf84680 task.stack: ffffc90000d44000\nSep  7 14:17:38 u1459 kernel: RIP: 0010:queued_spin_lock_slowpath+0x56/0x1d0\nSep  7 14:17:38 u1459 kernel: RSP: 0018:ffffc90000d478c8 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff10\nSep  7 14:17:38 u1459 kernel: RAX: 0000000000000101 RBX: ffff880239fe8000 RCX: 0000000000000101\nSep  7 14:17:38 u1459 kernel: RDX: ffffc90000d47948 RSI: 0000000000000001 RDI: ffff880239feb1a0\nSep  7 14:17:38 u1459 kernel: RBP: ffffc90000d47968 R08: 0000000000000001 R09: ffff88024ce181a4\nSep  7 14:17:38 u1459 kernel: R10: 0000000000000000 R11: 0000000000000000 R12: ffff880239fe8840\nSep  7 14:17:38 u1459 kernel: R13: ffff88024ce180e4 R14: ffff88024ce180e4 R15: ffffc90000d47a48\nSep  7 14:17:38 u1459 kernel: FS:  0000000000000000(0000) GS:ffff880255d00000(0000) knlGS:0000000000000000\nSep  7 14:17:38 u1459 kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033\nSep  7 14:17:38 u1459 kernel: CR2: 00007ffd4c3579b8 CR3: 0000000001c09000 CR4: 00000000003406e0\nSep  7 14:17:38 u1459 kernel: DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000\nSep  7 14:17:38 u1459 kernel: DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400\nSep  7 14:17:38 u1459 kernel: Call Trace:\nSep  7 14:17:38 u1459 kernel: ? netlink_broadcast_filtered+0x15f/0x1a0\nSep  7 14:17:38 u1459 kernel: _raw_spin_lock+0x21/0x30\nSep  7 14:17:38 u1459 kernel: e1000e_get_stats64+0x2b/0x140 [e1000e]\nSep  7 14:17:38 u1459 kernel: dev_get_stats+0x3d/0xc0\nSep  7 14:17:38 u1459 kernel: ? __nla_reserve+0x53/0x70\nSep  7 14:17:38 u1459 kernel: rtnl_fill_stats+0x6b/0x150\nSep  7 14:17:38 u1459 kernel: rtnl_fill_ifinfo+0x542/0x920\nSep  7 14:17:38 u1459 kernel: ? if_nlmsg_size+0xae/0x180\nSep  7 14:17:38 u1459 kernel: rtmsg_ifinfo_build_skb+0x90/0xe0\nSep  7 14:17:38 u1459 kernel: rtmsg_ifinfo_event+0x35/0x60\nSep  7 14:17:38 u1459 kernel: rtmsg_ifinfo+0x13/0x20\nSep  7 14:17:38 u1459 kernel: netdev_state_change+0x46/0x50\nSep  7 14:17:38 u1459 kernel: linkwatch_do_dev+0x3c/0x60\nSep  7 14:17:38 u1459 kernel: __linkwatch_run_queue+0x13a/0x210\nSep  7 14:17:38 u1459 kernel: ? set_task_cpu+0xbb/0x1a0\nSep  7 14:17:38 u1459 kernel: ? lock_timer_base+0x8a/0xb0\nSep  7 14:17:38 u1459 kernel: linkwatch_event+0x25/0x30\nSep  7 14:17:38 u1459 kernel: process_one_work+0x193/0x410\nSep  7 14:17:38 u1459 kernel: ? try_to_del_timer_sync+0x53/0x70\nSep  7 14:17:38 u1459 kernel: ? del_timer_sync+0x3d/0x50\nSep  7 14:17:38 u1459 kernel: ? maybe_create_worker+0x8b/0x110\nSep  7 14:17:38 u1459 kernel: ? schedule+0x3a/0xa0\nSep  7 14:17:38 u1459 kernel: worker_thread+0x7c/0x420\nSep  7 14:17:38 u1459 kernel: ? default_wake_function+0x12/0x20\nSep  7 14:17:38 u1459 kernel: ? maybe_create_worker+0x110/0x110\nSep  7 14:17:38 u1459 kernel: ? schedule+0x3a/0xa0\nSep  7 14:17:38 u1459 kernel: ? maybe_create_worker+0x110/0x110\nSep  7 14:17:38 u1459 kernel: kthread+0x111/0x150\nSep  7 14:17:38 u1459 kernel: ? __kthread_init_worker+0x40/0x40\nSep  7 14:17:38 u1459 kernel: ret_from_fork+0x22/0x30\nSep  7 14:17:38 u1459 kernel: Code: ff ff 75 57 83 fe 01 89 ca 89 f0 41 0f 45 d0 f0 0f b1 17 39 f0 75 e3 83 fa 01 74 1c 8b 07 48 8d 55 e0 84 c0 89 45 e0 74 0a f3 90 <8b> 07 84 c0 89 02 75 f6 66 c7 07 01 00 c9 c3 8b 37 48 8d 45 a0\n----------------------------------------\n\nHere is the contents of an ssh session to the box (using a usb ethernet port for a control network as the LOM goes dead.) :\n----------------------\nu1459:[0]/root> modprobe e1000e\nu1459:[0]/root> nwk\nBringing up eth0... -> success\nBringing up eth1... -> success\nBringing up eth1 IPv6... -> success\nu1459:[0]/root> lnks\n\nMessage from syslogd@u1459 at Sep  7 14:04:42 ...\n kernel:watchdog: BUG: soft lockup - CPU#0 stuck for 23s! [ifconfig:3980]\n\nMessage from syslogd@u1459 at Sep  7 14:04:42 ...\n kernel:watchdog: BUG: soft lockup - CPU#3 stuck for 22s! [ifconfig:3983]\nWrite failed: Broken pipe\n[root@s252 ~]# ssh u1459\nWarning: Permanently added 'u1459,190.0.14.59' (RSA) to the list of known hosts.\nLast login: Thu Sep  7 14:12:06 2017\n\nYou are running LINUX 4.13.0-rc6_next-queue_dev-queue_regress.\n\nThis system was (post)installed: Fri Jan 27 16:38:47 PST 2017\n\nIt has been more than 7 days since you ran 'sgetall' on this system!\nYour root drive is 11% used.\n\nYou have 4 CPUs on-line.\nThe current ethtool is 4.11\nYour ethool is 4.8\nTo get the current version, run 'ethtool.inst'\nu1459:[0]/root> dmesg -c > /dev/null\nu1459:[0]/root> modprobe e1000e\nu1459:[0]/root> dmesg -c\npps_core: LinuxPPS API ver. 1 registered\npps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>\nPTP clock support registered\ne1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k\ne1000e: Copyright(c) 1999 - 2015 Intel Corporation.\ne1000e 0000:00:19.0: Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode\ne1000e 0000:00:19.0 0000:00:19.0 (uninitialized): registered PHC clock\ne1000e 0000:00:19.0 eth1: (PCI Express:2.5GT/s:Width x1) f4:4d:30:62:c7:14\ne1000e 0000:00:19.0 eth1: Intel(R) PRO/1000 Network Connection\ne1000e 0000:00:19.0 eth1: MAC: 11, PHY: 12, PBA No: FFFFFF-0FF\nu1459:[0]/root> ifconfig eth1 190.1.14.59\nu1459:[0]/root>\nMessage from syslogd@u1459 at Sep  7 14:15:06 ...\n kernel:watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [kworker/2:0:23]\n\nMessage from syslogd@u1459 at Sep  7 14:15:34 ...\n kernel:watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [kworker/2:0:23]\n\nMessage from syslogd@u1459 at Sep  7 14:16:06 ...\n kernel:watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [kworker/2:0:23]\n\nMessage from syslogd@u1459 at Sep  7 14:16:34 ...\n kernel:watchdog: BUG: soft lockup - CPU#2 stuck for 23s! [kworker/2:0:23]\n\nMessage from syslogd@u1459 at Sep  7 14:17:10 ...\n kernel:watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [kworker/2:0:23]\n\nMessage from syslogd@u1459 at Sep  7 14:17:38 ...\n kernel:watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [kworker/2:0:23]","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>)","Received":["from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\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 3xpFHx2QZNz9s7f\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 08:19:57 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 597E930589;\n\tThu,  7 Sep 2017 22:19:55 +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 7jv99D42Xw27; Thu,  7 Sep 2017 22:19:52 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id EA41F3051D;\n\tThu,  7 Sep 2017 22:19:52 +0000 (UTC)","from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 321451C3F85\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Sep 2017 22:19:51 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 2A7D982159\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Sep 2017 22:19:51 +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 UIQ5LxqPP2P4 for <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Sep 2017 22:19:49 +0000 (UTC)","from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 7C21A82007\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu,  7 Sep 2017 22:19:49 +0000 (UTC)","from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Sep 2017 15:19:48 -0700","from orsmsx107.amr.corp.intel.com ([10.22.240.5])\n\tby FMSMGA003.fm.intel.com with ESMTP; 07 Sep 2017 15:19:48 -0700","from orsmsx101.amr.corp.intel.com ([169.254.8.156]) by\n\tORSMSX107.amr.corp.intel.com ([169.254.1.228]) with mapi id\n\t14.03.0319.002; Thu, 7 Sep 2017 15:19:48 -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-ExtLoop1":"1","X-IronPort-AV":"E=Sophos;i=\"5.42,360,1500966000\"; d=\"scan'208\";a=\"898184866\"","From":"\"Brown, Aaron F\" <aaron.f.brown@intel.com>","To":"Pavel Machek <pavel@ucw.cz>, Matthew Tan <matthew.tan_1@nxp.com>,\n\t\"intel-wired-lan@lists.osuosl.org\" <intel-wired-lan@lists.osuosl.org>","Thread-Topic":"[Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","Thread-Index":"AQHTHCkdpdRnCP1Mqk+/S1W/JJU3bKKlcf2AgASTrQA=","Date":"Thu, 7 Sep 2017 22:19:47 +0000","Message-ID":"<309B89C4C689E141A5FF6A0C5FB2118B8C69E5E5@ORSMSX101.amr.corp.intel.com>","References":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>\n\t<20170904162555.GB21849@amd>","In-Reply-To":"<20170904162555.GB21849@amd>","Accept-Language":"en-US","Content-Language":"en-US","X-MS-Has-Attach":"","X-MS-TNEF-Correlator":"","x-titus-metadata-40":"eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2MwZWViZGYtMDQ5YS00NTFjLWFjZDEtZTZmZTFlZTY5MTA3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6ImpaV1h4amlBb2VnS0s5czdlTEo5V3l2RXRyZDNOVExnNFwvV3ltOXlNXC9VRT0ifQ==","x-ctpclassification":"CTP_IC","dlp-product":"dlpe-windows","dlp-version":"11.0.0.116","dlp-reaction":"no-action","x-originating-ip":"[10.22.254.138]","MIME-Version":"1.0","Cc":"\"netdev@vger.kernel.org\" <netdev@vger.kernel.org>, \"Williams,\n\tMitch A\" <mitch.a.williams@intel.com>,\n\t\"michael.kardonik@nxp.com\" <michael.kardonik@nxp.com>,\n\t\"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>","Subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","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>","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>"}},{"id":1765194,"web_url":"http://patchwork.ozlabs.org/comment/1765194/","msgid":"<20170908092827.GC18365@amd>","list_archive_url":null,"date":"2017-09-08T09:28:27","subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","submitter":{"id":2109,"url":"http://patchwork.ozlabs.org/api/people/2109/","name":"Pavel Machek","email":"pavel@ucw.cz"},"content":"On Thu 2017-09-07 22:19:47, Brown, Aaron F wrote:\n> > From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On\n> > Behalf Of Pavel Machek\n> > Sent: Monday, September 4, 2017 9:26 AM\n> > To: Matthew Tan <matthew.tan_1@nxp.com>\n> > Cc: michael.kardonik@nxp.com; Williams, Mitch A\n> > <mitch.a.williams@intel.com>; linux-kernel@vger.kernel.org;\n> > john.ronciak@intel.com; intel-wired-lan@lists.osuosl.org;\n> > netdev@vger.kernel.org\n> > Subject: Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n> > of udelay to usleep_range\n> > \n> > Hi!\n> > \n> > > @@ -183,7 +183,7 @@ s32 e1000e_read_phy_reg_mdic(struct e1000_hw\n> > *hw, u32 offset, u16 *data)\n> > >  \t * reading duplicate data in the next MDIC transaction.\n> > >  \t */\n> > >  \tif (hw->mac.type == e1000_pch2lan)\n> > > -\t\tudelay(100);\n> > > +\t\tusleep_range(90, 100);\n> > >\n> > >  \treturn 0;\n> > >  }\n> > \n> > Can you explain why shortening the delay is acceptable here?\n> \n> Maybe it's not.\n> \n> This patch is causing speed / duplex tests to fail on several of my test systems.  Specifically a Lenova laptop with an 82577 and a NUC with an i218 (though that does not mean it is limited to those or that it's not related to the individual link partner.)\n>\n\nOk, this should be quite easy to verify -- just adjust all the ranges\nto be >= original ones.\n\nThanks,\n\t\t\t\t\t\t\t\t\tPavel","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.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)","Received":["from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3xpX7V6QnYz9sCZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  8 Sep 2017 19:28:38 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id C79B189C4F;\n\tFri,  8 Sep 2017 09:28:36 +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 syWxG0bTEpbr; Fri,  8 Sep 2017 09:28:35 +0000 (UTC)","from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 83F19887CE;\n\tFri,  8 Sep 2017 09:28:35 +0000 (UTC)","from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 6BB1F1C3F84\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Sep 2017 09:28:34 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 633F92A35C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Sep 2017 09:28:34 +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 K0sRUcfEG9iP for <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Sep 2017 09:28:32 +0000 (UTC)","from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz\n\t[195.113.26.193])\n\tby silver.osuosl.org (Postfix) with ESMTPS id B2BA326A85\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri,  8 Sep 2017 09:28:31 +0000 (UTC)","by atrey.karlin.mff.cuni.cz (Postfix, from userid 512)\n\tid AC3C7824E8; Fri,  8 Sep 2017 11:28:28 +0200 (CEST)"],"X-Virus-Scanned":["amavisd-new at osuosl.org","amavisd-new at osuosl.org"],"X-Greylist":"from auto-whitelisted by SQLgrey-1.7.6","Date":"Fri, 8 Sep 2017 11:28:27 +0200","From":"Pavel Machek <pavel@ucw.cz>","To":"\"Brown, Aaron F\" <aaron.f.brown@intel.com>","Message-ID":"<20170908092827.GC18365@amd>","References":"<1503503985-3869-1-git-send-email-matthew.tan_1@nxp.com>\n\t<20170904162555.GB21849@amd>\n\t<309B89C4C689E141A5FF6A0C5FB2118B8C69E5E5@ORSMSX101.amr.corp.intel.com>","MIME-Version":"1.0","In-Reply-To":"<309B89C4C689E141A5FF6A0C5FB2118B8C69E5E5@ORSMSX101.amr.corp.intel.com>","User-Agent":"Mutt/1.5.23 (2014-03-12)","Cc":"\"michael.kardonik@nxp.com\" <michael.kardonik@nxp.com>,\n\t\"netdev@vger.kernel.org\" <netdev@vger.kernel.org>, \"Williams,\n\tMitch A\" <mitch.a.williams@intel.com>,\n\t\"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>,\n\t\"intel-wired-lan@lists.osuosl.org\" <intel-wired-lan@lists.osuosl.org>,\n\tMatthew Tan <matthew.tan_1@nxp.com>","Subject":"Re: [Intel-wired-lan] [PATCH] e1000e: changed some expensive calls\n\tof udelay to usleep_range","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.18-1","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>","Content-Type":"multipart/mixed;\n\tboundary=\"===============1641757675608073958==\"","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"}}]