Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1322387 > unrolled thread

[PATCH] clk: unlock for handling unregisterd clock

Started byInsu Yun <wuninsu@gmail.com>
First post2016-01-30 16:20 +0100
Last post2016-02-02 03:50 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clk: unlock for handling unregisterd clock Insu Yun <wuninsu@gmail.com> - 2016-01-30 16:20 +0100
    Re: [PATCH] clk: unlock for handling unregisterd clock Stephen Boyd <sboyd@codeaurora.org> - 2016-02-02 03:50 +0100

#1322387 — [PATCH] clk: unlock for handling unregisterd clock

FromInsu Yun <wuninsu@gmail.com>
Date2016-01-30 16:20 +0100
Subject[PATCH] clk: unlock for handling unregisterd clock
Message-ID<qWFtE-5dN-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1323745

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-02-02 03:50 +0100
Message-ID<qXzcu-3ZH-5@gated-at.bofh.it>
In reply to#1322387
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web