All of lore.kernel.org
 help / color / mirror / Atom feed
From: Abhilash Kesavan <a.kesavan@samsung.com>
To: dianders@chromium.org, olof@lixom.net, kgene.kim@samsung.com,
	jonghwa3.lee@samsung.com, yadi.brar@samsung.com,
	mturquette@linaro.org, linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org,
	devicetree-discuss@lists.ozlabs.org
Cc: Abhilash Kesavan <a.kesavan@samsung.com>
Subject: [PATCH 3/5] clk: max77686: Replace is_enabled() with is_prepared call-back
Date: Wed, 11 Dec 2013 17:27:07 +0530	[thread overview]
Message-ID: <1386763029-8516-4-git-send-email-a.kesavan@samsung.com> (raw)
In-Reply-To: <1386763029-8516-1-git-send-email-a.kesavan@samsung.com>

Following messages are observed when unused PMIC clocks are being
disabled during boot-up:
[ 2921.969560] BUG: scheduling while atomic: swapper/0/1/0x00000002
[ 2921.974080] Modules linked in:
[ 2921.977120] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.13.0-rc1-00018-g8465d57 #27
[ 2921.984772] [<c0013c80>] (unwind_backtrace+0x0/0xf8) from [<c00110cc>] (show_stack+0x10/0x14)
[ 2921.993269] [<c00110cc>] (show_stack+0x10/0x14) from [<c032c10c>] (dump_stack+0x64/0xa4)
[ 2922.001340] [<c032c10c>] (dump_stack+0x64/0xa4) from [<c0329b00>] (__schedule_bug+0x48/0x60)
[ 2922.009758] [<c0329b00>] (__schedule_bug+0x48/0x60) from [<c032d414>] (__schedule+0x468/0x504)
[ 2922.018351] [<c032d414>] (__schedule+0x468/0x504) from [<c032caac>] (schedule_timeout+0x114/0x19c)
[ 2922.027294] [<c032caac>] (schedule_timeout+0x114/0x19c) from [<c0255c00>] (s3c24xx_i2c_xfer+0x1cc/0x320)
[ 2922.036754] [<c0255c00>] (s3c24xx_i2c_xfer+0x1cc/0x320) from [<c0252e08>] (__i2c_transfer+0x44/0x7c)
[ 2922.045868] [<c0252e08>] (__i2c_transfer+0x44/0x7c) from [<c025416c>] (i2c_transfer+0x74/0x98)
[ 2922.054462] [<c025416c>] (i2c_transfer+0x74/0x98) from [<c021ed38>] (regmap_i2c_read+0x48/0x64)
[ 2922.063142] [<c021ed38>] (regmap_i2c_read+0x48/0x64) from [<c021b41c>] (_regmap_raw_read+0xa8/0xfc)
[ 2922.072168] [<c021b41c>] (_regmap_raw_read+0xa8/0xfc) from [<c021b780>] (_regmap_bus_read+0x28/0x48)
[ 2922.081281] [<c021b780>] (_regmap_bus_read+0x28/0x48) from [<c0219d30>] (_regmap_read+0x5c/0xc4)
[ 2922.090048] [<c0219d30>] (_regmap_read+0x5c/0xc4) from [<c0219ddc>] (regmap_read+0x44/0x5c)
[ 2922.098383] [<c0219ddc>] (regmap_read+0x44/0x5c) from [<c0290bdc>] (max77686_clk_is_enabled+0x20/0x3c)
[ 2922.107670] [<c0290bdc>] (max77686_clk_is_enabled+0x20/0x3c) from [<c028cfdc>] (clk_disable_unused_subtree+0x6c/0xa8)
[ 2922.118258] [<c028cfdc>] (clk_disable_unused_subtree+0x6c/0xa8) from [<c028dc90>] (clk_disable_unused+0x30/0xd8)
[ 2922.128414] [<c028dc90>] (clk_disable_unused+0x30/0xd8) from [<c00087a8>] (do_one_initcall+0x38/0x160)

Fix it by replacing is_enabled call-back with is_prepared as the i2c driver may
sleep during a transfer.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
 drivers/clk/clk-max77686.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
index 9f57bc3..e39d463 100644
--- a/drivers/clk/clk-max77686.c
+++ b/drivers/clk/clk-max77686.c
@@ -66,7 +66,7 @@ static void max77686_clk_unprepare(struct clk_hw *hw)
 		MAX77686_REG_32KHZ, max77686->mask, ~max77686->mask);
 }
 
