diff mbox series

net: core: fix msleep() is not accurate

Message ID 1607997865-3437-1-git-send-email-yejune.deng@gmail.com
State New
Headers show
Series net: core: fix msleep() is not accurate | expand

Commit Message

Yejune Deng Dec. 15, 2020, 2:04 a.m. UTC
See Documentation/timers/timers-howto.rst, msleep() is not
for (1ms - 20ms), use usleep_range() instead.

Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
---
 net/core/dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jakub Kicinski Dec. 16, 2020, 7:33 p.m. UTC | #1
On Tue, 15 Dec 2020 10:04:25 +0800 Yejune Deng wrote:
> See Documentation/timers/timers-howto.rst, msleep() is not

> for (1ms - 20ms), use usleep_range() instead.

> 

> Signed-off-by: Yejune Deng <yejune.deng@gmail.com>


# Form letter - net-next is closed

We have already sent the networking pull request for 5.11 and therefore
net-next is closed for new drivers, features, code refactoring and
optimizations. We are currently accepting bug fixes only.

Please repost when net-next reopens after 5.11-rc1 is cut.

Look out for the announcement on the mailing list or check:
http://vger.kernel.org/~davem/net-next.html

RFC patches sent for review only are obviously welcome at any time.
diff mbox series

Patch

diff --git a/net/core/dev.c b/net/core/dev.c
index d33099f..c0aa52f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6726,9 +6726,9 @@  void napi_disable(struct napi_struct *n)
 	set_bit(NAPI_STATE_DISABLE, &n->state);
 
 	while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
-		msleep(1);
+		usleep_range(10, 200);
 	while (test_and_set_bit(NAPI_STATE_NPSVC, &n->state))
-		msleep(1);
+		usleep_range(10, 200);
 
 	hrtimer_cancel(&n->timer);