All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Luca Ellero <luca.ellero@brickedbrain.com>
Cc: Marek Vasut <marek.vasut@gmail.com>,
	Andrey Smirnov <andrew.smirnov@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH] mtd: dataflash: replace msleep with usleep_range
Date: Thu, 26 Apr 2018 20:03:48 +0200	[thread overview]
Message-ID: <20180426200348.7c4eef72@bbrezillon> (raw)
In-Reply-To: <1524043588-25816-1-git-send-email-luca.ellero@brickedbrain.com>

On Wed, 18 Apr 2018 11:26:26 +0200
Luca Ellero <luca.ellero@brickedbrain.com> wrote:

> Since msleep is based on jiffies, this 3 ms sleep becomes actually 20 ms.
> Worst of all, since this sleep is used in a loop when writing, a single page
> write (256 to 1024 bytes) causes 17 ms extra time.
> When writing large files (for example u-boot is usually 512 KB) this delay
> adds up to minutes.
> See Documentation/timers/timers-howto.txt "Why not msleep for (1ms - 20ms)".
> 
> Signed-off-by: Luca Ellero <luca.ellero@brickedbrain.com>

Applied.

Thanks,

Boris

> ---
>  drivers/mtd/devices/mtd_dataflash.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
> index aaaeaae..3a6f450 100644
> --- a/drivers/mtd/devices/mtd_dataflash.c
> +++ b/drivers/mtd/devices/mtd_dataflash.c
> @@ -140,7 +140,7 @@ static int dataflash_waitready(struct spi_device *spi)
>  		if (status & (1 << 7))	/* RDY/nBSY */
>  			return status;
>  
> -		msleep(3);
> +		usleep_range(3000, 4000);
>  	}
>  }
>  

      reply	other threads:[~2018-04-26 18:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18  9:26 [PATCH] mtd: dataflash: replace msleep with usleep_range Luca Ellero
2018-04-18  9:26 ` Luca Ellero
2018-04-26 18:03 ` Boris Brezillon [this message]

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=20180426200348.7c4eef72@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=andrew.smirnov@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=luca.ellero@brickedbrain.com \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.