linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Gaston Gonzalez <gascoar@gmail.com>, linux-staging@lists.linux.dev
Cc: gregkh@linuxfoundation.org, nsaenz@kernel.org, arnd@arndb.de,
	dan.carpenter@oracle.com, ojaswin98@gmail.com,
	amarjargal16@gmail.com, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	bcm-kernel-feedback-list@broadcom.com,
	linux-kernel@vger.kernel.org, Phil Elwell <phil@raspberrypi.com>
Subject: Re: [PATCH 1/8] staging: vchiq_arm: replace sleep() with usleep_range()
Date: Wed, 15 Sep 2021 07:21:53 +0200	[thread overview]
Message-ID: <260b38b8-6f3f-f6cc-0388-09a269ead507@i2se.com> (raw)
In-Reply-To: <20210914213532.396654-1-gascoar@gmail.com>

Hi,

Am 14.09.21 um 23:35 schrieb Gaston Gonzalez:
> 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?

>  	}
>  
>  	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;


  parent reply	other threads:[~2021-09-15  5:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 21:35 [PATCH 1/8] staging: vchiq_arm: replace sleep() with usleep_range() Gaston Gonzalez
2021-09-14 21:35 ` [PATCH 2/8] staging: vchiq_arm: cleanup code alignment issues Gaston Gonzalez
2021-09-14 21:35 ` [PATCH 3/8] staging: vchiq_arm: remove unnecessary space in cast Gaston Gonzalez
2021-09-14 21:35 ` [PATCH 4/8] staging: vchiq_arm: clarify multiplication expressions Gaston Gonzalez
2021-09-14 21:35 ` [PATCH 5/8] staging: vchiq_arm: cleanup blank lines Gaston Gonzalez
2021-09-14 21:35 ` [PATCH 6/8] staging: vchiq_arm: fix quoted strings split across lines Gaston Gonzalez
2021-09-14 21:35 ` [PATCH 7/8] staging: vchiq_arm: remove extra blank line Gaston Gonzalez
2021-09-14 21:35 ` [PATCH 8/8] staging: vchiq_arm: use __func__ to get function name in debug message Gaston Gonzalez
2021-09-15  5:21 ` Stefan Wahren [this message]
2021-09-15  8:06   ` [PATCH 1/8] staging: vchiq_arm: replace sleep() with usleep_range() Phil Elwell
2021-09-15 14:19     ` Arnd Bergmann
2021-09-15  7:29 ` Dan Carpenter
2021-09-15 20:09   ` Gaston Gonzalez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=260b38b8-6f3f-f6cc-0388-09a269ead507@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=amarjargal16@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gascoar@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nsaenz@kernel.org \
    --cc=ojaswin98@gmail.com \
    --cc=phil@raspberrypi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).