All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: unlock for handling unregisterd clock
@ 2016-01-30 15:12 Insu Yun
  2016-02-02  2:41 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: Insu Yun @ 2016-01-30 15:12 UTC (permalink / raw)
  To: mturquette, sboyd, linux-clk, linux-kernel
  Cc: taesoo, yeongjin.jang, insu, changwoo, Insu Yun

If clock is already unregistered, it returns with holding lock.
It needs to be unlocked.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
---
 drivers/clk/clk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index b4db67a..9cc2d08 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2683,6 +2683,7 @@ void clk_unregister(struct clk *clk)
 	if (clk->core->ops == &clk_nodrv_ops) {
 		pr_err("%s: unregistered clock: %s\n", __func__,
 		       clk->core->name);
+		clk_prepare_unlock();
 		return;
 	}
 	/*
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: unlock for handling unregisterd clock
  2016-01-30 15:12 [PATCH] clk: unlock for handling unregisterd clock Insu Yun
@ 2016-02-02  2:41 ` Stephen Boyd
  2016-02-02  4:21   ` Insu Yun
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2016-02-02  2:41 UTC (permalink / raw)
  To: Insu Yun
  Cc: mturquette, linux-clk, linux-kernel, taesoo, yeongjin.jang, insu,
	changwoo

On 01/30, Insu Yun wrote:
> If clock is already unregistered, it returns with holding lock.
> It needs to be unlocked.
> 
> Signed-off-by: Insu Yun <wuninsu@gmail.com>
> ---

Applied to clk-next but I changed it to a goto:

---8<---
From: Insu Yun <wuninsu@gmail.com>
Subject: [PATCH] clk: unlock for handling unregisterd clock

If clock is already unregistered, it returns with holding lock.
It needs to be unlocked.

Signed-off-by: Insu Yun <wuninsu@gmail.com>
[sboyd@codeaurora.org: Use goto instead]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
---
 drivers/clk/clk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index fff87b39944f..7d247a26a212 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2639,7 +2639,7 @@ void clk_unregister(struct clk *clk)
 	if (clk->core->ops == &clk_nodrv_ops) {
 		pr_err("%s: unregistered clock: %s\n", __func__,
 		       clk->core->name);
-		return;
+		goto unlock;
 	}
 	/*
 	 * Assign empty clock ops for consumers that might still hold
@@ -2665,7 +2665,7 @@ void clk_unregister(struct clk *clk)
 		pr_warn("%s: unregistering prepared clock: %s\n",
 					__func__, clk->core->name);
 	kref_put(&clk->core->ref, __clk_release);
-
+unlock:
 	clk_prepare_unlock();
 }
 EXPORT_SYMBOL_GPL(clk_unregister);
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] clk: unlock for handling unregisterd clock
  2016-02-02  2:41 ` Stephen Boyd
@ 2016-02-02  4:21   ` Insu Yun
  0 siblings, 0 replies; 3+ messages in thread
From: Insu Yun @ 2016-02-02  4:21 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: Michael Turquette, linux-clk, LKML, Taesoo Kim, Yeongjin Jang,
	Yun, Insu, Changwoo Min

[-- Attachment #1: Type: text/plain, Size: 1783 bytes --]

On Mon, Feb 1, 2016 at 9:41 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:

> On 01/30, Insu Yun wrote:
> > If clock is already unregistered, it returns with holding lock.
> > It needs to be unlocked.
> >
> > Signed-off-by: Insu Yun <wuninsu@gmail.com>
> > ---
>
> Applied to clk-next but I changed it to a goto:
>

Ok Thanks


>
> ---8<---
> From: Insu Yun <wuninsu@gmail.com>
> Subject: [PATCH] clk: unlock for handling unregisterd clock
>
> If clock is already unregistered, it returns with holding lock.
> It needs to be unlocked.
>
> Signed-off-by: Insu Yun <wuninsu@gmail.com>
> [sboyd@codeaurora.org: Use goto instead]
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
>  drivers/clk/clk.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index fff87b39944f..7d247a26a212 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2639,7 +2639,7 @@ void clk_unregister(struct clk *clk)
>         if (clk->core->ops == &clk_nodrv_ops) {
>                 pr_err("%s: unregistered clock: %s\n", __func__,
>                        clk->core->name);
> -               return;
> +               goto unlock;
>         }
>         /*
>          * Assign empty clock ops for consumers that might still hold
> @@ -2665,7 +2665,7 @@ void clk_unregister(struct clk *clk)
>                 pr_warn("%s: unregistering prepared clock: %s\n",
>                                         __func__, clk->core->name);
>         kref_put(&clk->core->ref, __clk_release);
> -
> +unlock:
>         clk_prepare_unlock();
>  }
>  EXPORT_SYMBOL_GPL(clk_unregister);
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
>


-- 
Regards
Insu Yun

[-- Attachment #2: Type: text/html, Size: 3097 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-02  4:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-30 15:12 [PATCH] clk: unlock for handling unregisterd clock Insu Yun
2016-02-02  2:41 ` Stephen Boyd
2016-02-02  4:21   ` Insu Yun

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.