Thread (13 messages) 13 messages, 5 authors, 2021-09-15

Re: [PATCH 1/8] staging: vchiq_arm: replace sleep() with usleep_range()

flat view

From: Stefan Wahren <hidden>
Date: 2021-09-15 05:22:22
Also in: linux-staging, lkml

Hi,

Am 14.09.21 um 23:35 schrieb Gaston Gonzalez:
quoted hunk ↗ jump to hunk
usleep_range() should be used instead of sleep() when sleepings range
from 10 us to 20 ms, [1].

Reported by checkpatch.pl

[1] Documentation/timers/timers-howto.txt
---
 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index b25369a13452..0214ae37e01f 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -824,7 +824,7 @@ vchiq_bulk_transmit(unsigned int handle, const void *data, unsigned int size,
 		if (status != VCHIQ_RETRY)
 			break;
 
-		msleep(1);
+		usleep_range(1000, 1100);
from my understanding the usage of usleep_range() and hrtimers isn't
necessary here. The intention is to sleep a little bit and not "exactly"
1 ms.

@Phil Elwell: what is your opinion?
quoted hunk ↗ jump to hunk
 	}
 
 	return status;
@@ -861,7 +861,7 @@ enum vchiq_status vchiq_bulk_receive(unsigned int handle, void *data,
 		if (status != VCHIQ_RETRY)
 			break;
 
-		msleep(1);
+		usleep_range(1000, 1100);
dito
 	}
 
 	return status;

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help