From patchwork Mon Oct 31 14:25:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: drake@draketalley.com X-Patchwork-Id: 13269 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2349134wru; Mon, 31 Oct 2022 07:34:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5EJkPowoScnLrnTCAvVQDjFA8lto/JeevsMlKy+SYSjOPSmFW4mlZQKNezOSICaagG6ENI X-Received: by 2002:a05:6402:50c:b0:461:bc01:1828 with SMTP id m12-20020a056402050c00b00461bc011828mr14271420edv.64.1667226865394; Mon, 31 Oct 2022 07:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667226865; cv=none; d=google.com; s=arc-20160816; b=Sqd4fUEeF/iYemuddyq5Oja7HXQCAdyb0dU2cV6NDMiLuUbfB5Zs3wANALK4bwlG29 7RsOKFBxr7wrIr5TlogBAqydiq+KmGFiIl0y9kvpzOAs/rwtINf9mIpgr6u2wVO0/ja9 N5c4HSbTwiCnUS+pTbDINJmMPQ+REg90tpL7igHpVPuIjiBNBPf/rbgaEX3M8S3dVovw TUo/ZnQCFDEc+9v/mb16fBOHcn+y1kw5On9k2UNUpLvwt8R3NR5lJO/m80HcEHUWdOvS rajiUb5t1NPlqp2clzVLPB0SzDSfZJXiyHWtlS0YJyU61NqXvbenpGiSuvtqFZPoEjhU bJRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=cRv5ovCT7PejKnq88A5JeU+1suvZPa1V4ItBTGACXvs=; b=ib3LtuL8PQHKHVID5KiTBIIxyvkapHCfe0SUnmp3Ozqxxb0YP/3jumFa7aV4pXFeys hCcJ+v0NTuEOpNAq7hCj9IrNZRcEZfT9juSaHd3OsbGgZbSiyVxj3a5icoRcjY+6jxze OdIZYjmEUKv5x44VdKOCLJ3JlzkjxxXyseZVbLGc2YQtQ3CF/Q5HC5oXigg/Vx5DAjmZ XfdWFmtMvKxM4HXCXpaymnuaFVEP0kMtNLDP6R1LjkWqqy80mp6uUuHX9ENTQ0N5K52N qF2PUZWoy5AV3HVBbVIU5qa9Ip90Wb0bOhnEzqroZuvI3G8a3hmIwgc4TFsr81NYKyKS 3o/g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m7-20020a509307000000b0046107f951f9si8324010eda.237.2022.10.31.07.34.00; Mon, 31 Oct 2022 07:34:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231485AbiJaOc7 (ORCPT + 99 others); Mon, 31 Oct 2022 10:32:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231194AbiJaOc5 (ORCPT ); Mon, 31 Oct 2022 10:32:57 -0400 Received: from mail.draketalley.com (mail.draketalley.com [3.213.214.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D680EFADC; Mon, 31 Oct 2022 07:32:55 -0700 (PDT) Received: from pop-os.lan (cpe-74-72-139-32.nyc.res.rr.com [74.72.139.32]) by mail.draketalley.com (Postfix) with ESMTPSA id 0A33055DD3; Mon, 31 Oct 2022 14:25:31 +0000 (UTC) From: drake@draketalley.com To: Manish Chopra , GR-Linux-NIC-Dev@marvell.com, Coiby Xu , Greg Kroah-Hartman , netdev@vger.kernel.org, linux-staging@lists.linux.dev Cc: linux-kernel@vger.kernel.org, Drake Talley Subject: [PATCH 2/3] staging: qlge: replace msleep with usleep_range Date: Mon, 31 Oct 2022 10:25:15 -0400 Message-Id: <20221031142516.266704-3-drake@draketalley.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221031142516.266704-1-drake@draketalley.com> References: <20221031142516.266704-1-drake@draketalley.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_SOFTFAIL, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748214077378139420?= X-GMAIL-MSGID: =?utf-8?q?1748214077378139420?= From: Drake Talley Since msleep may delay for up to 20ms, usleep_range is recommended for short durations in the docs linked in the below warning. I set the range to 1000-2000 based on looking at other usages of usleep_range. Reported by checkpatch: WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.rst Signed-off-by: Drake Talley --- drivers/staging/qlge/qlge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c index 8c1fdd8ebba0..c8403dbb5bad 100644 --- a/drivers/staging/qlge/qlge_main.c +++ b/drivers/staging/qlge/qlge_main.c @@ -3890,7 +3890,7 @@ static int qlge_close(struct net_device *ndev) * (Rarely happens, but possible.) */ while (!test_bit(QL_ADAPTER_UP, &qdev->flags)) - msleep(1); + usleep_range(1000, 2000); /* Make sure refill_work doesn't re-enable napi */ for (i = 0; i < qdev->rss_ring_count; i++)