From: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Peter De Schrijver
<pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: Mike Turquette
<mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] clk: tegra: Do not print errors for clk_round_rate()
Date: Wed, 27 Nov 2013 17:34:43 +0100 [thread overview]
Message-ID: <20131127163442.GA25458@ulmo.nvidia.com> (raw)
In-Reply-To: <1385569563-25408-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]
On Wed, Nov 27, 2013 at 05:26:03PM +0100, Thierry Reding wrote:
> clk_round_rate() can be used by drivers to determine whether or not a
> frequency is supported by the clock. The current Tegra clock driver
> outputs an error message and a stacktrace when the requested rate isn't
> supported. That's fine for clk_set_rate(), but it's confusing when all
> the driver does is query whether or not a frequency is supported.
>
> Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/clk/tegra/clk-pll.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
Cc'ing Stefan, since he reported this error or IRC. Stefan, can you
check whether this fixes the issue you were seeing? In case you're not
subscribed, please let me know and I'll resend the patch.
Peter, if you're fine with applying as-is, can you add this:
Reported-by: Stefan Agner <stefan-XLVq0VzYD2Y@public.gmane.org>
to give proper credit?
Thanks,
Thierry
>
> diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c
> index 7aec773a5ca6..55ece6726108 100644
> --- a/drivers/clk/tegra/clk-pll.c
> +++ b/drivers/clk/tegra/clk-pll.c
> @@ -435,9 +435,6 @@ static int _calc_rate(struct clk_hw *hw, struct tegra_clk_pll_freq_table *cfg,
> if (cfg->m > divm_max(pll) || cfg->n > divn_max(pll) ||
> (1 << p_div) > divp_max(pll)
> || cfg->output_rate > pll->params->vco_max) {
> - pr_err("%s: Failed to set %s rate %lu\n",
> - __func__, __clk_get_name(hw->clk), rate);
> - WARN_ON(1);
> return -EINVAL;
> }
>
> @@ -584,6 +581,8 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate,
>
> if (_get_table_rate(hw, &cfg, rate, parent_rate) &&
> _calc_rate(hw, &cfg, rate, parent_rate)) {
> + pr_err("%s: Failed to set %s rate %lu\n", __func__,
> + __clk_get_name(hw->clk), rate);
> WARN_ON(1);
> return -EINVAL;
> }
> @@ -615,10 +614,8 @@ static long clk_pll_round_rate(struct clk_hw *hw, unsigned long rate,
> return __clk_get_rate(hw->clk);
>
> if (_get_table_rate(hw, &cfg, rate, *prate) &&
> - _calc_rate(hw, &cfg, rate, *prate)) {
> - WARN_ON(1);
> + _calc_rate(hw, &cfg, rate, *prate))
> return -EINVAL;
> - }
>
> return cfg.output_rate;
> }
> --
> 1.8.4.2
>
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-11-27 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-27 16:26 [PATCH] clk: tegra: Do not print errors for clk_round_rate() Thierry Reding
[not found] ` <1385569563-25408-1-git-send-email-treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-11-27 16:34 ` Thierry Reding [this message]
[not found] ` <20131127163442.GA25458-AwZRO8vwLAwmlAP/+Wk3EA@public.gmane.org>
2013-11-27 22:33 ` Stefan Agner
2013-11-27 22:52 ` Stefan Agner
2013-11-27 18:17 ` Mike Turquette
2013-11-28 14:07 ` Peter De Schrijver
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=20131127163442.GA25458@ulmo.nvidia.com \
--to=thierry.reding-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=pdeschrijver-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=stefan-XLVq0VzYD2Y@public.gmane.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