-static int max77686_clk_is_enabled(struct clk_hw *hw)
+static int max77686_clk_is_prepared(struct clk_hw *hw)
 {
 	struct max77686_clk *max77686 = to_max77686_clk(hw);
 	int ret;
@@ -84,7 +84,7 @@ static int max77686_clk_is_enabled(struct clk_hw *hw)
 static struct clk_ops max77686_clk_ops = {
 	.prepare	= max77686_clk_prepare,
 	.unprepare	= max77686_clk_unprepare,
-	.is_enabled	= max77686_clk_is_enabled,
+	.is_prepared	= max77686_clk_is_prepared,
 };
 
 static struct clk_init_data max77686_clks_init[MAX77686_CLKS_NUM] = {
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: a.kesavan@samsung.com (Abhilash Kesavan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/5] clk: max77686: Replace is_enabled() with is_prepared call-back
Date: Wed, 11 Dec 2013 17:27:07 +0530	[thread overview]
Message-ID: <1386763029-8516-4-git-send-email-a.kesavan@samsung.com> (raw)
In-Reply-To: <1386763029-8516-1-git-send-email-a.kesavan@samsung.com>

Following messages are observed when unused PMIC clocks are being
disabled during boot-up:
[ 2921.969560] BUG: scheduling while atomic: swapper/0/1/0x00000002
[ 2921.974080] Modules linked in:
[ 2921.977120] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.13.0-rc1-00018-g8465d57 #27
[ 2921.984772] [<c0013c80>] (unwind_backtrace+0x0/0xf8) from [<c00110cc>] (show_stack+0x10/0x14)
[ 2921.993269] [<c00110cc>] (show_stack+0x10/0x14) from [<c032c10c>] (dump_stack+0x64/0xa4)
[ 2922.001340] [<c032c10c>] (dump_stack+0x64/0xa4) from [<c0329b00>] (__schedule_bug+0x48/0x60)
[ 2922.009758] [<c0329b00>] (__schedule_bug+0x48/0x60) from [<c032d414>] (__schedule+0x468/0x504)
[ 2922.018351] [<c032d414>] (__schedule+0x468/0x504) from [<c032caac>] (schedule_timeout+0x114/0x19c)
[ 2922.027294] [<c032caac>] (schedule_timeout+0x114/0x19c) from [<c0255c00>] (s3c24xx_i2c_xfer+0x1cc/0x320)
[ 2922.036754] [<c0255c00>] (s3c24xx_i2c_xfer+0x1cc/0x320) from [<c0252e08>] (__i2c_transfer+0x44/0x7c)
[ 2922.045868] [<c0252e08>] (__i2c_transfer+0x44/0x7c) from [<c025416c>] (i2c_transfer+0x74/0x98)
[ 2922.054462] [<c025416c>] (i2c_transfer+0x74/0x98) from [<c021ed38>] (regmap_i2c_read+0x48/0x64)
[ 2922.063142] [<c021ed38>] (regmap_i2c_read+0x48/0x64) from [<c021b41c>] (_regmap_raw_read+0xa8/0xfc)
[ 2922.072168] [<c021b41c>] (_regmap_raw_read+0xa8/0xfc) from [<c021b780>] (_regmap_bus_read+0x28/0x48)
[ 2922.081281] [<c021b780>] (_regmap_bus_read+0x28/0x48) from [<c0219d30>] (_regmap_read+0x5c/0xc4)
[ 2922.090048] [<c0219d30>] (_regmap_read+0x5c/0xc4) from [<c0219ddc>] (regmap_read+0x44/0x5c)
[ 2922.098383] [<c0219ddc>] (regmap_read+0x44/0x5c) from [<c0290bdc>] (max77686_clk_is_enabled+0x20/0x3c)
[ 2922.107670] [<c0290bdc>] (max77686_clk_is_enabled+0x20/0x3c) from [<c028cfdc>] (clk_disable_unused_subtree+0x6c/0xa8)
[ 2922.118258] [<c028cfdc>] (clk_disable_unused_subtree+0x6c/0xa8) from [<c028dc90>] (clk_disable_unused+0x30/0xd8)
[ 2922.128414] [<c028dc90>] (clk_disable_unused+0x30/0xd8) from [<c00087a8>] (do_one_initcall+0x38/0x160)

Fix it by replacing is_enabled call-back with is_prepared as the i2c driver may
sleep during a transfer.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
---
 drivers/clk/clk-max77686.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
index 9f57bc3..e39d463 100644
--- a/drivers/clk/clk-max77686.c
+++ b/drivers/clk/clk-max77686.c
@@ -66,7 +66,7 @@ static void max77686_clk_unprepare(struct clk_hw *hw)
 		MAX77686_REG_32KHZ, max77686->mask, ~max77686->mask);
 }
 
