projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9b6c057
)
clk: fractional-divider: Move mask calculations out of lock
author
Andy Shevchenko
<andy.shevchenko@gmail.com>
Sun, 3 Mar 2024 12:14:10 +0000
(14:14 +0200)
committer
Stephen Boyd
<sboyd@kernel.org>
Sat, 9 Mar 2024 01:04:04 +0000
(17:04 -0800)
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>
Link:
https://lore.kernel.org/r/20240303121410.240761-1-andy.shevchenko@gmail.com
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-fractional-divider.c
patch
|
blob
|
history
diff --git
a/drivers/clk/clk-fractional-divider.c
b/drivers/clk/clk-fractional-divider.c
index 5067e067e90666d75114afc144e7ca1462ccc8e6..bd882c45385bbd90e4ffc58f611793a5a906fb08 100644
(file)
--- 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);