From: "Heiko Stübner" <heiko@sntech.de>
To: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: Re: [PATCH v1 1/1] clk: fractional-divider: Move mask calculations out of lock
Date: Mon, 04 Mar 2024 08:05:54 +0100 [thread overview]
Message-ID: <2254891.Dhsi8hcfAM@diego> (raw)
In-Reply-To: <20240303121410.240761-1-andy.shevchenko@gmail.com>
Am Sonntag, 3. März 2024, 13:14:10 CET schrieb Andy Shevchenko:
> There is no need to calculate masks under the lock taken.
> Move them out of it.
>
> Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
> ---
> drivers/clk/clk-fractional-divider.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c
> index a0178182fc72..da057172cc90 100644
> --- a/drivers/clk/clk-fractional-divider.c
> +++ b/drivers/clk/clk-fractional-divider.c
> @@ -195,14 +195,14 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate,
> n--;
> }
>
> + mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift;
> + nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift;
> +
> if (fd->lock)
> spin_lock_irqsave(fd->lock, flags);
> else
> __acquire(fd->lock);
>
> - mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift;
> - nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift;
> -
> val = clk_fd_readl(fd);
> val &= ~(mmask | nmask);
> val |= (m << fd->mshift) | (n << fd->nshift);
>
next prev parent reply other threads:[~2024-03-04 7:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-03 12:14 [PATCH v1 1/1] clk: fractional-divider: Move mask calculations out of lock Andy Shevchenko
2024-03-04 3:28 ` Chen-Yu Tsai
2024-03-04 7:05 ` Heiko Stübner [this message]
2024-03-09 1:06 ` Stephen Boyd
2024-03-09 16:29 ` Andy Shevchenko
2024-03-09 7:19 ` Christophe JAILLET
2024-03-09 16:27 ` Andy Shevchenko
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=2254891.Dhsi8hcfAM@diego \
--to=heiko@sntech.de \
--cc=andy.shevchenko@gmail.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.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;
as well as URLs for NNTP newsgroup(s).