linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mfd: arizona: Correct calling of runtime_put_sync
@ 2018-08-21 14:22 sapthagiri.baratam
  2018-08-22  8:09 ` Charles Keepax
  2018-09-10 15:02 ` Lee Jones
  0 siblings, 2 replies; 3+ messages in thread
From: sapthagiri.baratam @ 2018-08-21 14:22 UTC (permalink / raw)
  To: lee.jones; +Cc: patches, linux-kernel, Sapthagiri Baratam

From: Sapthagiri Baratam <sapthagiri.baratam@cirrus.com>

Don't call runtime_put_sync when clk32k_ref is ARIZONA_32KZ_MCLK2
as there is no corresponding runtime_get_sync call.

MCLK1 is not in the AoD power domain so if it is used as 32kHz clock
source we need to hold a runtime PM reference to keep the device from
going into low power mode.

fixes: cdd8da8cc66b ("mfd: arizona: Add gating of external MCLKn clocks")
Signed-off-by: Sapthagiri Baratam <sapthagiri.baratam@cirrus.com>
---
Changes in v2:
- changed signed-off in commit message to full name

 drivers/mfd/arizona-core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index c7c3d72..190f9a4 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -53,8 +53,10 @@ int arizona_clk32k_enable(struct arizona *arizona)
 			if (ret != 0)
 				goto err_ref;
 			ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]);
-			if (ret != 0)
-				goto err_pm;
+			if (ret != 0) {
+				pm_runtime_put_sync(arizona->dev);
+				goto err_ref;
+			}
 			break;
 		case ARIZONA_32KZ_MCLK2:
 			ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK2]);
@@ -68,8 +70,6 @@ int arizona_clk32k_enable(struct arizona *arizona)
 					 ARIZONA_CLK_32K_ENA);
 	}
 
-err_pm:
-	pm_runtime_put_sync(arizona->dev);
 err_ref:
 	if (ret != 0)
 		arizona->clk32k_ref--;
-- 
1.9.1


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

* Re: [PATCH v2] mfd: arizona: Correct calling of runtime_put_sync
  2018-08-21 14:22 [PATCH v2] mfd: arizona: Correct calling of runtime_put_sync sapthagiri.baratam
@ 2018-08-22  8:09 ` Charles Keepax
  2018-09-10 15:02 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2018-08-22  8:09 UTC (permalink / raw)
  To: sapthagiri.baratam; +Cc: lee.jones, patches, linux-kernel, Sapthagiri Baratam

On Tue, Aug 21, 2018 at 07:52:44PM +0530, sapthagiri.baratam@gmail.com wrote:
> From: Sapthagiri Baratam <sapthagiri.baratam@cirrus.com>
> 
> Don't call runtime_put_sync when clk32k_ref is ARIZONA_32KZ_MCLK2
> as there is no corresponding runtime_get_sync call.
> 
> MCLK1 is not in the AoD power domain so if it is used as 32kHz clock
> source we need to hold a runtime PM reference to keep the device from
> going into low power mode.
> 
> fixes: cdd8da8cc66b ("mfd: arizona: Add gating of external MCLKn clocks")
> Signed-off-by: Sapthagiri Baratam <sapthagiri.baratam@cirrus.com>
> ---

Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Thanks,
Charles

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

* Re: [PATCH v2] mfd: arizona: Correct calling of runtime_put_sync
  2018-08-21 14:22 [PATCH v2] mfd: arizona: Correct calling of runtime_put_sync sapthagiri.baratam
  2018-08-22  8:09 ` Charles Keepax
@ 2018-09-10 15:02 ` Lee Jones
  1 sibling, 0 replies; 3+ messages in thread
From: Lee Jones @ 2018-09-10 15:02 UTC (permalink / raw)
  To: sapthagiri.baratam; +Cc: patches, linux-kernel, Sapthagiri Baratam

On Tue, 21 Aug 2018, sapthagiri.baratam@gmail.com wrote:

> From: Sapthagiri Baratam <sapthagiri.baratam@cirrus.com>
> 
> Don't call runtime_put_sync when clk32k_ref is ARIZONA_32KZ_MCLK2
> as there is no corresponding runtime_get_sync call.
> 
> MCLK1 is not in the AoD power domain so if it is used as 32kHz clock
> source we need to hold a runtime PM reference to keep the device from
> going into low power mode.
> 
> fixes: cdd8da8cc66b ("mfd: arizona: Add gating of external MCLKn clocks")
> Signed-off-by: Sapthagiri Baratam <sapthagiri.baratam@cirrus.com>
> ---
> Changes in v2:
> - changed signed-off in commit message to full name
> 
>  drivers/mfd/arizona-core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

end of thread, other threads:[~2018-09-10 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-21 14:22 [PATCH v2] mfd: arizona: Correct calling of runtime_put_sync sapthagiri.baratam
2018-08-22  8:09 ` Charles Keepax
2018-09-10 15:02 ` Lee Jones

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