-static int max77686_clk_is_enabled(struct clk_hw *hw)
+static int max77686_clk_is_prepared(struct clk_hw *hw)
 {
 	struct max77686_clk *max77686 = to_max77686_clk(hw);
 	int ret;
@@ -84,7 +84,7 @@ static int max77686_clk_is_enabled(struct clk_hw *hw)
 static struct clk_ops max77686_clk_ops = {
 	.prepare	= max77686_clk_prepare,
 	.unprepare	= max77686_clk_unprepare,
-	.is_enabled	= max77686_clk_is_enabled,
+	.is_prepared	= max77686_clk_is_prepared,
 };
 
 static struct clk_init_data max77686_clks_init[MAX77686_CLKS_NUM] = {
-- 
1.7.9.5

  parent reply	other threads:[~2013-12-11 11:56 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 11:57 [PATCH 0/5] Power Related Fixes for Exynos5250 Abhilash Kesavan
2013-12-11 11:57 ` Abhilash Kesavan
2013-12-11 11:57 ` [PATCH 1/5] clk: samsung: exynos5250: Add CLK_IGNORE_UNUSED flag for the sysreg clock Abhilash Kesavan
2013-12-11 11:57   ` Abhilash Kesavan
2013-12-11 23:55   ` Doug Anderson
2013-12-11 23:55     ` Doug Anderson
2013-12-12  0:13     ` Tomasz Figa
2013-12-12  0:13       ` Tomasz Figa
2013-12-12  0:30       ` Doug Anderson
2013-12-12  0:30         ` Doug Anderson
2013-12-12  4:36         ` Abhilash Kesavan
2013-12-12  4:36           ` Abhilash Kesavan
2013-12-12  9:53           ` Tomasz Figa
2013-12-12  9:53             ` Tomasz Figa
2013-12-30 17:49   ` Tomasz Figa
2013-12-30 17:49     ` Tomasz Figa
2013-12-11 11:57 ` [PATCH 2/5] ARM: EXYNOS5: Fix PMU register configuration for local power blocks Abhilash Kesavan
2013-12-11 11:57   ` Abhilash Kesavan
2013-12-11 12:29   ` Tomasz Figa
2013-12-11 12:29     ` Tomasz Figa
2013-12-12  2:43     ` Abhilash Kesavan
2013-12-12  2:43       ` Abhilash Kesavan
2013-12-11 11:57 ` Abhilash Kesavan [this message]
2013-12-11 11:57   ` [PATCH 3/5] clk: max77686: Replace is_enabled() with is_prepared call-back Abhilash Kesavan
2013-12-11 12:24   ` Tomasz Figa
2013-12-11 12:24     ` Tomasz Figa
2013-12-12  2:47     ` Abhilash Kesavan
2013-12-12  2:47       ` Abhilash Kesavan
2013-12-11 11:57 ` [PATCH 4/5] ARM: EXYNOS5250: Implement pm_power_off Abhilash Kesavan
2013-12-11 11:57   ` Abhilash Kesavan
2013-12-11 11:57 ` [PATCH 5/5] ARM: dts: Setup the interrupt parent for max77686 Abhilash Kesavan
2013-12-11 11:57   ` Abhilash Kesavan
2013-12-11 23:57   ` Doug Anderson
2013-12-11 23:57     ` Doug Anderson
2013-12-12  2:50     ` Abhilash Kesavan
2013-12-12  2:50       ` Abhilash Kesavan
2013-12-11 12:41 ` [PATCH 0/5] Power Related Fixes for Exynos5250 Tomasz Figa
2013-12-11 12:41   ` Tomasz Figa
2013-12-12  2:42   ` Abhilash Kesavan
2013-12-12  2:42     ` Abhilash Kesavan

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=1386763029-8516-4-git-send-email-a.kesavan@samsung.com \
    --to=a.kesavan@samsung.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=dianders@chromium.org \
    --cc=jonghwa3.lee@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=olof@lixom.net \
    --cc=yadi.brar@samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.