public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
Cc: broonie@kernel.org, alsa-devel@alsa-project.org,
	airlied@linux.ie, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, peter.ujfalusi@ti.com,
	bardliao@realtek.com, lee.jones@linaro.org,
	laurent.pinchart+renesas@ideasonboard.com, sameo@linux.intel.com,
	patches@opensource.wolfsonmicro.com, Paul.Handrigan@cirrus.com,
	tony@atomide.com, lars@metafoo.de, dmurphy@ti.com,
	linux-omap@vger.kernel.org, oder_chiou@realtek.com,
	brian.austin@cirrus.com, support.opensource@diasemi.com,
	gregkh@linuxfoundation.org, dmitry.torokhov@gmail.com,
	lgirdwood@gmail.com
Subject: Re: [alsa-devel] [PATCH 2/2] V4 regmap: Apply optional delay in	multi_reg_write/register_patch
Date: Thu, 16 Jul 2015 15:12:38 +0200	[thread overview]
Message-ID: <s5hpp3sjlfd.wl-tiwai@suse.de> (raw)
In-Reply-To: <1436885152-19850-2-git-send-email-nariman@opensource.wolfsonmicro.com>

On Tue, 14 Jul 2015 16:45:52 +0200,
Nariman Poushin wrote:
> 
> We treat a delay in a sequence the same way we treat a page change as
> they are logically similar in that you can coalesce all write before
> a delay (in the same way you can coalesce all writes before a page
> change is needed)
> 
> Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com>
> ---
>  drivers/base/regmap/regmap.c | 65 ++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 59 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
> index 0a849ee..a67473c2 100644
> --- a/drivers/base/regmap/regmap.c
> +++ b/drivers/base/regmap/regmap.c
> @@ -18,6 +18,7 @@
>  #include <linux/of.h>
>  #include <linux/rbtree.h>
>  #include <linux/sched.h>
> +#include <linux/delay.h>
>  
>  #define CREATE_TRACE_POINTS
>  #include "trace.h"
> @@ -47,6 +48,17 @@ static int _regmap_bus_reg_write(void *context, unsigned int reg,
>  static int _regmap_bus_raw_write(void *context, unsigned int reg,
>  				 unsigned int val);
>  
> +static void regmap_sequence_delay(unsigned int delay_us)
> +{
> +	/* For small delays it isn't worth setting up the hrtimers
> +	 * so fall back on udelay
> +	 */
> +	if (delay_us < 10)
> +		udelay(delay_us);
> +	else
> +		usleep_range(delay_us, delay_us * 2);
> +}

I think usleep_range() can't be used for fast_io, which is performed
inside a spinlock.  And, the locking can't be known explicitly,
e.g. the caller may set its own config->lock, so even the check for
fast_io isn't enough.


Takashi

  reply	other threads:[~2015-07-16 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 14:45 [PATCH 1/2] V4 regmap: Use reg_sequence for multi_reg_write / register_patch Nariman Poushin
2015-07-14 14:45 ` [PATCH 2/2] V4 regmap: Apply optional delay in multi_reg_write/register_patch Nariman Poushin
2015-07-16 13:12   ` Takashi Iwai [this message]
2015-07-16 12:52 ` [PATCH 1/2] V4 regmap: Use reg_sequence for multi_reg_write / register_patch Mark Brown
2015-07-16 15:45   ` [alsa-devel] " Nariman Poushin
2015-07-16 20:48     ` Mark Brown

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=s5hpp3sjlfd.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=airlied@linux.ie \
    --cc=alsa-devel@alsa-project.org \
    --cc=bardliao@realtek.com \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dmurphy@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=lars@metafoo.de \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=nariman@opensource.wolfsonmicro.com \
    --cc=oder_chiou@realtek.com \
    --cc=patches@opensource.wolfsonmicro.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=sameo@linux.intel.com \
    --cc=support.opensource@diasemi.com \
    --cc=tony@atomide.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