linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: clk-gpio: Allow GPIO to sleep in set/get_parent
@ 2018-03-13  8:54 Mike Looijmans
  2018-03-19 20:53 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Mike Looijmans @ 2018-03-13  8:54 UTC (permalink / raw)
  To: linux-clk; +Cc: linux-kernel, mturquette, sboyd, Mike Looijmans

When changing or retrieving clock parents, the caller is in a sleepable
state (like prepare) so the GPIO operation need not be atomic. Replace
gpiod_{g|s}et_value with gpiod_{g|s}et_value_cansleep in the {g|s}et_parent
calls for the GPIO based clock mux.

This fixes a "slowpath" warning when the GPIO controller is an I2C expander
or something similar.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
---
 drivers/clk/clk-gpio.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 151513c..40af4fb 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -73,14 +73,14 @@ static u8 clk_gpio_mux_get_parent(struct clk_hw *hw)
 {
 	struct clk_gpio *clk = to_clk_gpio(hw);
 
-	return gpiod_get_value(clk->gpiod);
+	return gpiod_get_value_cansleep(clk->gpiod);
 }
 
 static int clk_gpio_mux_set_parent(struct clk_hw *hw, u8 index)
 {
 	struct clk_gpio *clk = to_clk_gpio(hw);
 
-	gpiod_set_value(clk->gpiod, index);
+	gpiod_set_value_cansleep(clk->gpiod, index);
 
 	return 0;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: clk-gpio: Allow GPIO to sleep in set/get_parent
  2018-03-13  8:54 [PATCH] clk: clk-gpio: Allow GPIO to sleep in set/get_parent Mike Looijmans
@ 2018-03-19 20:53 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2018-03-19 20:53 UTC (permalink / raw)
  To: Mike Looijmans, linux-clk; +Cc: linux-kernel, mturquette, Mike Looijmans

Quoting Mike Looijmans (2018-03-13 01:54:03)
> When changing or retrieving clock parents, the caller is in a sleepable
> state (like prepare) so the GPIO operation need not be atomic. Replace
> gpiod_{g|s}et_value with gpiod_{g|s}et_value_cansleep in the {g|s}et_parent
> calls for the GPIO based clock mux.
> 
> This fixes a "slowpath" warning when the GPIO controller is an I2C expander
> or something similar.
> 
> Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
> ---

Applied to clk-next

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-19 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-13  8:54 [PATCH] clk: clk-gpio: Allow GPIO to sleep in set/get_parent Mike Looijmans
2018-03-19 20:53 ` Stephen Boyd

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).