From patchwork Wed Dec 11 11:57:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 3325301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B7BF69F1F0 for ; Wed, 11 Dec 2013 11:59:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B81820772 for ; Wed, 11 Dec 2013 11:59:41 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6552E20771 for ; Wed, 11 Dec 2013 11:59:40 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqiQR-0002HI-2w; Wed, 11 Dec 2013 11:57:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqiQ4-0001DY-DS; Wed, 11 Dec 2013 11:57:36 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VqiPN-00018g-Of for linux-arm-kernel@lists.infradead.org; Wed, 11 Dec 2013 11:56:55 +0000 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MXN00LKZ567PY60@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 11 Dec 2013 20:56:31 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.124]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 1D.90.19199.EE258A25; Wed, 11 Dec 2013 20:56:30 +0900 (KST) X-AuditID: cbfee68d-b7f5c6d000004aff-2a-52a852ee5ce0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id E1.B7.15903.EE258A25; Wed, 11 Dec 2013 20:56:30 +0900 (KST) Received: from abhilash-ubuntu.sisodomain.com ([107.108.73.92]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MXN0011U55RWB90@mmp1.samsung.com>; Wed, 11 Dec 2013 20:56:30 +0900 (KST) From: Abhilash Kesavan 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 Subject: [PATCH 3/5] clk: max77686: Replace is_enabled() with is_prepared call-back Date: Wed, 11 Dec 2013 17:27:07 +0530 Message-id: <1386763029-8516-4-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1386763029-8516-1-git-send-email-a.kesavan@samsung.com> References: <1386763029-8516-1-git-send-email-a.kesavan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnkeLIzCtJLcpLzFFi42JZI2JSo/suaEWQwYzD1haP1yxmsjgw+yGr xdllB9ksOs8+YbboXXCVzWLT42usFjPO72OyeDrhIpvFqeuf2SzmTH/H5MDlMbvhIovHnWt7 2Dw2L6n3OD9jIaPHlRNNrB59W1YxenzeJBfAHsVlk5Kak1mWWqRvl8CVsWDeP9aCtxIVk1de YGlg7BLrYuTkkBAwkVjVeI8ZwhaTuHBvPVsXIxeHkMBSRomV3Q2sMEWL3s5khkgsYpSY3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5j2vGCcw 8i5gZFjFKJpakFxQnJSea6RXnJhbXJqXrpecn7uJERx3z6R3MK5qsDjEKMDBqMTDe6BoeZAQ a2JZcWXuIUYJDmYlEd5PniuChHhTEiurUovy44tKc1KLDzEmAx01kVlKNDkfmBLySuINjU3M TY1NLU0sTMwsSRNWEuc92GodKCSQnliSmp2aWpBaBLOFiYNTqoExxjB2SueeKZHt4gscj7tM 2hxhxNiVwzsjrXz33YqpDpXrVeYlPwtRrJ6678pXUe9mtjdXHJ2viPyp6jMwV7Rhfaj0vmTz B8FuHvn9/s8PNNkWT9qo8vDH44Iv7LNWz/zxzOaoEuPLCDaP6/svO7oHMDg8Vp+/KbyyhbdM 4/7MCwqKV5RXMBxVYinOSDTUYi4qTgQAcFK6P/8CAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131211_065654_068559_D50DAC96 X-CRM114-Status: GOOD ( 12.31 ) X-Spam-Score: -7.1 (-------) Cc: Abhilash Kesavan X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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] [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14) [ 2921.993269] [] (show_stack+0x10/0x14) from [] (dump_stack+0x64/0xa4) [ 2922.001340] [] (dump_stack+0x64/0xa4) from [] (__schedule_bug+0x48/0x60) [ 2922.009758] [] (__schedule_bug+0x48/0x60) from [] (__schedule+0x468/0x504) [ 2922.018351] [] (__schedule+0x468/0x504) from [] (schedule_timeout+0x114/0x19c) [ 2922.027294] [] (schedule_timeout+0x114/0x19c) from [] (s3c24xx_i2c_xfer+0x1cc/0x320) [ 2922.036754] [] (s3c24xx_i2c_xfer+0x1cc/0x320) from [] (__i2c_transfer+0x44/0x7c) [ 2922.045868] [] (__i2c_transfer+0x44/0x7c) from [] (i2c_transfer+0x74/0x98) [ 2922.054462] [] (i2c_transfer+0x74/0x98) from [] (regmap_i2c_read+0x48/0x64) [ 2922.063142] [] (regmap_i2c_read+0x48/0x64) from [] (_regmap_raw_read+0xa8/0xfc) [ 2922.072168] [] (_regmap_raw_read+0xa8/0xfc) from [] (_regmap_bus_read+0x28/0x48) [ 2922.081281] [] (_regmap_bus_read+0x28/0x48) from [] (_regmap_read+0x5c/0xc4) [ 2922.090048] [] (_regmap_read+0x5c/0xc4) from [] (regmap_read+0x44/0x5c) [ 2922.098383] [] (regmap_read+0x44/0x5c) from [] (max77686_clk_is_enabled+0x20/0x3c) [ 2922.107670] [] (max77686_clk_is_enabled+0x20/0x3c) from [] (clk_disable_unused_subtree+0x6c/0xa8) [ 2922.118258] [] (clk_disable_unused_subtree+0x6c/0xa8) from [] (clk_disable_unused+0x30/0xd8) [ 2922.128414] [] (clk_disable_unused+0x30/0xd8) from [] (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 --- 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] = {