lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <s5hpp3sjlfd.wl-tiwai@suse.de>
Date:	Thu, 16 Jul 2015 15:12:38 +0200
From:	Takashi Iwai <tiwai@...e.de>
To:	Nariman Poushin <nariman@...nsource.wolfsonmicro.com>
Cc:	broonie@...nel.org, alsa-devel@...a-project.org, airlied@...ux.ie,
	dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
	peter.ujfalusi@...com, bardliao@...ltek.com, lee.jones@...aro.org,
	laurent.pinchart+renesas@...asonboard.com, sameo@...ux.intel.com,
	patches@...nsource.wolfsonmicro.com, Paul.Handrigan@...rus.com,
	tony@...mide.com, lars@...afoo.de, dmurphy@...com,
	linux-omap@...r.kernel.org, oder_chiou@...ltek.com,
	brian.austin@...rus.com, support.opensource@...semi.com,
	gregkh@...uxfoundation.org, dmitry.torokhov@...il.com,
	lgirdwood@...il.com
Subject: Re: [alsa-devel] [PATCH 2/2] V4 regmap: Apply optional delay in	multi_reg_write/register_patch

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@...nsource.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