From patchwork Fri Feb 10 08:42:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saber Rezvani X-Patchwork-Id: 726447 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vKTqZ3Z8xz9s5g for ; Fri, 10 Feb 2017 20:17:30 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id AF1EE8578A; Fri, 10 Feb 2017 09:17:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4KedcTfbZF58; Fri, 10 Feb 2017 09:17:26 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E9FC385642; Fri, 10 Feb 2017 09:17:26 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id F1F551BFAE5 for ; Fri, 10 Feb 2017 08:44:37 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id EB2B7242ED for ; Fri, 10 Feb 2017 08:44:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iNigiJhpJE33 for ; Fri, 10 Feb 2017 08:44:36 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from sender-pp-092.zoho.com (sender-pp-092.zoho.com [135.84.80.237]) by silver.osuosl.org (Postfix) with ESMTPS id 6E6A9240E3 for ; Fri, 10 Feb 2017 08:44:36 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=from:to:cc:subject:date:message-id:sender; b=gPh+CfWKzVszpyy1mUnOwXRsGbTnKKMU0Fi+ecejG8kOrkwGWlS1G7dNaBBFh5RhN+JlD/iExgEc AfKwu1Gga4sAnPhxlEiLf0jOdXQCBGOwUMtevp0BuXMpj3IoF/Iw Received: from irsaber-Vostro1510.domain.name (188.210.141.244 [188.210.141.244]) by mx.zohomail.com with SMTPS id 1486716197503181.1829897933169; Fri, 10 Feb 2017 00:43:17 -0800 (PST) From: Saber Rezvani To: jeffrey.t.kirsher@intel.com Date: Fri, 10 Feb 2017 12:12:53 +0330 Message-Id: <1486716173-10891-1-git-send-email-irsaber@gmail.com> X-Mailer: git-send-email 2.7.4 X-Mailman-Approved-At: Fri, 10 Feb 2017 09:17:26 +0000 Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, Saber Rezvani Subject: [Intel-wired-lan] [PATCH 1/1] net: ethernet: intel: e1000: msleep() is unreliable for anything <20ms X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" Fix the checkpatch.pl issue: WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt Signed-off-by: Saber Rezvani --- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c index 975eeb8..fa47eab 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c +++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c @@ -207,7 +207,7 @@ static int e1000_set_settings(struct net_device *netdev, } while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) - msleep(1); + usleep_range(1000, 5000); if (ecmd->autoneg == AUTONEG_ENABLE) { hw->autoneg = 1; @@ -294,7 +294,7 @@ static int e1000_set_pauseparam(struct net_device *netdev, adapter->fc_autoneg = pause->autoneg; while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) - msleep(1); + usleep_range(1000, 5000); if (pause->rx_pause && pause->tx_pause) hw->fc = E1000_FC_FULL; @@ -592,7 +592,7 @@ static int e1000_set_ringparam(struct net_device *netdev, return -EINVAL; while (test_and_set_bit(__E1000_RESETTING, &adapter->flags)) - msleep(1); + usleep_range(1000, 5000); if (netif_running(adapter->netdev)) e1000_down(adapter); @@ -869,7 +869,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) /* Disable all the interrupts */ ew32(IMC, 0xFFFFFFFF); E1000_WRITE_FLUSH(); - msleep(10); + usleep_range(10000, 11000); /* Test each interrupt */ for (; i < 10; i++) { @@ -887,7 +887,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) ew32(IMC, mask); ew32(ICS, mask); E1000_WRITE_FLUSH(); - msleep(10); + usleep_range(10000, 11000); if (adapter->test_icr & mask) { *data = 3; @@ -905,7 +905,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) ew32(IMS, mask); ew32(ICS, mask); E1000_WRITE_FLUSH(); - msleep(10); + usleep_range(10000, 11000); if (!(adapter->test_icr & mask)) { *data = 4; @@ -923,7 +923,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) ew32(IMC, ~mask & 0x00007FFF); ew32(ICS, ~mask & 0x00007FFF); E1000_WRITE_FLUSH(); - msleep(10); + usleep_range(10000, 11000); if (adapter->test_icr) { *data = 5; @@ -935,7 +935,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data) /* Disable all the interrupts */ ew32(IMC, 0xFFFFFFFF); E1000_WRITE_FLUSH(); - msleep(10); + usleep_range(10000, 11000); /* Unhook test interrupt handler */ free_irq(irq, netdev);