lkml.org 
[lkml]   [2019]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/5] reset: Add acquire/release support for arrays
From
Date
On Thu, 2019-02-21 at 16:25 +0100, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Add implementations that apply acquire and release operations to all
> reset controls part of a reset control array.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

> ---
> drivers/reset/core.c | 36 +++++++++++++++++++++++++++++++++++-
> include/linux/reset.h | 6 ++++++
> 2 files changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> index f94da91c22af..81ea77cba123 100644
> --- a/drivers/reset/core.c
> +++ b/drivers/reset/core.c
> @@ -245,6 +245,34 @@ static int reset_control_array_deassert(struct reset_control_array *resets)
> return ret;
> }
>
> +static int reset_control_array_acquire(struct reset_control_array *resets)
> +{
> + unsigned int i;
> + int err;
> +
> + for (i = 0; i < resets->num_rstcs; i++) {
> + err = reset_control_acquire(resets->rstc[i]);
> + if (err < 0)
> + goto release;
> + }

This could be done under a single mutex lock by extracting a free
version of of reset_control_acquire. Just an idea though, not sure if
that would have any measurable benefit.

regards
Philipp

\
 
 \ /
  Last update: 2019-03-19 17:44    [W:0.146 / U:0.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site