public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Turquette <mturquette@linaro.org>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	"Stephen Boyd" <sboyd@codeaurora.org>,
	linux-kernel@vger.kernel.org
Cc: "Krzysztof Kozlowski" <k.kozlowski@samsung.com>
Subject: Re: [PATCH] clk: Use lockdep asserts to find missing hold of prepare_lock
Date: Wed, 25 Feb 2015 11:40:58 -0800	[thread overview]
Message-ID: <20150225194058.421.42458@quantum> (raw)
In-Reply-To: <1420792090-14174-1-git-send-email-k.kozlowski@samsung.com>

Quoting Krzysztof Kozlowski (2015-01-09 00:28:10)
> Add lockdep asserts for holding the prepare_lock to all functions
> marking this as a requirement in description. Add this to private and
> exported functions so all locking misuse could be detected during
> debugging.
> 
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Applied.

Thanks,
Mike

> ---
>  drivers/clk/clk.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index f4963b7d4e17..cdbfaa34ace4 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -432,6 +432,8 @@ static void clk_unprepare_unused_subtree(struct clk *clk)
>  {
>         struct clk *child;
>  
> +       lockdep_assert_held(&prepare_lock);
> +
>         if (!clk)
>                 return;
>  
> @@ -458,6 +460,8 @@ static void clk_disable_unused_subtree(struct clk *clk)
>         struct clk *child;
>         unsigned long flags;
>  
> +       lockdep_assert_held(&prepare_lock);
> +
>         if (!clk)
>                 goto out;
>  
> @@ -947,6 +951,8 @@ unsigned long __clk_round_rate(struct clk *clk, unsigned long rate)
>         struct clk *parent;
>         struct clk_hw *parent_hw;
>  
> +       lockdep_assert_held(&prepare_lock);
> +
>         if (!clk)
>                 return 0;
>  
> @@ -1040,6 +1046,8 @@ static void __clk_recalc_accuracies(struct clk *clk)
>         unsigned long parent_accuracy = 0;
>         struct clk *child;
>  
> +       lockdep_assert_held(&prepare_lock);
> +
>         if (clk->parent)
>                 parent_accuracy = clk->parent->accuracy;
>  
> @@ -1104,6 +1112,8 @@ static void __clk_recalc_rates(struct clk *clk, unsigned long msg)
>         unsigned long parent_rate = 0;
>         struct clk *child;
>  
> +       lockdep_assert_held(&prepare_lock);
> +
>         old_rate = clk->rate;
>  
>         if (clk->parent)
> @@ -1297,6 +1307,8 @@ static int __clk_speculate_rates(struct clk *clk, unsigned long parent_rate)
>         unsigned long new_rate;
>         int ret = NOTIFY_DONE;
>  
> +       lockdep_assert_held(&prepare_lock);
> +
>         new_rate = clk_recalc(clk, parent_rate);
>  
>         /* abort rate change if a driver returns NOTIFY_BAD or NOTIFY_STOP */
> @@ -2110,6 +2122,8 @@ static void __clk_release(struct kref *ref)
>         struct clk *clk = container_of(ref, struct clk, ref);
>         int i = clk->num_parents;
>  
> +       lockdep_assert_held(&prepare_lock);
> +
>         kfree(clk->parents);
>         while (--i >= 0)
>                 kfree(clk->parent_names[i]);
> -- 
> 1.9.1
> 

      reply	other threads:[~2015-02-25 19:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09  8:28 [PATCH] clk: Use lockdep asserts to find missing hold of prepare_lock Krzysztof Kozlowski
2015-02-25 19:40 ` Mike Turquette [this message]

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=20150225194058.421.42458@quantum \
    --to=mturquette@linaro.org \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sboyd@codeaurora.org \
    /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